I have just set up an Apache 2.2 server on a new Linux Mint installation. I am recreating a previous set up I had on an old Ubuntu machine.
On my previous computer, I had to enable FollowSymLinks
in httpd.conf
, because I store my web site HTML files in my home directory, and link to them from a symbolic link in /var/www
.
On my new server, I can't find any httpd.conf
anywhere, so I can't seem to set the option to follow symlinks. As a result, I'm getting a 403 Forbidden: You don't have permission to access / on this server
error.
Also, in my error log, it says:
[Sun May 05 02:12:17 2013] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/Websites
Has something changed in how one allows symlinks? Or am I wrong about the setting being in httpd.conf
? In any case, how do I get my new Apache to follow symlinks?
Update: Based on an answer below, I checked in the files /etc/apache2/sites-enabled/000-default
and /etc/apache2/sites-available/default
, and they both have the FollowSymLinks
option. Is there some other reason I might be getting the error mentioned above?
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>
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>
FollowSymLinks
seems to be enabled. But I am getting aSymbolic link not allowed or link target not accessible
error in my Apache logs (I have updated my question). Is there possibly another reason I am getting this error? – Questioner May 04 '13 at 17:18www-data
?), to test you can also link to something like anxyz
directory under/tmp
withrwxrwxrwx
permissions. If that is not it I would then try to remove theAllowOverride None
line and make the+FollowSymLinks
for/var/www/
. – Anthon May 04 '13 at 17:32sudo chmod +x
on the directories in my/home
folder that contain my HTML files. Seems to be working now. – Questioner May 04 '13 at 17:54sudo chown -h www-data:www-data <symink>
. For Fedora,sudo chown -h apache:apache <symink>
. Omit any slash (/) after the symlinks otherwise the ownership change will not take effect (a noob mistake I made). – Meraj al Maksud Dec 09 '23 at 13:08