LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-10-2009, 07:39 AM   #1
bobnw
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Rep: Reputation: 0
Smile Apache 2.2 - can not access virtual host document root


Is the correct forum for this question. I am not an expert and have not found an answer after several hours of looking on Google. I also checked the Similar Threads listing.

I want to set up localhost subdomains in an Apache/2.2.11 (Fedora) Server. Here are the changes I made to httpd.conf:
#
NameVirtualHost *:80
#
..
<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /home/bobn/test
ServerName test.localhost
<Directory "/home/bobn/test">
Options All
AllowOverride All
Allow from All
</Directory>
ErrorLog logs/test_error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

I added a test page, boo.html, to home/bobn/test. When I enter test.localhost.boo.html into Firefox I get:
Forbidden
You don't have permission to access /test/index.php on this server.

The httpd error_log shows no error but test_error_log lists the following:
[Wed Jun 10 04:27:59 2009] [error] [client 127.0.0.1] (13)Permission denied: access to /boo.html denied


The permissions for boo.html are
-rwxrwx--- 1 bobn apache 391 2009-06-09 18:37 boo.html

I have disabled SELinux until I can solve this problem.

Removing the <Directory> element from <VirtualHost *:80> produces the same result.

What should I try next?.

Thanks in Advance,
Bob N
 
Old 06-10-2009, 08:01 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Try
Code:
chmod -R 755 /home/bobn/test
 
Old 06-10-2009, 09:05 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site1/web">
        Order allow,deny
        Allow from all
    </Directory>
That did the trick when I had the problem.
 
Old 06-11-2009, 06:29 AM   #4
bobnw
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Try
Code:
chmod -R 755 /home/bobn/test
I changed the permissions for ../test and ../test/boo.html to 777. It looks like the problem is not permissions.
 
Old 06-11-2009, 06:38 AM   #5
bobnw
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Wim Sturkenboom View Post
Code:
#WimS
# this is required to prevent message 403 "Forbidden"
    <Directory "/home/wim/www/site1/web">
        Order allow,deny
        Allow from all
    </Directory>
That did the trick when I had the problem.
Thanks for your suggestion.

I changed the VirtualHost element to the following
<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /home/bobn/projects/test
ServerName test.localhost
<Directory "/home/bobn/projects/test">
Order allow,deny
Allow from All
</Directory>
ErrorLog logs/test_error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>


I still get the same access denied error message in test_error-Log

Thanks,
Bob N
 
Old 06-11-2009, 06:41 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I would assume that on Fedora, using a doc root in /home that it's SELinux related.

Can you try (as root) "setenforce 0", try again and report back.
 
Old 06-11-2009, 09:39 AM   #7
bobnw
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by billymayday View Post
I would assume that on Fedora, using a doc root in /home that it's SELinux related.

Can you try (as root) "setenforce 0", try again and report back.
The command returned "SELinux is disabled". A page reload returns the same error message in httpd/logs/test_error_log...access denied.

I expect there is some change in Apache 2.2.11 that requires a new setting in httpd.conf. Looks like a dead end to me. I have no clue how to look for a thing like that. I am going to try a 127.0.0.2 based virtual host and see if that works.

Thanks,
Bob N
 
Old 06-11-2009, 03:45 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
[edit - forget this comment]

Last edited by billymayday; 06-11-2009 at 03:47 PM.
 
Old 06-11-2009, 06:16 PM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by bobnw
I changed the permissions for ../test and ../test/boo.html to 777. It looks like the problem is not permissions.
You're also going to want to check permissions on each parent directory in the path.

For example, is /home/bobn world readable/executable?
 
  


Reply



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
Access files outside the document root for Apache vwvr9 Linux - Server 3 07-28-2008 05:28 PM
Apache 403 access denied outside of document root freedo5 Linux - Software 2 09-21-2005 08:06 PM
Apache, virtual host, access problem ivanatora Linux - Software 2 04-05-2005 04:39 AM
RH9 Apache Virtual Host Default Document jswilson Linux - Newbie 2 01-29-2004 09:27 AM
Apache doesn't allow non-document-root access in default setup jenna_h Mandriva 1 10-28-2003 07:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:38 PM.

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
Open Source Consulting | Domain Registration