LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack Search this Thread
Old 08-15-2007, 11:07 AM   #1
BostonMark
LQ Newbie
 
Registered: Aug 2007
Posts: 6

Rep: Reputation: 0
Exclamation Virtual Hosts located in home dirs


Hi, I'm trying to set up some virtual hosts. I want my actual data to be inside the home dir of the user. From what I've been trying, I always get 403s. When I move the data outside the home, let's say /www/site it works. Here's what I think might work but won't:

Make /www/sitename/ a symlink to /home/user/sitename

Then set the Virtual Host to /www/sitename

That way the data lives at /home/user/sitename

This did not actually work. Any other ideas on how to get this to work where the data is inside of the home dirs? I absolutely need the data in the home dirs, as the RAID was made so the /home has a ton of space.

I also tried to make /home/user/site be owned by apache and the in group apache. That also didn't work. I even went as far as adding the user to the apache group; didn't work.

Any help is appreciated. I'm really willing to do anything as long as the actual data lives inside of the home dir of the user. I'm willing to change permissions and groups/owners of various dirs if necessary.

Thanks in advance.
 
Old 08-15-2007, 11:34 AM   #2
tdbabar
LQ Newbie
 
Registered: Jul 2007
Distribution: RedHat
Posts: 17

Rep: Reputation: 0
Why dont you try setting root directory as "/home/user/sitename", instead of symlink?
 
Old 08-15-2007, 11:58 AM   #3
BostonMark
LQ Newbie
 
Registered: Aug 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Like I said, I get a 403. Even when permissions are 777. I even make the owner and group apache.
 
Old 08-27-2007, 01:40 PM   #4
iuaui
Member
 
Registered: Sep 2005
Location: Nummela, Southern Finland
Distribution: Fedora Core 4, Fedora Core 5, Redhat 9.0, Solaris 10, WInXP pro, W2k pro
Posts: 30

Rep: Reputation: 15
Hi,

hope that you have solved this problem but as I mentioned in some other post
check permissions from "lower" level. What I mean is that permissions should be correct
from the beginning of path. If you have permission "problem" somewhere between /home and DocumentRoot, you really do not have permission to access that directory. This is not Apache problem but OS is denying your access.
 
Old 08-27-2007, 05:36 PM   #5
neuroman
LQ Newbie
 
Registered: Jan 2005
Posts: 18

Rep: Reputation: 0
Quote:
Originally Posted by BostonMark View Post
Hi, I'm trying to set up some virtual hosts. I want my actual data to be inside the home dir of the user. From what I've been trying, I always get 403s.
Same problem here with apache 2.2.4 under FC6. What makes this particularly frustrating is that I have this working on another machine with apache 2.0.54 under FC4. Prior to any customizations, the httpd.conf on both were nearly identical, and indeed the VirtualHost examples are identical. Here are the changes I made to httpd.conf:
Code:
# ServerAdmin root@localhost
ServerAdmin ted@localhost
 . . .
# DocumentRoot "/var/www/html"
DocumentRoot "/home/htdocs"
 . . .
# <Directory "/var/www/html">
<Directory "/home/htdocs">
 . . .
AddType application/x-httpd-php .php .phtml .html
 . . .
<VirtualHost drupal.development:80>
  ServerAdmin ted@localhost
  DocumentRoot "/home/htdocs/drupal_development"
  ServerName drupal.development
  ErrorLog logs/drupal_development-error_log
  CustomLog logs/drupal_development-access_log common

<Directory "/home/htdocs/drupal_development">
  AllowOverride All
  Order Deny,Allow
  Deny from All
  Allow from 127.0.0.1
</Directory>
</VirtualHost>
where drupal_development is a symbolic link to a path in my own home directory tree that contains the actual Drupal installation.

This works like a charm under FC4, but under FC6 it produces 403 Forbidden errors. On both machines, I am a member of the apache group. All relevant directory structures, permissions (775 for directories, 664 for ordinary files), and ownerships (me root for /home/htdocs, me me for everything below /home/htdocs) are the same across machines. Drupal runs fine under FC6 if I get rid of the VirtualHost stuff and just install it into a real directory called /home/htdocs/drupal_development, not a symbolic link to somewhere else.
 
Old 08-27-2007, 05:44 PM   #6
digen
Member
 
Registered: Dec 2005
Location: India
Distribution: Ubuntu Feisty Fawn
Posts: 107

Rep: Reputation: 15
Your authorization by IP address configuration in the Directory section would be the culprit is permissions/ownership are already set right.

Quote:
<Directory "/home/htdocs/drupal_development">
AllowOverride All
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
</Directory>
Isn't this explicitly only allowing access to the loopback interface ? Comment the Directory container and restart Apache.
 
Old 08-27-2007, 08:31 PM   #7
neuroman
LQ Newbie
 
Registered: Jan 2005
Posts: 18

Rep: Reputation: 0
Quote:
Comment the Directory container and restart Apache.
An interesting suggestion, and worthy of trying even if I did steal the Directory container from people who seem to know what they're doing--specifically this article
Using open source software to design, develop, and deploy a collaborative Web site, Part 4: Building your development environment in Linux
http://www.ibm.com/developerworks/ed...AGX46&S_CMP=LP
But it does nothing under FC6.
Under FC4 http://localhost/ gives me the Drupal-managed site as before.
Quote:
Isn't this explicitly only allowing access to the loopback interface ?
I'll have to test it from a different machine. With the Directory container intact, the implementation under FC4 actually worked--served pages nicely to clients at remote sites. Whether
commenting it out interferes with its performance is something yet to be discovered.

Last edited by neuroman; 08-27-2007 at 08:47 PM.
 
Old 08-27-2007, 10:21 PM   #8
moenterprise
Member
 
Registered: Mar 2007
Distribution: Fedora Core 6
Posts: 94

Rep: Reputation: 15
Did you configure SELinux to enable access to home directories from Apache?
 
Old 08-28-2007, 09:37 AM   #9
neuroman
LQ Newbie
 
Registered: Jan 2005
Posts: 18

Rep: Reputation: 0
Quote:
Originally Posted by moenterprise View Post
Did you configure SELinux to enable access to home directories from Apache?
Good question. I should have mentioned that SELinux is not enabled on either machine. Long ago I got tired of playing "mother may I" on these development machines, which always sit behind a hardware firewall, and only occasionally have httpd running.
 
  


Reply

Tags
apache, fc6, virtualhost


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
Trying to set up /home/user based virtual hosts in Apache 2 Asymmetry Linux - Server 0 01-04-2007 12:38 PM
how to get apache to look in users' home dirs? realthor Linux - Software 5 03-15-2006 10:08 AM
Backing Up Home Dirs before upgrade Thin Mandriva 6 02-01-2005 11:44 PM
give users access to home dirs jonas73 Linux - Newbie 2 03-16-2004 01:42 AM


All times are GMT -5. The time now is 11:31 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration