Symbolic Links Not Working


#1

I’m trying to create a symbolic link to a directory outside of my domain directory (I’m trying to use Zend Framework 2). I run the command:

Seems to work fine. When I look at it with ls -l mydomain.com/ it shows that it’s a link pointing to zfapp/myapp/public. However, when I list it with ls -l mydomain.com/myapp, nothing shows up as a file. (There are files in the target directory public). When I visit mydomain.com/myapp/ I get a forbidden. Am I doing something wrong here?

This is a shared hosting environment.


#2

#3

I tried changing the permissions as suggested on my public folder, I still get an error.

I opened my error log and this is what it contains:

[Fri Jan 18 03:29:14 2013] [error] [client 184.57.129.40] Symbolic link not allowed or link target not accessible: /home/myusername/mydomain.com/myapp [Fri Jan 18 03:29:14 2013] [error] [client 184.57.129.40] File does not exist: /home/myusername/mydomain.com/forbidden.html [Fri Jan 18 04:46:24 2013] [error] [client 24.172.242.50] Symbolic link not allowed or link target not accessible: /home/myusername/mydomain.com/myapp [Fri Jan 18 04:46:24 2013] [error] [client 24.172.242.50] File does not exist: /home/myusername/mydomain.com/forbidden.html [Fri Jan 18 04:47:01 2013] [error] [client 208.54.40.222] Symbolic link not allowed or link target not accessible: /home/myusername/mydomain.com/myapp [Fri Jan 18 04:47:01 2013] [error] [client 208.54.40.222] File does not exist: /home/myusername/mydomain.com/forbidden.html [Fri Jan 18 04:47:10 2013] [error] [client 208.54.40.222] Symbolic link not allowed or link target not accessible: /home/myusername/mydomain.com/myapp [Fri Jan 18 04:47:10 2013] [error] [client 208.54.40.222] File does not exist: /home/myusername/mydomain.com/forbidden.html [Fri Jan 18 05:29:38 2013] [error] [client 184.57.129.40] Symbolic link not allowed or link target not accessible: /home/myusername/mydomain.com/myapp [Fri Jan 18 05:29:38 2013] [error] [client 184.57.129.40] File does not exist: /home/myusername/mydomain.com/forbidden.html

I’ve also noticed that when browsing via ftp, the ftp will not follow the link so I’m thinking maybe I used the “ln” command incorrectly?


#4

$ unlink mydomain.com/myapp $ ln -s ~/zfapp/myapp/public ~/mydomain.com/myapp


#5

Thank you, that was it. I actually just found this post on a stack exchange website that showed me a similar solution.