# Put this in comment line
#Alias /images /var/www/webroot/ROOT/images
#Alias /static /var/www/webroot/ROOT/static
#WSGIScriptAlias / ${WSGI_SCRIPT}
#WSGIProcessGroup apache
# Add those code line
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonHome /path/to/venv
WSGIPythonPath /path/to/mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
Alias /media/ /path/to/mysite.com/media/
Alias /static/ /path/to/mysite.com/static/
<Directory /path/to/mysite.com/static>
Order deny,allow
Allow from all
</Directory>
<Directory /path/to/mysite.com/media>
Order deny,allow
Allow from all
</Directory>
我们可以看到,站点是在本地主机(127.0.0.1)和端口8000上手动启动的。然后尝试从外部打开域(尽管应用程序仅在127.0.0.1 localhost上侦听,并且仅在端口8000上侦听)。显然,没有打开任何响应,因为Apache正在侦听端口80,该端口未配置为使用此应用程序(并且应用程序本身也无法从外部访问)。 为了让Apache+mod_wsgi能够成功地使用该应用程序,不需要像以前那样手动启动该应用程序,但需要编写一个类似于此处描述的https://jelastic.com/blog/django-cms-installation-python-cloud-hosting/(手动安装的第6点)的wsgi入口点
因此,我了解了如何修改apache服务器文件,将您自己的django web应用程序放在Jelastic解决方案上:
转到文件:/etc/httpd/conf.d/wsgi.conf
进行以下修改:
相关问题 更多 >
编程相关推荐