LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Httpd problem : symbolic links not followed (https://www.linuxquestions.org/questions/linux-server-73/httpd-problem-symbolic-links-not-followed-554849/)

chamu 05-18-2007 03:23 AM

Httpd problem : symbolic links not followed
 
hi i have been trying to configure web server httpd with cricket bandwidth monitor, have symbolic links to the cricket directory and have the following lines in my httpd.conf file


<Directory "/var/www/html">
Options Indexes +FollowSymLinks ExecCGI
</Directory>

but it still returns sym links not follwed in httpd error log,

digitalnerds 05-18-2007 03:30 AM

Are you running apache chrooted? .. it might be a problem with that if yes and you would need to make the sylinks relative not absolute.
To exemplify:

instead of
Code:

ln -s /path/to/file /path/for/symlink
try
Code:

cd /path/for
ln -s ../../to/file symlink


chamu 05-18-2007 05:39 AM

httpd sym links problem
 
the answer is yes and the links are already relative as per ur suggestion, could there be a global configuration which is blocking sym links?. which is not in httpd.conf?

digitalnerds 05-18-2007 06:42 AM

Where is the cricket directory located? .. is it under the /var/www/html ? It's ahrd to really help when you dont know the setup. Have you tried without +?

Edit: if your symlink target dir is outside the directory for which you enabled FollowSymLinks your apache will not be able to follow the symlink.
Be careful with the directory-path arguments: They have to literally match the filesystem path which Apache uses to access the files. Directives applied to a particular <Directory> will not apply to files accessed from that same directory via a different path, such as via different symbolic links.

Regards
Andy

chamu 05-18-2007 08:05 AM

httpd sym links problem
 
the cricket directory is in /home/cricket/cricket , the links from /var/www/html are to ths directory .i also have tried without the + to no avail i also have
added
<Directory /home/cricket/cricket>
Options FollowsymLinks ExecCGI
</Directory>
but no change again!

digitalnerds 05-18-2007 08:29 AM

I wasnt clear enough. You may add a new directive for /home/cricket/cricket it doesnt matter. Your /var/www/html will not be able to follow links outside /var/www/html. In your case apache will refuse to follow symlinks inside /var/www/html that leads to /home/cricket/cricket. I repeat myself "if your symlink target dir is outside the directory for which you enabled FollowSymLinks your apache will not be able to follow the symlink." So you do not need to add:
Code:

<Directory /home/cricket/cricket>
Options FollowsymLinks ExecCGI
</Directory>

because the most you will is to specify that all symlinks inside /home/cricket/cricket are to be followed within the boundaries of the PATH apache uses to access those files.

Regards
Andy

systemnotes 05-20-2007 08:19 PM

Quote:

Originally Posted by digitalnerds
I wasnt clear enough. You may add a new directive for /home/cricket/cricket it doesnt matter. Your /var/www/html will not be able to follow links outside /var/www/html. In your case apache will refuse to follow symlinks inside /var/www/html that leads to /home/cricket/cricket. I repeat myself "if your symlink target dir is outside the directory for which you enabled FollowSymLinks your apache will not be able to follow the symlink." So you do not need to add:
Code:

<Directory /home/cricket/cricket>
Options FollowsymLinks ExecCGI
</Directory>

because the most you will is to specify that all symlinks inside /home/cricket/cricket are to be followed within the boundaries of the PATH apache uses to access those files.

Regards
Andy

I don't know if you are running the 2.6 kernel with SELinux enabled, but here is something else to consider:

Don't forget to also check SELinux permissions on the directory with
ls -Z /home/cricket/cricket

http://systemnotesorg.blogspot.com/2...otes-http.html

You may have to run
chcon -R --reference /var/www/html /home/cricket/cricket
to allow the web server to read the files.

chamu 05-28-2007 08:59 AM

httpd sym links problem
 
there is anew twist to the saga, i have just made some adjustments, i had a link pointing to another link in the cricket directory
as in from /var/www/html/cricket to /home/cricket/cricket the second cricket directory is actually a link within the /home/cricket directory to the actual directory- cricket-1.0.5so i suppose thats where the problem was coming from, now i have removed this sym link and have a link from /var/www/html to /home/cricket/cricket-1.0.5 which is the actual cricket config directory,
the symlinks not allowed error in th logs is gone but now the problem is the cgi scripts like grapher.cgi in cricket-1.0.5 are not running
, from the browser u get a text file instead of a graph

i have got +ExecCGI in my httpd.conf


All times are GMT -5. The time now is 10:28 PM.