○PyroCMSの画面
○構築方法
1.以下のVagrantfileを使用して、PyroCMSとMySQLをインストールした仮想マシン(Debian Stretch/9.4)を構築します。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.4"
config.vm.hostname = "db94pyrocms"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db94pyrocms"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.108", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.108", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
apt-get -y install task-japanese
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install mysql
wget https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb
export DEBIAN_FRONTEND=noninteractive
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
dpkg -i mysql-apt-config_0.8.9-1_all.deb
apt-get update
apt-get -y install mysql-server
mysql -uroot -e "CREATE DATABASE pyrocms DEFAULT CHARACTER SET utf8mb4;"
mysql -uroot -e "CREATE USER pyrocms@localhost IDENTIFIED BY 'pyrocms';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON pyrocms.* TO 'pyrocms'@'localhost';"
mysql -uroot -e "FLUSH PRIVILEGES;"
# install apache2 and php
apt-get -y install ca-certificates apt-transport-https
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
apt-get update
apt-get -y install apache2 php7.1 libapache2-mod-php7.1 php7.1-mbstring php7.1-pdo php7.1-mysqlnd php7.1-mcrypt php7.1-gd php7.1-curl php7.1-common php7.1-dom git curl php7.1-sqlite zip php7.1-zip php7.1-intl
# install composer
curl -s https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
# install pyrocms
cd /opt
composer create-project pyrocms/pyrocms
cd /opt/pyrocms
composer install
cat << EOF > /opt/pyrocms/.env
APP_ENV=local
APP_DEBUG=true
APP_KEY=
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=pyrocms
DB_USERNAME=pyrocms
DB_PASSWORD=pyrocms
APPLICATION_NAME=Default
APPLICATION_REFERENCE=default
APPLICATION_DOMAIN=localdomain
ADMIN_EMAIL=admin@localhost.localdomain
ADMIN_USERNAME=admin
ADMIN_PASSWORD=password
LOCALE=en
TIMEZONE=UTC
APP_DEBUG=true
EOF
php artisan key:generate --force
chown -R www-data:www-data /opt/pyrocms
cat << EOF > /etc/apache2/sites-available/pyrocms.conf
<VirtualHost *:80>
ServerName 192.168.1.108
DocumentRoot /opt/pyrocms/public
<Directory /opt/pyrocms/public>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
a2enmod rewrite
a2ensite pyrocms.conf
a2dissite 000-default.conf
systemctl restart apache2.service
echo 'access to http://192.168.1.108/installer'
SHELL
end
2.ブラウザからhttp://192.168.55.108/installerにアクセスして初期設定を行います。
管理者のパスワードやロケールを選択します。
0 件のコメント:
コメントを投稿