?
Solved

softlinks didn't work when browsing the DocumentRoot directory on Apache

Posted on 2011-02-15
7
Medium Priority
?
280 Views
Last Modified: 2012-05-11
Hello Experts,

I am using Redhat linux RHEL 5.3 OS with Apache running on it, in httpd.conf the DocumentRoot is /var/www/html, i created directory called 'pub' under the DocumentRoot i.e. /var/www/html/pub.
Any soft-links( to another directory)  created under /var/www/html/pub is not listed when access via browser. How can i access the soft links directories from web browser client.
0
Comment
Question by:sudhirgoogle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 4

Expert Comment

by:DangerousJeff
ID: 34895564
In your configuration you'll need to set up a <directory> section and specify an option to allow following symlinks.
Similar could be done with .htaccess file.

Something like

<Directory /var/www/html/pub>
    Options Indexes FollowSymLinks
</Directory>

Open in new window


http://httpd.apache.org/docs/2.0/mod/core.html#directory
http://httpd.apache.org/docs/2.0/mod/core.html#options
0
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 34895740
I added above entries in httpd.conf file, and restarted httpd service,  but no luck.

will hard-link and soft-link both will work ??

which one i should use ?? hard-link or soft-link ??

i created using ' ln -s' command, is that correct or do i need to use 'ln -d  ' Please suggest.
0
 
LVL 4

Expert Comment

by:DangerousJeff
ID: 34895901
Hmm, soft link should be fine
Try this (some may already exist):
<Directory "/var/www/html">
options Indexes Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>

<Directory "/var/www/html/pub">
options +FollowSymLinks
</Directory>

Open in new window


If still not working after a restart, please post full configuration file, check your apache error log file
May be a permission issue with the directories you are trying to access not being accessible by the "apache" user, assuming that is who its running as
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 1

Author Comment

by:sudhirgoogle
ID: 34904418
I tried as per your suggestion but still not working. i am here attaching the httpd conf file.
httpd.conf.txt
0
 
LVL 4

Expert Comment

by:DangerousJeff
ID: 34905078
you did check your apache error logs yes?
try making a test directory you are symlinking to be owned by apache
obviously remember that apache is case sensitive

I assume the issue is these links aren't showing up the index? Does anything show up?
0
 
LVL 1

Accepted Solution

by:
sudhirgoogle earned 0 total points
ID: 35144961
I resolved the problem. It was issue with selinux, i used restorecon command to set the selinux context for the softlink directory and it worked like a charm.
0
 
LVL 1

Author Closing Comment

by:sudhirgoogle
ID: 37452977
I found solution myself. Thank for your reponses.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question