仮想マシン構築後、ブラウザからhttp://192.168.55.103/cpg/にアクセスして、初期設定を行います。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604cpgmysql"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604cpgmysql"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.103", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.103", :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
echo "mysql-server-5.7 mysql-server/root_password password root" | sudo debconf-set-selections
echo "mysql-server-5.7 mysql-server/root_password_again password root" | sudo debconf-set-selections
apt-get -y install mysql-server-5.7
mysql -uroot -proot -e "CREATE DATABASE cpg DEFAULT CHARACTER SET utf8;"
mysql -uroot -proot -e "CREATE USER cpg@localhost IDENTIFIED BY 'cpg';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON cpg.* TO 'cpg'@'localhost';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON cpg.* TO 'cpg'@'%';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"
# install apache and php
apt-get -y install software-properties-common
add-apt-repository -y ppa:ondrej/php
apt-get update
apt-get -y install apache2 php5.6 libapache2-mod-php5.6 php5.6-gd php5.6-mbstring php5.6-xml php5.6-mysql imagemagick
# install Coppermine Photo Gallery
apt-get -y install unzip
wget https://sourceforge.net/projects/coppermine/files/Coppermine/1.5.x/cpg1.5.46.zip
unzip cpg1.5.46.zip
mv cpg15x /opt/cpg
chown -R www-data:www-data /opt/cpg
sudo ln -s /opt/cpg/ /var/www/html/
systemctl restart apache2
echo 'access http://192.168.55.103/cpg/'
SHELL
end
〇Coopermine Photo Galleryの初期設定画面1
〇Coopermine Photo Galleryの初期設定画面2
〇Coopermine Photo Galleryの初期設定画面3
〇Coopermine Photo Galleryの画面
0 件のコメント:
コメントを投稿