cPanel follow symbolic link

I need a refresher. It's been years since I had a sub domain access a directory via a symbolic link.

Currently I get a 403 forbidden error.

Note: It's a dedicated server and I have root...

Here is the setup:

domain.com/admin
subdomain.domain.com

There is a directory called files under domain.com that I created a symbolic link under subdomain.domain.com

I can access it through SSH just fine but having trouble getting it through the browser. I am trying to avoid having to use rsync to copy the files to the multiple sub domains. Once I get it working on one then I can get it working on the 2nd, etc.

Server is WHM/cPanel
LVL 7
Robert SaylorSenior DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RedLondonCommented:
Not sure what cPanel sets permissions as, but if you create domain.com/admin2 as the domain.com account's user (via FTP or cPanel's FIle Manager), compare the permissions and ownership of the /admin and the /admin2 folder.
0
Robert SaylorSenior DeveloperAuthor Commented:
I resolved this.

At the file system I ran the following command:
chown -h user.group symlink

Note: doing a chown user.group does not work on symlinks. You have to pass the -h parameter.

In .htaccess I added
Options +SymLinksIfOwnerMatch

I found the answer here:
http://superuser.com/questions/68685/chown-is-not-changing-symbolic-link


And now the file works on the subdomain. This saved me having to do a lot of un-needed deplication of images and un-needed process of sync those files to the sub domain.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robert SaylorSenior DeveloperAuthor Commented:
I am including  RedLondon as part of the solution as it was a permission issue.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.