Skip to content

Commit

Permalink
Adding even more configuration/setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
dlareau committed Apr 3, 2018
1 parent 9631c25 commit 9eb7c9d
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 4 deletions.
7 changes: 5 additions & 2 deletions config/easy_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# Setup script. Debian (and variant) specific
# Meant for dead simple setup on debian based systems.

# Should only be run on a new, clean installation, it will ruin other apache configurations.

# You should probably change the MYSQL_ROOT_PASSWORD variable...

# Variables
Expand Down Expand Up @@ -75,7 +78,7 @@ try pip install -r requirements.txt
try python manage.py migrate
try python manage.py collectstatic --noinput
try git checkout development # Only needed until test branch is merged
#try python manage.py loaddata initial_hunt.json
try python manage.py loaddata config/initial_hunt.json
try deactivate

# We are root until this point, pass off ownership of all we have created
Expand All @@ -88,5 +91,5 @@ try a2enmod proxy_html
try a2enmod xsendfile
try a2enmod wsgi
rm /etc/apache2/sites-enabled/*
try cp config/puzzlehunt.conf /etc/apache2/sites-enabled/
try cp config/puzzlehunt_easy.conf /etc/apache2/sites-enabled/
try service apache2 restart
File renamed without changes.
37 changes: 37 additions & 0 deletions config/puzzlehunt_easy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generic apache configuration file meant to be paired with easy_setup.sh
# Does not do shibboleth or ssl

NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

<Directory /home/puzzlehunt/puzzlehunt_server/puzzlehunt_server>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

Alias /static /home/puzzlehunt/puzzlehunt_server/static
<Directory /home/puzzlehunt/puzzlehunt_server/static>
Require all granted
</Directory>

Alias /media /home/puzzlehunt/puzzlehunt_server/media
XSendFile On
XSendFilePath /home/puzzlehunt/puzzlehunt_server/media
<Directory /home/puzzlehunt/puzzlehunt_server/media>
Require all granted
</Directory>
<Directory /home/puzzlehunt/puzzlehunt_server/media/puzzles>
Require all denied
</Directory>

ProxyPass /static/ !
ProxyPass /media/ !

WSGIDaemonProcess puzzlehunt_server python-path=/home/puzzlehunt/puzzlehunt_server:/home/puzzlehunt/puzzlehunt_server/venv/lib/python2.7/site-packages
WSGIProcessGroup puzzlehunt_server
WSGIScriptAlias / /home/puzzlehunt/puzzlehunt_server/puzzlehunt_server/wsgi.py

</VirtualHost>
4 changes: 2 additions & 2 deletions config/puzzlehunt_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ EOF
python manage.py migrate
python manage.py collectstatic --noinput
git checkout development # Only needed until test branch is merged
python manage.py loaddata /vagrant/initial_hunt.json
python manage.py loaddata config/initial_hunt.json

# We are root until this point, pass off ownership of all we have created
chown -R vagrant .
Expand All @@ -78,5 +78,5 @@ a2enmod proxy_http
a2enmod proxy_html
a2enmod xsendfile
a2enmod wsgi
cp /vagrant/puzzlehunt.conf /etc/apache2/sites-enabled/
cp config/puzzlehunt_vagrant.conf /etc/apache2/sites-enabled/
service apache2 restart
37 changes: 37 additions & 0 deletions config/puzzlehunt_vagrant.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# An apache configuration file meant to be paired with puzzlehunt_setup.sh
# Meant for quick vagrant base developement. Does not do shibboleth or ssl.

NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

<Directory /home/vagrant/puzzlehunt_server/puzzlehunt_server>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

Alias /static /home/vagrant/puzzlehunt_server/static
<Directory /home/vagrant/puzzlehunt_server/static>
Require all granted
</Directory>

Alias /media /home/vagrant/puzzlehunt_server/media
XSendFile On
XSendFilePath /home/vagrant/puzzlehunt_server/media
<Directory /home/vagrant/puzzlehunt_server/media>
Require all granted
</Directory>
<Directory /home/vagrant/puzzlehunt_server/media/puzzles>
Require all denied
</Directory>

ProxyPass /static/ !
ProxyPass /media/ !

WSGIDaemonProcess puzzlehunt_server python-path=/home/vagrant/puzzlehunt_server:/home/vagrant/puzzlehunt_server/venv/lib/python2.7/site-packages
WSGIProcessGroup puzzlehunt_server
WSGIScriptAlias / /home/vagrant/puzzlehunt_server/puzzlehunt_server/wsgi.py

</VirtualHost>

0 comments on commit 9eb7c9d

Please sign in to comment.