/usr/local not seen from www

They have: 4 posts

Joined: Jun 2004

Hey,

I'm new to redhat/linux/apache administration, and I think I'm having a rights issue. I install my apps in /usr/local, and symlink them to www. Half of them work, and half of them don't. Some have to access ping, others traceroute, etc.

My question is, when doing a symlink, what rules should I follow to get a page for example like /usr/local/dir which is symlinked to /var/www/html/dir to work? Sometimes I get a 403, other times it displays the HTML but doesn't give me the data(like a ping for example). At times when I get the HTML the error_log has entries like "/traceroute: No such file or directory" These are such simple scripts, that they have very little or no documentation. In this example, traceroute exists and can be accessed from telnet. Some of the pages/apps that don't work from www work from the command line on the server, so again I feel it's my greenhorn status that is not seeing the rights issues.

It seems as simple as configure, check user/group rights, chmod, and then symlink, right?

Thanks,

Z

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

As Bob said, make sure that you set the permissions not on the link but on the folder and files where the symlink points to. You should also make sure that the option FollowSymLinks is either enabled for the directory that the symlink is in or globally in your httpd.conf file.

If you are still having problems, try changing the directory from the symlinked one to the one that the files are in. If the problem goes away, then it is a followsymlinks problem. If it doesn't, then it is a permissions problem. Also check your logs for errors.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 4 posts

Joined: Jun 2004

Thanks guys. I feel like I'm playing with the obvious and going in circles.

Should it be as easy as -

cd /usr/local
mkdir whatever
move stuff into whatever
chmod -Rf 7?? whatever
cd /var/www/html
ln -s /usr/local/whatever whatever

and then simply make sure that the sym and the orginal locale are all the same user (for example root or apache) ??

If httpd is dialed to apache:apache, would this be the correct user?

Do I need to bother with directives in my Apache CONF file for directories in usr/local??

How would one configure Apache and/or Linux so users can visit www and access /whatever without me giving unnecessary rights and access to /usr/local(aren't user rights recursive?) ??

Thanks again,

Eric

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.