Page 1 of 1

[RESOLVED] httpd (_apache-2.2_) Virtual Hosts pull Default Apache Document Root . . .

Posted: 2010/05/17 21:13:41
by atrumblood
Hello again.

Server Info:
Server OS: Centos 5.4 i386
Apache: Server version: Apache/2.2.3

I have apache installed, and the default DocumentRoot [/var/www/html] pulls up just fine.
Here is the problem.

The virtualhosts I have setup, are not pulling up their own Document Roots, but instead pull up the default of /var/www/html.

Here is the vhosts.conf file that I have included in the main httpd.conf file.

[code]
NameVirtualHost MY-IP:80

<VirtualHost MY-IP:80>
ServerName default
</VirtualHost>

##Set Virtual Host Directories Permissions
<Directory "/home/*/www">
Options Indexes MultiViews SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
Allow from all
</Directory>

## vaddhost: (sd-media.net) at MY-IP:80
<VirtualHost MY-IP:80>
ServerName sd-media.net
ServerAdmin webmaster@sd-media.net
DocumentRoot "/home/USER/www/sd-media.net"
ScriptAlias /cgi-bin/ "/home/USER/www/cgi-bin/"

<Directory "/home/USER/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/logs/httpd/USER/sd-media.net-error_log
</VirtualHost>
[/code]
Here are the permissions for each directory up to the Document Root on the Virtual Host sd-media.net

[code]
/home/USER

drwxr-x--x USER USER 4.0K May 17 13:29 USER
[/code]
[code]
/home/USER/www

drwxr-xr-x USER apache 4.0K May 16 20:02 www
[/code]
[code]
/home/USER/www/sd-media.net

drwxr-xr-x USER apache 4.0K May 16 19:41 sd-media.net
[/code]
For testing, I have placed in the /var/www/html default doc root of apache.

[code]
This is The default Apache Document Root
[/code]
And in the DocumentRoot for sd-media.net

[code]
This is The sd-media.net DocumentRoot.
[/code]
I ran /usr/sbin/httpd -t

I get back a Syntax OK.

So at this point, I am pretty stumped as to why this is behaving this way. Can anyone shed some light on this issue I am having.

Any help would be greatly appreciated.

Re: httpd (_apache-2.2_) Virtual Hosts pull..... not their own DocumentRoot

Posted: 2010/05/18 01:15:47
by chuina
[quote]atrumblood wrote:
................ [/quote]
I've never use wildcard in httpd.conf.

If SELinux is running then [url=http://wiki.centos.org/HowTos/SELinux#head-0f6390ddacfab39ee973ed8018a32212c2a02199]File Relabeling[/url] is required.

For testing place a [b]index.html[/b] with some text ,inside the document root directory with group ownership [b]apache[/b].

Re: httpd (_apache-2.2_) Virtual Hosts pull..... not their own DocumentRoot

Posted: 2010/05/18 01:19:44
by atrumblood
Ok, thanks.

For testing I actually disabled my selinux to see if that was causing a problem. but even with it disabled it doesn't work.
I did the /home/*/www/ because i plan on adding quite a few virtual hosts most of which will be under their own administrator id.

Plus I have another webserver I have configured with that exact setting with centos 5.4.



Once I get this working, then I will dive in to configuring selinux.

I changed the group on index.html in the document root to apache, but no dice.

So with selinux out of the picture, can you think of anything else that might cause this too happen?

Re: httpd (_apache-2.2_) Virtual Hosts pull..... not their own DocumentRoot

Posted: 2010/05/18 01:57:55
by atrumblood
I feel like a royal dumbass.

I was using my wan ip instead of my internal ip for my hosts in apache.

Sorry that I wasted every-ones time.

Re: httpd (_apache-2.2_) Virtual Hosts pull..... not their own DocumentRoot

Posted: 2010/05/18 02:44:56
by chuina
[quote]atrumblood wrote:
I feel like a royal dumbass.[/quote]
This is a proof we're human being.

[quote].......I was using my wan ip instead of my internal ip for my hosts in apache.
Sorry that I wasted every-ones time.[/quote]
It'll surely help newbies (like me)

Re: httpd (_apache-2.2_) Virtual Hosts pull..... not their own DocumentRoot

Posted: 2010/05/18 04:39:36
by atrumblood
[quote]
chuina wrote:
[quote]atrumblood wrote:
I feel like a royal dumbass.[/quote]
This is a proof we're human being.

[quote].......I was using my wan ip instead of my internal ip for my hosts in apache.
Sorry that I wasted every-ones time.[/quote]
It'll surely help newbies (like me)[/quote]

Well, I am glad that I was able to help someone today.
Most of the time I just break things. :lol:

[RESOLVED] httpd (_apache-2.2_) Virtual Hosts pull Default A

Posted: 2010/05/18 12:51:03
by AlanBartlett
Marking this thread as [RESOLVED], for posterity.