我在 Ubuntu VPS 0.0.0.0:8000 上运行了一个 Django Gunicorn 服务器,虽然它存在一些问题,但它似乎正在接受本地主机连接。我的 sites-enabled 配置文件中有以下内容:
<VirtualHost *:80>
ServerName pragmatometer.com
ServerAlias www.pragmatometer.com analyticalnoticeboard.com www.analyticalnoticeboard.com logisticmvc.com www.logisticmvc.com
ServerAdmin [email protected]
DocumentRoot /home/jonathan/classicorthodoxbible.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/author.cjshayward.error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
</VirtualHost>
当我尝试连接到http://logisticmvc.com/,我收到一个 Apache(不是 Gunicorn)500 错误页面,但是 /var/log/apache2/error.log 中没有记录任何新内容。
ProxyPass 和 ProxyPassReverse 是否合适,或者它们是否会导致问题?我希望 .conf 文件中列出的域能够提供在 8000 上的 Gunicorn 服务器上运行的内容。
答案1
[Tue Jan 14 16:38:37.054643 2014] [proxy:warn] [pid 12715] [client 98.253.179.182:58922] AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
[Tue Jan 14 16:38:38.991741 2014] [proxy:warn] [pid 12619] [client 98.253.179.182:58923] AH01144: No protocol handler was valid for the URL /favicon.ico. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
搜索错误消息后,结果显示https://stackoverflow.com/questions/17475587/setup-mod-proxy-on-apache-http-server,启用 proxy_http.load 后,我就可以进行普通的 Django 调试了。