我正在为家里设置一个服务器来运行各种事情。我会为你保存整个故事,但我试图让它通过 WSGI 运行 Web2Py,但还需要为我拥有的其他 Web 应用程序提供 PHP 文件。我尝试了 Web2Py 的安装脚本,但它“劫持”了整个 Apache 系统来运行 Web2Py 系统。
该设置目前适用于 PHP 和 SSL 页面,但我无法让它也处理 Web2Py 站点的请求。对于 Web2Py url ( http://jupiter/web2py
),我得到一个 Apache 目录列表。请帮忙。
目录结构是这样的:
- /var/www --> Apache DocumentRoot
- /var/www/scripts --> 各种 PHP 脚本
- /var/www/web2py --> Web2Py
/etc/apache2/sites-available/default 文件设置如下:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin me@yahoo.com
ServerName jupiter.myhome.com
WSGIDaemonProcess web2py user=www-data group=www-data display-name=%{GROUP}
WSGIProcessGroup web2py
WSGIScriptAlias /web2py /var/www/web2py/wsgihandler.py
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow, deny
allow from all
</Directory>
<Directory /var/www/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>
AliasMatch ^/([^/]+)/static/(.*) /var/www/web2py/applications/$1/static/$2
<Directory /var/www/web2py/applications/*/static/>
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}/error.log
#comment
#comment
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined