以下のVagrantfileを使用して、SilverStripeとMariaDBがインストールされた仮想マシン(Ubuntu16.04)を構築する事ができます。
仮想マシン構築後、ブラウザからhttp://192.168.1.106/silverstripe/にアクセスして初期設定を行います。
データベース名、データベースユーザ名、パスワードはsilverstripeです。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604silverstripemariadb"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604silverstripemariadb"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.107", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.107", :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 mariadb
echo "mariadb-server-10.0 mysql-server/root_password password root" | sudo debconf-set-selections
echo "mariadb-server-10.0 mysql-server/root_password_again password root" | sudo debconf-set-selections
apt-get -y install mariadb-server
mysql -uroot -proot -e "CREATE DATABASE silverstripe DEFAULT CHARACTER SET utf8;"
mysql -uroot -proot -e "CREATE USER silverstripe@localhost IDENTIFIED BY 'silverstripe';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON silverstripe.* TO 'silverstripe'@'localhost';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"
apt-get -y install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get -y install apache2 libapache2-mod-php7.1
apt-get -y install php7.1-gd php7.1-json php7.1-mysql php7.1-pdo php7.1-curl php7.1-mbstring
apt-get -y install php7.1-mcrypt php7.1-xml php7.1-zip php7.1-intl
# install silverstripe
mkdir -p /opt/silverstripe
cd /opt/silverstripe
wget https://silverstripe-ssorg-releases.s3.amazonaws.com/sssites-ssorg-prod/assets/releases/SilverStripe-cms-v4.0.1.tar.gz
tar xvfz SilverStripe-cms-v4.0.1.tar.gz
sed -i -e 's#;date.timezone =#date.timezone = "Asia/Tokyo"#' /etc/php/7.1/apache2/php.ini
chown -R www-data:www-data /opt/silverstripe
ln -s /opt/silverstripe /var/www/html
cat << EOF >> /etc/apache2/apache2.conf
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
EOF
a2enmod rewrite
service apache2 restart
echo 'access http://192.168.1.107/silverstripe/'
echo 'db user:silverstripe password:silverstripe db:silverstripe'
SHELL
end
〇SilverStripeの初期設定画面1
〇SilverStripeの初期設定画面2
〇SilverStripeの管理者画面
〇SilverStripeの画面
0 件のコメント:
コメントを投稿