環境

 ホストOS:Debian GNU/Linux 10.7
ゲストOS:FreeBSD 12.2-RELEASE r366954 GENERIC amd64

 

▼mariadbインストール

# pkg install mariadb105-server
# pkg install mariadb105-client

 

▼起動設定

# vi /etc/rc.conf
mysql_enable="YES"

 

▼mariadb起動

# service mysql-server start

MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc and /usr/local/etc/mysql.

This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port

 

▼phpMyAdminインストール

# pkg install phpMyAdmin-php74-4.9.5

--
phpMyAdmin-php74-4.9.5 has been installed into:
    /usr/local/www/phpMyAdmin
    Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
    <Directory "/usr/local/www/phpMyAdmin/">
        Options None
        AllowOverride Limit
        Require local
        Require host .example.com
    </Directory>

 

▼オーナをwww:wwwに設定する

# chown -R www:www /usr/local/www/phpMyAdmin

 

▼サンプルファイルをコピーする

# cp /usr/local/www/phpMyAdmin/config.sample.inc.php config.inc.php
# chmod 660 /usr/local/www/phpMyAdmin/config.inc.php

 

▼Aliasを設定する

※Alias→hoge/とした。

vi /usr/local/etc/apache24/Includes/phpmyadmin.conf
# phpMyAdmin default Apache configuration
Alias /hoge/ "/usr/local/www/phpMyAdmin/"

<Directory "/usr/local/www/phpMyAdmin/">
        Options None
        AllowOverride Limit
        Require local
        Require ip 192.168.0.0/24
        Require ip 202.231.XXX.XXX
</Directory>

 

▼httpd.confに追記

Include /usr/local/etc/apache24/Includes/phpmyadmin.conf

 

▼ブラウザでアクセスする

 

以上