02.12.09

Changing DocumentRoot in Apache: files, directories and permissions

Posted in Web authoring, linux at 6:48 pm by karl

While setting up a WSGI-hosted django app on Fedora 10, I could not get apache to serve any files that weren’t stored under /var/www/. I tried

  • changing the DocumentRoot
  • using the Alias Directive
  • using symbolic links from /var/www to the required location
  • chmod -R go=rx path/to/my/files
  • chown -R apache path/to/my/files
  • Changing the User and Group apache runs under

All to no avail. By symlinking to my directory I could get apache to list directory contents, but trying to access any files within gave a 403 forbidden error. It turns out the problem was to do with SELinux - by default the security policy is set to ‘enforcing’. I changed the policy to ‘permissive’ and all was well.

It took me an embarrassingly long time to figure this one out - I thought it was caused by a combination of apache configuration and filesystem permissions, but it turned out the security policy had a role to play too.

08.28.08

pymssql - connecting to sql server using python on *NIX

Posted in python, linux at 4:05 pm by karl

08.18.08

Installing mod_python on 64-bit redhat ES 4

Posted in Web authoring, python, linux at 10:29 am by karl