0

I am installing web2py with Apache2 httpd server on CentOS 6, and with https. I installed httpd server, enabled mod_wsgi, mod_ssl, and configured the ssl certs/keys. After I restarted the httpd service, I can see the WSGIDaemonProcess running, all applications directories under web2py granted with read/write permissions to web2py group which is the user and group I chose to run the WSGI process. However, I tried the admin app, the welcome app, both gave me 403 permission denied Apache error page (instead of web2py error page).

The following is the segment of httpd config file for the VirtualHost:

NameVirtualHost *:443
WSGIDaemonProcess web2py user=web2py group=web2py display-name=%{GROUP}

<VirtualHost *:443>
  ServerName myserver_ipaddress
  ServerAlias myserver_hostname
  WSGIProcessGroup web2py
  WSGIScriptAlias / /home/web2py/web2py/wsgihandler.py

  <Directory /home/web2py/web2py>
    AllowOverride None
    Order Allow,Deny
    Deny from all
    ExpiresDefault "access plus 1 month"
    <Files wsgihandler.py>
      Allow from all
    </Files>
  </Directory>

  AliasMatch ^/([^/]+)/static/(.*) \
       /home/web2py/web2py/applications/$1/static/$2
  <Directory /home/web2py/web2py/applications/*/static/>
    Order Allow,Deny
    Allow from all
  </Directory>

  <Location /admin>
    Allow from all
  </Location>

  ScriptAlias /cgi/ "/home/web2py/web2py/cgi-bin/"
  <Directory "/home/web2py/web2py/cgi-bin/">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
  </Directory>

  <LocationMatch ^/([^/]+)/appadmin>
  Allow from all
  </LocationMatch>

  CustomLog /home/web2py/var/log/apache2/access.log common
  ErrorLog /home/web2py/var/log/apache2/error.log
</VirtualHost>

Does anybody have an idea where I did wrong? or the problem may be somewhere else?

Thanks in advance.

4

1 回答 1

0

最后,问题解决了。不过这有点愚蠢。httpd 进程由用户 apache 运行,站点根目录为 /home/web2py/web2py,由用户 web2py(web2py 组)拥有。用户 apache 属于 web2py 组,但是,默认情况下 /home/web2py 目录不可按组写入或执行。

chmod 775 /home/web2py

解决了这个问题。

于 2013-04-24T03:55:08.533 回答