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.
This commit is contained in:
Kienan Stewart 2018-12-22 14:49:29 -05:00
parent f47a2ae0c4
commit 3ffd68027c
4 changed files with 50 additions and 8 deletions

View File

@ -10,12 +10,12 @@
%%CHAINLINE%% %%CHAINLINE%%
<IfModule mod_wsgi.c> <IfModule mod_wsgi.c>
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%% WSGIProcessGroup %%fqdn%%
WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%%
</IfModule> </IfModule>
<Directory "%%document_root%%/%%APP_SUBDIR%%"> <Directory "%%document_root%%/%%APP_SUBDIR%%/">
AllowOverride All AllowOverride All
<Files wsgi.py> <Files wsgi.py>
<IfVersion < 2.4> <IfVersion < 2.4>
@ -35,12 +35,12 @@
SetEnv LOGIN "%%UID%%-%%LOGIN%%" SetEnv LOGIN "%%UID%%-%%LOGIN%%"
<IfModule mod_wsgi.c> <IfModule mod_wsgi.c>
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%% WSGIProcessGroup %%fqdn%%
WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%%
</IfModule> </IfModule>
<Directory "%%document_root%%/%%APP_SUBDIR%%"> <Directory "%%document_root%%/%%APP_SUBDIR%%/">
AllowOverride All AllowOverride All
<Files wsgi.py> <Files wsgi.py>
<IfVersion < 2.4> <IfVersion < 2.4>

View File

@ -22,12 +22,12 @@
AssignUserId #%%UID%% #%%GID%% AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%" SetEnv LOGIN "%%UID%%-%%LOGIN%%"
<IfModule mod_wsgi.c> <IfModule mod_wsgi.c>
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%% WSGIProcessGroup %%fqdn%%
WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%%
</IfModule> </IfModule>
<Directory "%%document_root%%/%%APP_SUBDIR%%"> <Directory "%%document_root%%/%%APP_SUBDIR%%/">
AllowOverride All AllowOverride All
<Files wsgi.py> <Files wsgi.py>
<IfVersion < 2.4> <IfVersion < 2.4>

View File

@ -10,12 +10,12 @@
%%CHAINLINE%% %%CHAINLINE%%
<IfModule mod_wsgi.c> <IfModule mod_wsgi.c>
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%% WSGIProcessGroup %%fqdn%%
WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%% WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%%
</IfModule> </IfModule>
<Directory "%%document_root%%/%%APP_SUBDIR%%"> <Directory "%%document_root%%/%%APP_SUBDIR%%/">
AllowOverride All AllowOverride All
<Files wsgi.py> <Files wsgi.py>
<IfVersion < 2.4> <IfVersion < 2.4>

View File

@ -0,0 +1,42 @@
<Virtualhost *:443>
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]
</Virtualhost>
<VirtualHost *:80>
ServerName %%fqdn%%
DocumentRoot %%document_root%%
AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
<IfModule mod_wsgi.c>
WSGIDaemonProcess %%fqdn%% python-home=%%VENV%% python-path=%%document_root%%/ socket-user=#%%UID%%
WSGIProcessGroup %%fqdn%%
WSGIScriptAlias / %%document_root%%/%%APP_SUBDIR%%/wsgi.py process-group=%%fqdn%%
</IfModule>
<Directory "%%document_root%%/%%APP_SUBDIR%%/">
AllowOverride All
<Files wsgi.py>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Files>
</Directory>
</VirtualHost>