[Koha-devel] koha-create with remote mariadb server

David Schmidt mail at davidschmidt.at
Fri Sep 30 15:46:09 CEST 2022


with the help from koha irc and lots of try&error&code-reading I figured some things out

### on your database server:

apt update && apt install -y mariadb-server
sed -i -e 's/^bind-address\s*=\s*127\.0\.0\.1$/bind-address = */' /etc/mysql/mariadb.conf.d/50-server.cnf
/etc/init.d/mariadb restart
mysql -e "CREATE DATABASE koha_demo;"
mysql -e "CREATE USER 'koha_demo'@'%' IDENTIFIED BY 'kohadbpw';"
mysql -e "GRANT ALL PRIVILEGES on koha_demo.* TO koha_demo;"
mysql -e "FLUSH PRIVILEGES;"

### on your koha server
apt update && apt install -y wget gnupg
wget -q -O- https://debian.koha-community.org/koha/gpg.asc | apt-key add -
echo 'deb http://debian.koha-community.org/koha 22.05 main' | tee /etc/apt/sources.list.d/koha.list
apt update
apt install koha-common -y

a2enmod rewrite
a2enmod cgi
service apache2 restart

mv /etc/mysql/koha-common.cnf /etc/mysql/koha-common.cnf.bak
echo "[client]
host = mariadb
user = koha_demo
password = kohadbpw" > /etc/mysql/koha-common.cnf

sed -i -e 's/^DOMAIN="\.myDNSname\.org"$/DOMAIN=".koha-support.eu"/' /etc/koha/koha-sites.conf
sed -i -e 's/^OPACSUFFIX=""$/OPACSUFFIX="-opac"/' /etc/koha/koha-sites.conf

#instance:username:password:dbname:dbhost
echo "koha-demo:koha_demo:kohadbpw:koha_demo:mariadb" > koha_db_passwdfile.txt

koha-create --passwdfile=koha_db_passwdfile.txt --use-db koha-demo

On Thu, 29 Sep 2022, at 6:47 PM, David Schmidt wrote:
> im trying to create a koha instance configured for a remote mariadb server
> 
> https://wiki.koha-community.org/wiki/Debian#Create_a_Koha_instance
> 
> > remove /etc/mysql/koha-common.cnf
> > create a new file in its place containing the connection
>                   information for the server, in the form of a my.cnf file.
> 
> what does that mean? the only my.cnf file that I can find on the system is /etc/mysql/my.cnf and that doesnt look right
> 
> 
> $ koha-create --dbhost 172.23.0.3 --database kohadb --request-db koha-demo
> $ vim koha-demo-db-request.txt
> $ koha-create --dbhost 172.23.0.3 --database kohadb --populate-db koha-demo
> Koha instance is empty, no staff user created.
> 
> after that I still see the autogenerated password in /etc/koha/sites/koha-demo/koha-conf.xml and the mariadb database is empty
> 
> after reading the koha-create source i have a feeling this --request-db/--populate-db stuff cant possibly work. --populate-db is trying to get the db passwort using getinstancemysqluser() but that function is a wrapper around xmlstarlet and i was just told by `koha-create --request-db` to write the new db password into this txt file.
>  
> I will update the wiki after I figured this out
> 
> cheers
> david
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : https://www.koha-community.org/
> git : https://git.koha-community.org/
> bugs : https://bugs.koha-community.org/
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20220930/79473b20/attachment.htm>


More information about the Koha-devel mailing list