diff options
-rw-r--r-- | apache2/sites-available/django.secure-example.com | 27 | ||||
-rw-r--r-- | apache2/sites-available/issues.secure-example.com | 26 | ||||
-rw-r--r-- | uwsgi/apps-available/local-django-app.ini | 29 | ||||
-rw-r--r-- | uwsgi/apps-available/local-rt4.ini | 16 |
4 files changed, 98 insertions, 0 deletions
diff --git a/apache2/sites-available/django.secure-example.com b/apache2/sites-available/django.secure-example.com new file mode 100644 index 0000000..5424420 --- /dev/null +++ b/apache2/sites-available/django.secure-example.com @@ -0,0 +1,27 @@ +<VirtualHost *:443> + ServerName django.example.com + ServerAdmin webmaster@example.com + DocumentRoot /var/www/nowhere + + Include conf.d/local-ssl.conf + + <Location /> + SetHandler uwsgi-handler + uWSGISocket /run/uwsgi/app/local-django-app/socket + uWSGImaxVars 512 + </Location> + + ErrorLog ${APACHE_LOG_DIR}/django.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/django.example.com-access.log combined +</VirtualHost> +<VirtualHost *:80> + ServerName django.example.com + ServerAlias *.django.example.com + + Include conf.d/local-log-origin.conf + + RedirectMatch permanent .* https://django.example.com/ + + ErrorLog ${APACHE_LOG_DIR}/django.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/django.example.com-access.log origin +</VirtualHost> diff --git a/apache2/sites-available/issues.secure-example.com b/apache2/sites-available/issues.secure-example.com new file mode 100644 index 0000000..1ba61f0 --- /dev/null +++ b/apache2/sites-available/issues.secure-example.com @@ -0,0 +1,26 @@ +<VirtualHost *:443> + ServerName issues.example.com + ServerAdmin webmaster@example.com + DocumentRoot /var/www/nowhere + + Include conf.d/local-ssl.conf + + <Location /> + SetHandler uwsgi-handler + uWSGISocket /run/uwsgi/app/local-rt4/socket + </Location> + + ErrorLog ${APACHE_LOG_DIR}/issues.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/issues.example.com-access.log combined +</VirtualHost> +<VirtualHost *:80> + ServerName issues.example.com + ServerAlias *.issues.example.com + + Include conf.d/local-log-origin.conf + + RedirectMatch permanent .* https://issues.example.com/ + + ErrorLog ${APACHE_LOG_DIR}/issues.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/issues.example.com-access.log origin +</VirtualHost> diff --git a/uwsgi/apps-available/local-django-app.ini b/uwsgi/apps-available/local-django-app.ini new file mode 100644 index 0000000..9779aee --- /dev/null +++ b/uwsgi/apps-available/local-django-app.ini @@ -0,0 +1,29 @@ +[uwsgi] +single-interpreter = True +plugins = python + +uid = www-django-app +#gid = www-data +#umask = 007 +#chdir = /home/www-django-app/foo +#module = django.core.handlers.wsgi:WSGIHandler() +#module = myapp.wsgi:application +wsgi-file = /home/www-django-app/foo/myapp.wsgi +master = True +workers = 8 +cheaper = 4 +threads = 2 + +#static-map = /media/=/home/www-sjango-app/foo/static/media/ +#static-map = /robots.txt=/home/www-django-app/foo/static/robots.txt +#static-map = /favicon.ico=/home/www-django-app/foo/static/favicon.ico + +#memory-report = True + +# set workers/threads, enable memory-report for a little while, consult +# logfile for sensible threshold for reload-on-rss, and only then enable +#reload-on-rss = 40 + +# merge identical memory pages after every 5th request +# more info at <http://uwsgi-docs.readthedocs.org/en/latest/KSM.html> +ksm = 5 diff --git a/uwsgi/apps-available/local-rt4.ini b/uwsgi/apps-available/local-rt4.ini new file mode 100644 index 0000000..5d2460e --- /dev/null +++ b/uwsgi/apps-available/local-rt4.ini @@ -0,0 +1,16 @@ +[uwsgi] +single-interpreter = True +plugins = 0:psgi + +workers = 2 + +psgi = /usr/share/request-tracker4/libexec/rt-server +static-map = /rt/NoAuth/images/=/usr/share/request-tracker4/html/NoAuth/images/ + +#chdir = /usr/share/request-tracker4/html + +env = export RT_SITE_CONFIG=/etc/request-tracker4/RT_SiteConfig.pm + +# merge identical memory pages after every 10th request +# more info at <http://uwsgi-docs.readthedocs.org/en/latest/KSM.html> +ksm = 10 |