cd /u1 rails rails cd Documentroot ln -s /u1/rails/public rails
Now when I direct my browser to http://server.org/rails I get an Internal Server Error message and the apache log file says:
/www/main/rails/.htaccess: AddHandler not allowed hereNow I know that my apache has previously been happy to accept AddHandler within a .htaccess file, so there is something funny about passing through a symbolic link. It is not true (as some say) that AddHandler is disallowed in .htaccess. Notice that the .htaccess itself is being processed.
This is solved by putting the following lines into my /etc/httpd/conf.d/rails.conf file:
<Directory /www/main/rails> AllowOverride All Options +FollowSymLinks +ExecCGI AddHandler cgi-script .cgi </Directory>Some of these are indeed redundant with what is to be found in the .htaccess file (when we get there), but ultimately I would like to move the entire contents of .htaccess here and do away with them altogether.
It really is worthwhile to spend some time reading the online Apache manual. Note that the <Directory> directive applies to paths in the filesystem, whereas the <Location> directive applies to paths within the webspace (URLs).
Remember that the symbolic link is transparent to apache. Apache just sees the initial path and applies the Directory directive to it, there is no need to specify the path targeted by the link.
Ruby on Rails notes / tom@mmto.org