以下のVagantfileを使用して、PaperworkとMySQLがインストールされた仮想マシンを構築できます。
仮想マシン構築後、http://192.168.55.108/にアクセスして、初期設定を行います。
初期設定の際、データベースとしてMySQL、データベース・ユーザ・パスワードとしてpaperwork、ポートに3306を指定します。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604paperwork"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604paperwork"
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
# 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 paperwork DEFAULT CHARACTER SET utf8;"
mysql -uroot -proot -e "CREATE USER paperwork@localhost IDENTIFIED BY 'paperwork';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON paperwork.* TO 'paperwork'@'localhost';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON paperwork.* TO 'paperwork'@'%';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"
apt-get -y install php7.0-gd php7.0-json php7.0-mysql php7.0-pdo php7.0-curl php7.0-mbstring php7.0-mcrypt php7.0-fpm php7.0-cli php7.0-xml
apt-get -y install npm zip nodejs nodejs-legacy nginx
# install composer & paperwork
apt-get -y install curl git
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
cd /var/www/html/
git clone https://github.com/twostairs/paperwork.git
cd ./paperwork/frontend/
composer install
php artisan migrate
chown www-data:www-data -R /var/www/html/
cat << EOF > /etc/nginx/sites-available/default
server {
listen 80;
# listen 443 ssl;
root /var/www/html/paperwork/frontend/public;
index index.php index.html index.htm;
server_name ub1604paperwork;
# server_name example.com;
# ssl_certificate /etc/nginx/ssl/server.crt;
# ssl_certificate_key /etc/nginx/ssl/server.key;
location / {
try_files \\$uri \\$uri/ /index.php;
}
error_page 404 /404.html;
# pass the PHP scripts to FastCGI server listening on the php-fpm socket
location ~ \\.php\\$ {
try_files \\$uri =404;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \\$document_root\\$fastcgi_script_name;
include fastcgi_params;
}
}
EOF
npm install jshint
npm install -g gulp bower
npm install
bower install --allow-root
gulp
service nginx restart
service php7.0-fpm restart
echo 'access http://192.168.55.108/'
SHELL
end
〇Paperwork初期設定画面1
〇Paperwork初期設定画面2
〇Paperwork初期設定画面3
〇Paperwork初期設定画面4
〇Paperwork初期設定画面5
〇Paperwork初期設定画面6
〇Paperworkの画面
0 件のコメント:
コメントを投稿