phpPgAdminにhttp://192.168.55.105/phpmyadmin/でアクセスします。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604phppgadmin"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604phppgadmin"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.105", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.105", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
# update packages
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install postgresql
apt-get -y install postgresql
echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf
echo "standard_conforming_strings=off" >> /etc/postgresql/9.5/main/postgresql.conf
#sed -i 's/host.*all.*all.*127.0.0.1/#host all all 127.0.0.1/g' /etc/postgresql/9.5/main/pg_hba.conf
echo "host all all 127.0.0.1/32 password" >> /etc/postgresql/9.5/main/pg_hba.conf
echo "host all all 192.168.1.0/24 password" >> /etc/postgresql/9.5/main/pg_hba.conf
echo "host all all 192.168.55.0/24 password" >> /etc/postgresql/9.5/main/pg_hba.conf
su - postgres << EOF
psql -c "
alter user postgres with password 'postgres';
"
EOF
echo "postgres:postgres" | chpasswd
systemctl restart postgresql.service
# install phppgadmin
apt-get -y install php7.0 libapache2-mod-php7.0 apache2 phppgadmin
sed -i -e "s#Require local#Require ip 192.168.55.0/24#" /etc/apache2/conf-available/phppgadmin.conf
sed -i -e "s/extra_login_security.*true;/extra_login_security\\'\\] = false;/" /usr/share/phppgadmin/conf/config.inc.php
systemctl restart apache2
ln -s /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-available/phppgadmin.conf
sudo ln -s /usr/share/phppgadmin/ /var/www/html/
echo 'access http://192.168.55.105/phpmyadmin/'
echo 'user: postgres, password: postgres'
SHELL
end
○関連情報
・Dockerでphppgadminがインストールされたイメージを作成する
・phpMyAdminに関する他の情報はこちらを参照してください。
・プロジェクトwebサイト
https://www.phpmyadmin.net/
0 件のコメント:
コメントを投稿