• 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

Resolved Symlink problem results in 403 forbidden

gunas108

New Pleskian
Hi
I have a problem with a symlink not working after we switched to a new Ubuntu server with plesk onyx.
After migration from the old server the symlink that was working on the old server needed to be setup again.
So i followed the many descriptions on the web. But i can't get it working.

We have a subdomain reseller.domain.com that symlinks back to our main Magento installation on domain.com

So path to main magento install is: /var/www/vhosts/domain.com/httpdocs

httpdocs Symlink is placed here: /var/www/vhosts/domain.com/reseller.domain.com

I placed the following code into the apache config to enable symlinks:
<IfModule mod_fcgid.c>
<Files ~ (\.fcgi$)>
SetHandler fcgid-script
Options +FollowSymLinks +ExecCGI
</Files>
</IfModule>

<Directory /var/www/vhosts/domain.com/reseller.domain.com>
Options +ExecCGI +FollowSymlinks -SymLinksIfOwnerMatch
</Directory>

I think all of this is still correct.
But when it comes down to the user:group configuration of the symlink and directories connected to the process i fail and with that my symlink is not working. I have tried several combination ranging from: www-data, to psaserv, and psacln ....
Can please somebody point me in the right direction.
Plattform is latest Ubuntu with Plesk Onyx.

Thanks in advance for any contribution.
 
I suggest to remove the symbolic link construction completely and add the subdomain as an "alias" to the main domain instead. Because then you don't need the special workaround by symbolic links.

If you want to keep the symbolic link, maybe the "secure symbolic links" option is set. Replace all occurences of "+FollowSymlinks" with "+SymLinksIfOwnerMatch" to avoid any issues with this and remove the "-SymLinksIfOwnerMatch". The later does not seem to make any sense anyway, because both are in the same subscription, if I understood your post correctly.
 
Dear Peter
Thanks for your reply. The funny thing is that i had the symlink option already working on the new server but had to do the migration of the server once more after this test session. This of course broke the then working symlink again and now I can't get it fully together anymore how i have done it the first time. I know it had to do with the access rights to the directories.

I also tried to just alias the subdomain but for some reason that I have not yet investigated further Magento then redirects to the main domain again.

I also tried setting the root path of the subdomain to the main domain. It works but only for HTML files PHP is not working and therefor the store not running.

I will look into your other suggestions but also would appreciate any further input from somebody who knows more about the user:group an permissions in and outs of symlinking.

Cheers Gunnar
 
Hi Peter
i finally got your suggestion with using an alias working. I had to tweak the magento installation a bit so it recognizes the appropriate multistore correctly.
The problem now is that its not possible in Plesk to implement an SSL certificate for an alias. This of course can be solved with an wildcard SSL certificate.

I also found another suggestion of yours here: https://talk.plesk.com/threads/domain-alias-and-ssl-not-working.340835/
So i tried that. The problem is now that Plesk gives me the following Error when trying to setup the subdomain in the Add Domain function of Plesk choosing the location of the main domain: There are no available resources of this type (sites) left. Requested: 1; available: 0.
I have plesk onyx web admin edition and not all of the available 10 domains are used. Do you happen to have any insights how this issue can be resolved?
Thanks for your help
Gunnar
 
Yes, that's right. Simply update the extension and you can easily create certificates for aliases, too.
 
Great. Thanks for letting me know.
It all works now like a charm.
Thanks everybody for helping me along. Truly a great community here.
All the best.
 
Back
Top