Make Tailbone the default website, etc.

This commit is contained in:
Lance Edgar 2015-11-15 23:02:06 -06:00
parent cf06a1987d
commit 424abb3b36
4 changed files with 37 additions and 73 deletions

View file

@ -1,49 +0,0 @@
# -*- mode: apache -*-
<VirtualHost *:80>
ServerName pod.localhost
DocumentRoot /srv/pod/
<Directory /srv/pod/>
Options +Indexes
Require all granted
</Directory>
# Forbid directory browsing of POD images; there are just too many.
<DirectoryMatch "^/srv/pod/pictures/gtin/gtin-\d{3}">
Options -Indexes
</DirectoryMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName pod.localhost
DocumentRoot /srv/pod/
<Directory /srv/pod>
Options +Indexes
Require all granted
</Directory>
# Forbid directory browsing of POD images; there are just too many.
<DirectoryMatch "^/srv/pod/pictures/gtin/gtin-\d{3}">
Options -Indexes
</DirectoryMatch>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>

View file

@ -28,7 +28,7 @@ default.to = root@localhost
default.subject = [Rattail] Automated email default.subject = [Rattail] Automated email
[rattail.pod] [rattail.pod]
pictures.gtin.root_url = http://pod.localhost/pictures/gtin pictures.gtin.root_url = http://localhost:9080/pod/pictures/gtin
pictures.gtin.root_path = /srv/pod/pictures/gtin pictures.gtin.root_path = /srv/pod/pictures/gtin

View file

@ -11,6 +11,18 @@ WSGIDaemonProcess rattail user=rattail group=rattail
Require all granted Require all granted
</Directory> </Directory>
# POD
Alias /pod/ /srv/pod/
<Directory /srv/pod/>
Options +Indexes
Require all granted
</Directory>
# Forbid directory browsing of POD images; there are just too many.
<DirectoryMatch "^/srv/pod/pictures/gtin/gtin-\d{3}">
Options -Indexes
</DirectoryMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
@ -25,6 +37,18 @@ WSGIDaemonProcess rattail user=rattail group=rattail
Require all granted Require all granted
</Directory> </Directory>
# POD
Alias /pod/ /srv/pod/
<Directory /srv/pod/>
Options +Indexes
Require all granted
</Directory>
# Forbid directory browsing of POD images; there are just too many.
<DirectoryMatch "^/srv/pod/pictures/gtin/gtin-\d{3}">
Options -Indexes
</DirectoryMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

View file

@ -17,7 +17,7 @@ from rattail.fablib import make_deploy, mkdir, make_system_user, cdvirtualenv, w
from rattail.fablib import apt, pod, postgresql, python from rattail.fablib import apt, pod, postgresql, python
__all__ = ['bootstrap_all', 'bootstrap_system', 'bootstrap_rattail', 'bootstrap_pod'] __all__ = ['bootstrap_all', 'bootstrap_system', 'bootstrap_rattail']
# Set the 'live' role to the canonical hostname for this server. # Set the 'live' role to the canonical hostname for this server.
#env.roledefs = {'live': ['host.example.com']} #env.roledefs = {'live': ['host.example.com']}
@ -29,6 +29,10 @@ try:
except ImportError as error: except ImportError as error:
warn("Couldn't import fabenv: {0}".format(error)) warn("Couldn't import fabenv: {0}".format(error))
# Set some default env attrs in case fabenv isn't prepped.
if not hasattr(env, 'password_postgresql_rattail'):
setattr(env, 'password_postgresql_rattail', 'password')
@task @task
def bootstrap_all(): def bootstrap_all():
@ -37,7 +41,6 @@ def bootstrap_all():
""" """
bootstrap_system() bootstrap_system()
bootstrap_rattail() bootstrap_rattail()
bootstrap_pod()
@task @task
@ -65,7 +68,7 @@ def bootstrap_system():
sudo('service apache2 restart') sudo('service apache2 restart')
# misc # misc
apt.install('git', 'emacs-nox') apt.install('git', 'emacs-nox', 'emacs-goodies-el')
@task @task
@ -114,23 +117,7 @@ def bootstrap_rattail():
sudo('bin/alembic --config=app/rattail.conf upgrade heads', user='rattail') sudo('bin/alembic --config=app/rattail.conf upgrade heads', user='rattail')
sudo('bin/rattail --config app/rattail.conf initdb --with-admin', user='rattail') sudo('bin/rattail --config app/rattail.conf initdb --with-admin', user='rattail')
# website # POD
with cdvirtualenv('rattail', 'app'):
mkdir('sessions', owner='rattail:rattail')
deploy('rattail/web.conf', 'web.conf')
deploy('rattail/rattail.wsgi', 'rattail.wsgi')
append('/etc/hosts', '127.0.0.1 rattail.localhost', use_sudo=True)
deploy('rattail/rattail.localhost.conf', '/etc/apache2/sites-available/rattail.localhost.conf')
sudo('a2ensite rattail.localhost')
sudo('service apache2 restart')
@task
def bootstrap_pod():
"""
Bootstrap the POD images website.
"""
# images
mkdir('/srv/pod') mkdir('/srv/pod')
if getattr(env, 'rattail_download_pod', False): if getattr(env, 'rattail_download_pod', False):
pod.install_pod() pod.install_pod()
@ -138,7 +125,9 @@ def bootstrap_pod():
puts("Skipping POD download, per 'fabenv' settings.") puts("Skipping POD download, per 'fabenv' settings.")
# website # website
append('/etc/hosts', '127.0.0.1 pod.localhost', use_sudo=True) with cdvirtualenv('rattail', 'app'):
deploy('pod/pod.localhost.conf', '/etc/apache2/sites-available/pod.localhost.conf') mkdir('sessions', owner='rattail:rattail')
sudo('a2ensite pod.localhost') deploy('rattail/web.conf', 'web.conf')
deploy('rattail/rattail.wsgi', 'rattail.wsgi')
deploy('rattail/rattail.localhost.conf', '/etc/apache2/sites-available/000-default.conf')
sudo('service apache2 restart') sudo('service apache2 restart')