LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-02-2008, 10:36 PM   #1
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSUSE, Raspbian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,779

Rep: Reputation: 239Reputation: 239Reputation: 239
Using "public_html" as a symlink


I have several virtual hosts set up an Apache 2.2.3 server. A few of the virtual sites are running software that I used to (when using previous Apache 2.x releases) install in a directory named "package-v2.0.1", "package-v2.0.2", etc. I would then define a symlink pointing to the subdirectory holding the "production" version of the software once it had been tested. Redefining the symlink was a really easy means of reverting to an earlier version if any MFUs were found.

A quick-n-dirty picture of the directory structure is:
Code:
/var
  +--web
      +--httpd/public_html          (directory)
      +--vhosts
          +--vhost-1.com
          |    +--public_html       (directory)
          +--vhost-2.com
               +--package-v2.0.1    (directory)
               +--package-v2.0.2    (directory)
               +--public_html       (symlink to v2.0.2)
Well that doesn't seem to work any more under Apache 2.2.3. I only seem to be able to find/display the files associated with a virtual web server if "public_html" is an actual directory.

Pointing a browser at the main server server (in "/var/web/httpd/public_html") or "vhost-1.com" works fine.
But... when I try to go to "vhost-2.com", I'm getting the default "Hey the Apache installation works!" web page under the main server's directory. It doesn't even place any nastygrams in the vhost-2 access and/or error logs. I DO get the message
Code:
Symbolic link not allowed or link target not accessible:
 /var/web/vhosts/vhost-2/public_html
in the general error_log.

I've made changes to mod_userdir.conf and that hasn't panned out. (OK, that was a crap shoot, that one.) "apache2ctl -t" tells me that the syntax is OK. (Yah, great.)

Does anyone know which file I might be able to tweak to get Apache to recognize public_html as a symlink? (To get past that "Symbolic link not allowed" error.) Or is my old method of switching software versions via symlinks not allowed under the later Apache releases? (Security hole?)

TIA

--
rt
 
Old 01-02-2008, 11:09 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
I would be looking for a permissions problem. The real directories and the files in them have to be readable by Apache, which means that Apache has to have permission to read them.
 
Old 01-02-2008, 11:22 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Have you tried the "FollowSymLinks" option (it's OFF by default...)?
 
Old 01-04-2008, 09:15 AM   #4
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSUSE, Raspbian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,779

Original Poster
Rep: Reputation: 239Reputation: 239Reputation: 239
Quote:
Originally Posted by jiml8 View Post
I would be looking for a permissions problem. The real directories and the files in them have to be readable by Apache, which means that Apache has to have permission to read them.
I'm pretty sure that's not it. I did check that last night: the permissions on all the virtual hosts' "home" directories and the subdirectories -- either "public_html" or the target of a "public_html" symlink -- are all "755". They're all owned by the "web" group and the httpd user that runs the web server is a member of that group.

I'm not where I can check anything else right now but I'll double check tonight that there's not some read problem by "su"ing to httpd and verifying that I can read directories and files for the virtual web services.

Thanks...

--
rt
 
Old 01-04-2008, 09:54 AM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSUSE, Raspbian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,779

Original Poster
Rep: Reputation: 239Reputation: 239Reputation: 239
Quote:
Originally Posted by paulsm4 View Post
Have you tried the "FollowSymLinks" option (it's OFF by default...)?
I think you're right about it being some symlink-related option.

I seem to recall (not where I can get at the web server just now) that I had at one point put a Directory directive (for "/var/web/vhosts/vhost-2.com") in one of the files in the vhosts.d directory and didn't see anything change. I didn't include the FollowSymLinks option, though, but did use the SymLinksifOwnerMatch (sp?) option.

I'll get a chance to look deeper into this tonight.

Thanks...

--
rt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"failed to make symlink " error adoniskhandu Linux - Newbie 2 06-16-2007 01:27 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
Problems emerging " /etc/make.profile symlink?" Portage tree complete? stl222 Linux - Software 2 02-11-2006 10:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration