Python apache服务器正在运行,但django站点未加载(使用wsgi)
我正在使用运行apache2服务器的AWSEC2 ubuntu 18.04实例,使用wsgi加载我的django站点。 我已经设法让apache服务器运行,但当我尝试使用浏览器上的ip打开页面时,is说无法加载该站点。服务器正在侦听端口80。我正在使用virtualenv运行django项目。DaemonProcess用于将venv作为python home运行Python apache服务器正在运行,但django站点未加载(使用wsgi),python,django,apache,wsgi,Python,Django,Apache,Wsgi,我正在使用运行apache2服务器的AWSEC2 ubuntu 18.04实例,使用wsgi加载我的django站点。 我已经设法让apache服务器运行,但当我尝试使用浏览器上的ip打开页面时,is说无法加载该站点。服务器正在侦听端口80。我正在使用virtualenv运行django项目。DaemonProcess用于将venv作为python home运行 /etc/apache2/sites available/django.conf文件: <VirtualHost *:80>
/etc/apache2/sites available/django.conf
文件:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
LogLevel error
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /project/src/static
<Directory /project/src/static>
Require all granted
</Directory>
Alias /media /project/src/media
<Directory /project/src/media>
Require all granted
</Directory>
<Directory /project/src/project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /project/src/project/wsgi.py
WSGIDaemonProcess shout_app python-path=/project/src python-home=/project/venv
WSGIProcessGroup shout_app
</VirtualHost>
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
application = get_wsgi_application()
wsgi.py
文件:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
LogLevel error
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /project/src/static
<Directory /project/src/static>
Require all granted
</Directory>
Alias /media /project/src/media
<Directory /project/src/media>
Require all granted
</Directory>
<Directory /project/src/project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIScriptAlias / /project/src/project/wsgi.py
WSGIDaemonProcess shout_app python-path=/project/src python-home=/project/venv
WSGIProcessGroup shout_app
</VirtualHost>
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
application = get_wsgi_application()
有人能提出解决办法吗?我应该在哪里具体查找问题?如果你自己解决了问题,你能回答这个问题吗?如果你自己解决了问题,你能回答这个问题吗。