mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-24 08:46:24 -07:00
Fix issue with nginx starting before the vagrant shared directory is mounted
This commit is contained in:
parent
f945d6357c
commit
a04e90e59f
4 changed files with 21 additions and 21 deletions
|
@ -3,8 +3,9 @@
|
|||
# Change as necessary (duh).
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name localhost;
|
||||
client_max_body_size 5M;
|
||||
|
||||
location / {
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
# this should go in /etc/nginx/sites-enabled. Change as necessary.
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
listen 80;
|
||||
listen[::]:80;
|
||||
server_name localhost;
|
||||
client_max_body_size 5M;
|
||||
|
||||
location / {
|
||||
|
|
20
vagrant/Vagrantfile
vendored
20
vagrant/Vagrantfile
vendored
|
@ -3,23 +3,15 @@
|
|||
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
# just in case Canonical desides to change the default SSH username on us again
|
||||
config.ssh.username = "vagrant"
|
||||
config.vm.box = "ubuntu/xenial64"
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
# `vagrant box outdated`. This is not recommended.
|
||||
# config.vm.box_check_update = false
|
||||
|
||||
|
||||
config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||
#config.vm.network "forwarded_port", guest: 80, host: 8080
|
||||
config.vm.network :private_network, ip: "172.27.0.3"
|
||||
config.vm.synced_folder "../", "/vagrant"
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.gui = false
|
||||
vb.cpus = "4"
|
||||
vb.memory = "4096"
|
||||
config.vm.provider "virtualbox" do |provider|
|
||||
provider.gui = false
|
||||
provider.cpus = "4"
|
||||
provider.memory = "4096"
|
||||
end
|
||||
config.vm.provision :shell, path: "bootstrap.sh"
|
||||
config.vm.provision :shell, path: "bootstrap.sh"
|
||||
end
|
||||
|
|
|
@ -38,16 +38,22 @@ cat - <<EOF123 >/etc/mysql/conf.d/open.cnf
|
|||
bind-address = 0.0.0.0
|
||||
EOF123
|
||||
|
||||
service mysql restart &
|
||||
wait
|
||||
rm -f /etc/nginx/sites-enabled/* /etc/nginx/sites-available/*
|
||||
ln -sf /vagrant/gochan-fastcgi.nginx /etc/nginx/sites-available/gochan.nginx
|
||||
ln -sf /etc/nginx/sites-available/gochan.nginx /etc/nginx/sites-enabled/
|
||||
|
||||
# VirtualBox shared folders don't play nicely with sendfile.
|
||||
sed -e 's/sendfile on;/sendfile off;/' -i /etc/nginx/nginx.conf
|
||||
service nginx restart
|
||||
|
||||
# Make sure our shared directories are mounted before nginx starts
|
||||
systemctl disable nginx
|
||||
sed -i 's/WantedBy=multi-user.target/WantedBy=vagrant.mount/' /lib/systemd/system/nginx.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable nginx
|
||||
|
||||
|
||||
systemctl restart nginx mysql &
|
||||
wait
|
||||
|
||||
mkdir -p /vagrant/lib || true
|
||||
cd /vagrant
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue