From 3ffd68027c79d77f2e2c779302a667ed4fa2ac36 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Sat, 22 Dec 2018 14:49:29 -0500 Subject: [PATCH] Remove APP_SUBDIR token from python-path in templates The extra subdirectory caused problems, at least for Django The expected layout is now: docroot - app_subdir - wsgi.py It ispossible for app_subdir to be empty in cases where it is not needed. --- .../alternc/templates/apache2/wsgi-both.conf | 8 ++-- .../alternc/templates/apache2/wsgi-http.conf | 4 +- .../alternc/templates/apache2/wsgi-https.conf | 4 +- src/etc/alternc/templates/apache2/wsgi.conf | 42 +++++++++++++++++++ 4 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 src/etc/alternc/templates/apache2/wsgi.conf diff --git a/src/etc/alternc/templates/apache2/wsgi-both.conf b/src/etc/alternc/templates/apache2/wsgi-both.conf index 4bf829d..fb6bbb3 100644 --- a/src/etc/alternc/templates/apache2/wsgi-both.conf +++ b/src/etc/alternc/templates/apache2/wsgi-both.conf @@ -10,12 +10,12 @@ %%CHAINLINE%% - WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/%%APP_SUBDIR%%/ socket-user=#%%UID%% + WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/ socket-user=#%%UID%% WSGIProcessGroup %%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% - + AllowOverride All @@ -35,12 +35,12 @@ SetEnv LOGIN "%%UID%%-%%LOGIN%%" - WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/%%APP_SUBDIR%%/ socket-user=#%%UID%% + WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/ socket-user=#%%UID%% WSGIProcessGroup %%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% - + AllowOverride All diff --git a/src/etc/alternc/templates/apache2/wsgi-http.conf b/src/etc/alternc/templates/apache2/wsgi-http.conf index 35dff3a..7eba0b1 100644 --- a/src/etc/alternc/templates/apache2/wsgi-http.conf +++ b/src/etc/alternc/templates/apache2/wsgi-http.conf @@ -22,12 +22,12 @@ AssignUserId #%%UID%% #%%GID%% SetEnv LOGIN "%%UID%%-%%LOGIN%%" - WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/%%APP_SUBDIR%%/ socket-user=#%%UID%% + WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/ socket-user=#%%UID%% WSGIProcessGroup %%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% - + AllowOverride All diff --git a/src/etc/alternc/templates/apache2/wsgi-https.conf b/src/etc/alternc/templates/apache2/wsgi-https.conf index 4b63fb0..f7f7cc5 100644 --- a/src/etc/alternc/templates/apache2/wsgi-https.conf +++ b/src/etc/alternc/templates/apache2/wsgi-https.conf @@ -10,12 +10,12 @@ %%CHAINLINE%% - WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/%%APP_SUBDIR%%/ socket-user=#%%UID%% + WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/ socket-user=#%%UID%% WSGIProcessGroup %%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% - + AllowOverride All diff --git a/src/etc/alternc/templates/apache2/wsgi.conf b/src/etc/alternc/templates/apache2/wsgi.conf new file mode 100644 index 0000000..7eba0b1 --- /dev/null +++ b/src/etc/alternc/templates/apache2/wsgi.conf @@ -0,0 +1,42 @@ + + ServerName %%fqdn%% + AssignUserId #%%UID%% #%%GID%% + SetEnv LOGIN "%%UID%%-%%LOGIN%%" + + SSLEngine On + SSLCertificateFile %%CRT%% + SSLCertificateKeyFile %%KEY%% + %%CHAINLINE%% + + KeepAlive Off + + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !/cgi-bin/ + RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/ + RewriteRule ^/(.*)$ http://%%fqdn%%/$1 [R=301,L] + + + + ServerName %%fqdn%% + DocumentRoot %%document_root%% + AssignUserId #%%UID%% #%%GID%% + SetEnv LOGIN "%%UID%%-%%LOGIN%%" + + WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/ socket-user=#%%UID%% + WSGIProcessGroup %%fqdn%% + WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% + + + + AllowOverride All + + + Order allow,deny + Allow from all + + = 2.4> + Require all granted + + + +