LinuxQuestions.org
Review your favorite Linux distribution.
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 01-25-2006, 11:10 PM   #1
dana340
LQ Newbie
 
Registered: Nov 2005
Posts: 18

Rep: Reputation: 0
Question apache virtual hosts


Hello everyone.

i'm using FC4/LAMP. setup. apache 2.0.

we are using name based virtual hosts, and we ahve 2 doamins working well, we went to add 2 more to the server today, and we added records to the httpd.conf file.
we made sure that apache has read permissions on the folders that it points to. but...
When DNS resolves the site, it brings up our test page. not the index page for the site. It appears as if apache is pulling up /usr/local/apache2. I can open up the icons directory when I manually type in "http://www.sitename.com/icons/"

All this seems to point to a problem with the httpd.conf file. Apache still restarts fine with teh flawed file, assuming that is what's causing the problem.

Can I get anotehr set of eyes to verify that the syntax is correct. Anything else that might cause these types of errors??

Below is the section of teh httpd.conf in question. With this file, I changed the site names and the IP's. We have cheked for typos and case with those.

httpd.conf #########################################
NameVirtualHost 192.168.0.2
# Where do we put the lock and pif files?
LockFile "/var/lock/httpd.lock"
CoreDumpDirectory "/etc/httpd"
# Defaults for virtual hosts
# Logs
# Virtual hosts
#

# Virtual host site1.com
<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/site1.com
ServerName www.site1.com
ServerAlias site1.com
DirectoryIndex index.html index.php index.htm index.shtml
LogLevel debug
HostNameLookups off
</VirtualHost>
# Virtual host site1.com2
<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/site1.com
ServerName site1.com
DirectoryIndex index.html index.htm index.shtml
</VirtualHost>
# Virtual host site2.com
<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/site2.com
ServerName www.site2.com
ServerAlias site2.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
# Virtual host NOT.WORKING1.com
<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/NOT.WORKING1.com
ServerName www.NOT.WORKING1.com
ServerAlias NOT.WORKING1.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
#Virtual host NOT.WORKING2.com
<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/NOT.WORKING2.com
ServerName www.NOT.WORKING2.com
ServerAlias NOT.WORKING2.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>
########################################
 
Old 01-26-2006, 02:42 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,738

Rep: Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586
You can check your vhosts syntax with:
Code:
httpd -S
but I don't think you'll find any errors. Take a look also at the error_log to see where apache is trying to find the index page of the non working domains.
One thought is that apache (i.e. the user under which apache is running that is usually nobody) cannot read the DocumentRoot directories of your new vhosts, so it gives you the noindex page, or this has something to do with SELinux which is enabled by default in FC.
 
Old 01-26-2006, 08:22 AM   #3
dana340
LQ Newbie
 
Registered: Nov 2005
Posts: 18

Original Poster
Rep: Reputation: 0
Looks as if it is somthing with permissions, but what I don't understand is the permissions are set to 775, and apache is in a group that I use to give access to the web designer logins.

##############################
: /var/www/html/site1.com/xmlrpc
[Thu Jan 26 03:23:27 2006] [error] [client 205.134.227.222] File does not exist: /var/www/html/site1.com/xmlsrv
[Thu Jan 26 03:45:27 2006] [error] [client 203.87.116.42] File does not exist: /var/www/html/site1.com/awstats
[Thu Jan 26 04:14:20 2006] [error] [client 69.0.54.205] (13)Permission denied: access to /index.php denied
[Thu Jan 26 04:14:20 2006] [error] [client 69.0.54.205] (13)Permission denied: access to /index.html denied
[Thu Jan 26 04:14:21 2006] [error] [client 69.0.54.205] File does not exist: /var/www/html/NOT.WORKING1.com/favicon.ico
[Thu Jan 26 07:45:35 2006] [error] [client 69.118.162.141] File does not exist: /var/www/html/site2.com/favicon.ico
[Thu Jan 26 09:10:16 2006] [error] [client 149.152.191.253] (13)Permission denied: access to /index.html denied
[Thu Jan 26 09:10:16 2006] [error] [client 149.152.191.253] File does not exist: /var/www/html/NOT.WORKING1.com/favicon.ico
###################################

Oh also httpd -S did not give me any reply.

any other suggestions? In the meantime, I'll see if I can figure out what's going on with the permissions.
 
Old 01-26-2006, 09:05 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,738

Rep: Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586Reputation: 1586
Quote:
Oh also httpd -S did not give me any reply.
That's strange. It should list all your virtual servers. You can do the same for apache 2.x with: apachectl -S.
As for the permissions if SELinux is enabled read this or disable it if you don't want it.
 
Old 01-26-2006, 02:01 PM   #5
dana340
LQ Newbie
 
Registered: Nov 2005
Posts: 18

Original Poster
Rep: Reputation: 0
this page was able to help me out:
http://fedora.redhat.com/docs/selinu...ple-setup.html
the chcon command was able to change the SE linux filetypes. these were causing the site not to be displayed.

Thanks for your help.
 
  


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
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 06:29 AM
APACHE - Virtual Hosts luca2 Linux - Networking 3 12-27-2005 07:32 PM
apache virtual hosts smaida Linux - Software 3 06-20-2004 04:28 PM
Apache Virtual Hosts gbg Linux - Software 4 10-02-2003 08:35 AM
Apache Virtual Hosts (again) scatcat Linux - General 1 10-17-2002 09:51 AM


All times are GMT -5. The time now is 04: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration