Commit 7aa7f6d2 authored by chris's avatar chris

deployment: prepare apache vhosts

parent 112db6e9
......@@ -3,7 +3,11 @@
*~
venv
media
static
fixture
local_settings.py
docs/_build
deployment/apache-vhost
deployment/apache-vhost-compat
.ropeproject
ext
<VirtualHost *:80>
Alias /robots.txt /path/to/mysite.com/static/robots.txt
Alias /favicon.ico /path/to/mysite.com/static/favicon.ico
Alias /media/ /path/to/mysite.com/media/
Alias /static/ /path/to/mysite.com/static/
<Directory /path/to/mysite.com/static>
Order deny,allow
Allow from all
</Directory>
<Directory /path/to/mysite.com/media>
Order deny,allow
Allow from all
</Directory>
# compat mode for very old wsgi with no python-home directive support
WSGIDaemonProcess example.com python-path=/path/to/mysite.com:/path/to/venv/lib/python2.7/site-packages
WSGIProcessGroup example.com
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py process-group=example.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
#Require all granted
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
<VirtualHost *:80>
Alias /robots.txt /path/to/mysite.com/static/robots.txt
Alias /favicon.ico /path/to/mysite.com/static/favicon.ico
Alias /media/ /path/to/mysite.com/media/
Alias /static/ /path/to/mysite.com/static/
<Directory /path/to/mysite.com/static>
Order deny,allow
Allow from all
</Directory>
<Directory /path/to/mysite.com/media>
Order deny,allow
Allow from all
</Directory>
WSGIDaemonProcess example.com python-home=/path/to/venv python-path=/path/to/mysite.com
WSGIProcessGroup example.com
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py process-group=example.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
#Require all granted
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
......@@ -16,3 +16,19 @@ test -d ext/wagtail-simple-gallery || (cd ext; git clone https://github.com/Teme
test -d ext/wagtail_simple_gallery || (cd ext; ln -s wagtail-simple-gallery/wagtail_simple_gallery .)
./venv/bin/python manage.py migrate --no-input
./venv/bin/python manage.py collectstatic --no-input
NAME="flyers.org-$RANDOM"
test -n "$1" && NAME=$1
cat deployment/apache-vhost.example |\
sed "s@/path/to/mysite.com@$PWD@" |\
sed "s@/path/to/venv@$PWD/venv@" |\
sed "s@/mysite@/flyers@" |\
sed "s@example.com@$NAME@" > deployment/apache-vhost
cat deployment/apache-vhost-compat.example |\
sed "s@/path/to/mysite.com@$PWD@" |\
sed "s@/path/to/venv@$PWD/venv@" |\
sed "s@/mysite@/flyers@" |\
sed "s@example.com@$NAME@" > deployment/apache-vhost-compat
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment