• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Symlinks resulting in 403 Error

Q

qxxx

Guest
Hello!

i would like to acces files from subdomains also on the main domain,
example:

http://download.example.com/file.zip
want to acces from here:
http://www.example.com/download/file.zip

i created a symlink like that:
ln -s /home/httpd/vhosts/example.com/subdomains/download/httpdocs download
(in folder: /home/httpd/vhosts/example.com/httpdocs)

the symlink is created.
now if i acces a file like that:
http://www.example.com/download/file.zip
apache shows: a 403 error (forbidden)
The Apache Logs showing "Symlinks are not allowed here"

i chmoded all 777, chown wwwrun.www, restarted the apache,
what can i do more?

Thanks in Advance, Q
 
You need to edit plesk's virtual host overrides file in that domain's /conf/ directory, the file is called: vhost.conf.

In this file you need to put:

Code:
<Directory <full/path/to/the/domains/httpdocs>
    Options FollowSymLinks
</Directory>

Then you need to restart the apache server:

(If its a redhat box): # service httpd restart

This should solve the problem, as the default plesk apache installation does not tend to allow you to follow symlinks automatically.

I just recently had todo this my self actually.

Hope this helps!

If you need further assistance, feel free to contact me on here, or direclty, thanks.
 
sorry, doesnt work, still 403.
i have everywhere a vhost.conf file:

in domain.com\subdomains\blabla\conf
and
domain.com\conf

all something like this inside:
PHP:
<Directory "/home/httpd/vhosts/domain.com">
Options -Indexes +FollowSymLinks +Includes
DirectoryIndex index.php
php_admin_value open_basedir /home/httpd/vhosts/domain.com/httpdocs/
php_admin_flag safe_mode Off
php_admin_value memory_limit 60M
</Directory>

:(
 
He's apparently right, I don't see this working either... time to keep digging for an answer.
 
Sorry, spoke too soon, didn't check my permissions of the symlink. After chown'ing them it is working dandily. Thanks!
 
Back
Top