web2py + Apache on RHEL, Fedora, CentOS

I needed to install web2py on a RHEL machine. Before it was working fine on Ubuntu. But I already spotted that the Apache VirtualHost configuration is different on RHEL than on Ubuntu. web2py comes with Installation Scripts like scripts/setup-web2py-ubuntu.sh and scripts/setup-web2py-fedora.sh. But apparently the Fedora one is faulty. I even checked the latest one in the repository but it is still not fixed.

Problem:
The website and Admin interface loaded up, but without any css. In the Apache error_log I always got something like this:

client denied by server configuration: /var/www/web2py/applications/$1

After searching for some time I found the solution over here.

In your Apache VirtualHost configuration change this line

AliasMatch ^/([^/]+)/static/(.*) /var/www/web2py/applications/$1/static/$2

to

AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) /var/www/web2py/applications/$1/static/$2

Obviously twice, for HTTP and HTTPS. Now it works. Weird enough it should have been fixed already, at least the bug report was closed about a month ago.

Leave a Reply

Your email address will not be published. Required fields are marked *