我尝试使用django设置我的应用,但遗憾的是我无法获得服务不可用的消息。
我使用的是vestacp
apache配置在没有vestacp的同一个ubuntu 14中工作但是使用vestacp我无法实现工作。
settings.py
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
it suppose to work using "*"
apache2.conf
<VirtualHost 172.31.2.45:80>
ServerName ip-172-31-2-45.us-west-1.compute.internal
ServerAlias www.ip-172-31-2-45.us-west-1.compute.internal
ServerAdmin info@ip-172-31-2-45.us-west-1.compute.internal
DocumentRoot /home/admin/web/ip-172-31-2-45.us-west-1.compute.internal/public_html
ScriptAlias /cgi-bin/ /home/admin/web/ip-172-31-2-45.us-west-1.compute.internal/cgi-bin/
Alias /vstats/ /home/admin/web/ip-172-31-2-45.us-west-1.compute.internal/stats/
Alias /error/ /home/admin/web/ip-172-31-2-45.us-west-1.compute.internal/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/ip-172-31-2-45.us-west-1.compute.internal.bytes bytes
CustomLog /var/log/apache2/domains/ip-172-31-2-45.us-west-1.compute.internal.log combined
ErrorLog /var/log/apache2/domains/ip-172-31-2-45.us-west-1.compute.internal.error.log
<Directory /home/admin/web/ip-172-31-2-45.us-west-1.compute.internal/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/admin/web/ip-172-31-2-45.us-west-1.compute.internal/public_html:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/ip-172-31-2-45.us-west-1.compute.internal/stats>
AllowOverride All
</Directory>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/apache2.ip-172-31-2-45.us-west-1.compute.internal.conf*
</VirtualHost>
<VirtualHost 172.31.2.45:80>
ServerName mensajeriadf.com
ServerAlias www.mensajeriadf.com
ServerAdmin info@mensajeriadf.com
DocumentRoot /home/admin/web/mensajeriadf.com/public_html
WSGIDaemonProcess sampleapp python-path=/var/www/sampleapp/sampleapp:/var/www/sampleapp/env/python2.7/site-packages
WSGIProcessGroup sampleapp
WSGIScriptAlias / /var/www/sampleapp/sampleapp/sampleapp/wsgi.py
ScriptAlias /cgi-bin/ /home/admin/web/mensajeriadf.com/cgi-bin/
Alias /vstats/ /home/admin/web/mensajeriadf.com/stats/
Alias /error/ /home/admin/web/mensajeriadf.com/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/mensajeriadf.com.bytes bytes
CustomLog /var/log/apache2/domains/mensajeriadf.com.log combined
ErrorLog /var/log/apache2/domains/mensajeriadf.com.error.log
<Directory /home/admin/web/mensajeriadf.com/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/admin/web/mensajeriadf.com/public_html:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/mensajeriadf.com/stats>
AllowOverride All
</Directory>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/apache2.mensajeriadf.com.conf*
</VirtualHost>
如果我将服务器作为runserver运行它运行正常,问题是apache我认为,我已经安装了wsgi mod并且启用了,我不知道我做得不好。
我真的很感激任何帮助。我有这个日子。 你有什么想法吗?