仮想マシン後を構築後、http://192.168.1.104/racktables/?module=installerにアクセスしてインストーラの指示に従って、初期設定を行います。
OSにはsshでユーザ名vagrant、パスワードvagrantを使用してログオンできます。また、DB名にracktables、DBユーザ名にracktables、DBパスワードにracktablesを指定します。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604racktables"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604racktables"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.104", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.104", :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 mysql
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 racktables DEFAULT CHARACTER SET utf8;"
mysql -uroot -proot -e "CREATE USER racktables@localhost IDENTIFIED BY 'racktables';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON racktables.* TO 'racktables'@'localhost' IDENTIFIED BY 'racktables';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON racktables.* TO 'racktables'@'%' IDENTIFIED BY 'racktables';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"
# install apache2
apt-get -y install apache2-bin libapache2-mod-php7.0 php7.0-gd php7.0-mysql php7.0-mbstring php7.0-bcmath php7.0-json php7.0-snmp
wget https://downloads.sourceforge.net/project/racktables/RackTables-0.20.14.tar.gz
tar xvfz RackTables-0.20.14.tar.gz
mv RackTables-0.20.14/wwwroot /opt/racktables
chown -R www-data:www-data /opt/racktables
ln -s /opt/racktables /var/www/html
service apache2 restart
echo 'access http://192.168.1.104/racktables/?module=installer';
echo 'OS user: vagrant OS password: vagrant'
echo 'DB user: racktables DB password:racktables DB:racktables'
SHELL
end
インストーラの画面
0 件のコメント:
コメントを投稿