Mysql / Adminer / Apache in FreeBSD jail
Prerequisites :
create the jail, and add a ZFS mount to store the databases in another dataset
mount the dataset to /mnt/db-data
install mysql
# install + start at boot with custom config filepkg install mariadb104-server
sysrc mysql_enable="YES"
sysrc mysql_pidfile=/var/db/mysql/mysql.pid
sysrc mysql_optfile=/usr/local/etc/mysql/my.cnf
# set proper owner for the zfs mounted dataset
chown -R mysql:mysql /mnt/db-data
-> restart the jail
# setup the database
mysql_secure_installation --socket=/mnt/db-data/mysql.sock
logs location : /var/db/mysql/*.log
install adminer
pkg install adminerthe adminer php file is at
/usr/local/www/adminer/adminer/index.php
install apache
# in order to serve adminerpkg install apache24
sysrc apache24_enable="yes"
service apache24 start
add to /usr/local/etc/apache24/Includes/adminer.conf the config :
<VirtualHost *:80>
ServerName 127.0.0.1
ServerAlias adminer
DocumentRoot "/usr/local/www/adminer/adminer/"
ErrorLog "/var/log/adminer-error.log"
CustomLog "/var/log/adminer-access_log" combined
</VirtualHost>
setup php
# give a php configuration filecp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
# needed to work with adminer
change line mysqli.default_socket=
mysqli.default_socket = /mnt/db-data/mysql.sock
# make apache interpret the php
add this to /usr/local/etc/apache24/Includes/php.conf
<IfModule dir_module>
DirectoryIndex index.php index.html
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
</IfModule>
service apache24 reload
Aucun commentaire:
Enregistrer un commentaire