mod_wsgi picking up wrong settings

閲覧: 10 回
最初の未読メッセージにスキップ

Brad Rice

未読、
2019/05/14 17:08:452019/05/14
To: Django users
I have multiple websites setup on a linode cloud. I am using Virtual Host containers with WSGI paths and Virtual Envs for each app. When I set any of the apps to Debug = False, they throw 500 errors.

It appears they are using the same wsgi environment settings because the error is ALLOWED_HOSTS and it tells me it can't use the ALLOWED_HOSTS listed in the other app, not the one I'm trying to run. It appears the the wsgi running in deamon mode is bleeding into each other. Any idea what I need to do to get it to work? If I set Debug = True, everything works fine. I'm not to savy when it comes to wsgi and apache. I just want to build sites.

Here are the vhosts:

<VirtualHost *:80>
ServerAdmin brad...@gmail.com
ServerName dianarice.art
ServerAlias www.dianarice.art

<Directory /var/www/webapps/dianarice>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

RewriteEngine on
RewriteCond %{SERVER_NAME} =dianarice.art [OR]
RewriteCond %{SERVER_NAME} =www.dianarice.art
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
ServerAdmin brad...@gmail.com
ServerName dianarice.art
ServerAlias www.dianarice.art

<Directory /var/www/webapps/dianarice>
<Files wsgi.py>
Require all granted
</Files>

WSGIScriptAlias / /var/www/webapps/dianarice/dianarice/wsgi.py
WSGIDaemonProcess dianarice.art python-home=/usr/local/venvs/dianarice-env python-path=/var/www/webapps/dianarice
WSGIProcessGroup dianarice.art

Alias /robots.txt /var/www/html/static.dianarice.art/public_html/robots.txt
Alias /favicon.ico /var/www/html/static.dianarice.art/public_html/favicon.ico
Alias /images /var/www/html/dianarice.art/public_html/images
Alias /static /var/www/html/dianarice.art/public_html/static

LogLevel warn
ErrorLog /var/www/webapps/dianarice/log/error.log
CustomLog /var/www/webapps/dianarice/log/access.log combined
</Directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/dianarice.art-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/dianarice.art-0001/privkey.pem
</VirtualHost>


<VirtualHost *:80>
ServerAdmin brad...@gmail.com
ServerName medinadiversityproject.org
ServerAlias www.medinadiversityproject.org

<Directory /var/www/webapps/medinadiversityproject>
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.medinadiversityproject.org [OR]
RewriteCond %{SERVER_NAME} =medinadiversityproject.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin brad...@gmail.com
ServerName medinadiversityproject.org
ServerAlias www.medinadiversityproject.org

<Directory /var/www/webapps/medinadiversityproject>
Require all granted
WSGIScriptAlias / /var/www/webapps/medinadiversityproject/medinadiversityproject/wsgi.py
WSGIDaemonProcess medinadiversityproject.org python-home=/usr/local/venvs/medinadiversityproject-env python-path=/var/www/webapps/medinadiversityproject
WSGIProcessGroup medinadiversityproject.org
# Log file locations
LogLevel info
ErrorLog /var/www/webapps/medinadiversityproject/log/error.log
CustomLog /var/www/webapps/medinadiversityproject/log/access.log combined
</Directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/www.medinadiversityproject.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.medinadiversityproject.org/privkey.pem
</VirtualHost>

<VirtualHost *:80>
ServerAdmin brad...@gmail.com
ServerName oh-joy.org
ServerAlias www.oh-joy.org

<Directory /var/www/webapps/ohjoy>
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =oh-joy.org [OR]
RewriteCond %{SERVER_NAME} =www.oh-joy.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
ServerAdmin brad...@gmail.com
ServerName oh-joy.org
ServerAlias www.oh-joy.org

<Directory /var/www/webapps/ohjoy>
Require all granted

WSGIProcessGroup ohjoy
WSGIScriptAlias / /var/www/webapps/ohjoy/ohjoy/wsgi.py process-group=ohjoy
WSGIDaemonProcess ohjoy python-home=/usr/local/venvs/ohjoy-env python-path=/var/www/webapps/ohjoy
# Log file locations
LogLevel info
ErrorLog /var/www/webapps/ohjoy/log/error.log
CustomLog /var/www/webapps/ohjoy/log/access.log combined

</Directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/oh-joy.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/oh-joy.org/privkey.pem
</VirtualHost>
全員に返信
投稿者に返信
転送
新着メール 0 件