LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-23-2012, 05:36 PM   #1
psoheil
LQ Newbie
 
Registered: Mar 2010
Location: Chicago
Distribution: Redhat, CentOS, Ubuntu, Fedora
Posts: 22

Rep: Reputation: 0
Apache VirtualHost Not Working


Hello All,

I have a CentOS 6 Server where I am attempting to configure VirtualHost. Here is what I have:

Default Server:
Address: Any
Port: Any
Server Name: Automatic
Document Root: /var/www/html

Virtual Server SSL:
Address: Any
Port: 443
Server Name: Automatic
Document Root: /var/www/html

Virtual Server 1:
Address: Any
Port: 80
Server Name: home.domainname.com
Document Root: /home/home.domainname.com/www/

The first two come out of box. The problem is as soon as I add "Virtual Server 1" information the server defaults it to "Default Server" and does not show anything in the "home/home.domainname.com/www/" directory. Here is the contents of the "/etc/httpd/conf/httpd.conf" file:

Code:
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /home/home.domainname.com/www/
ServerName home.jetsupport.com
<Directory "/home/home.domainname.com/www/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
Does anyone know what may be causing the issue?

Thanks,
Pete
 
Old 06-23-2012, 09:46 PM   #2
psoheil
LQ Newbie
 
Registered: Mar 2010
Location: Chicago
Distribution: Redhat, CentOS, Ubuntu, Fedora
Posts: 22

Original Poster
Rep: Reputation: 0
Found the answer elsewhere. It looks like CentOS as shipped will expect directories to be served by apache to reside under /var/www and if they are not then selinux will get very unhappy and deny access to the files. Copying the virtual directory to the location specified resolved the problem.

The interesting part is that on our other server which is a Fedora 16 server it allows us to have the directory in "/home/sitename" just fine, but it seems that CentOS is indeed very picky about having the directory in "/var/www/sitename".

Thanks,
Pete
 
  


Reply

Tags
virtual host



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
APACHE VirtualHost not working on older slackware machine mtlhd Linux - Server 1 01-25-2010 09:25 PM
[SOLVED] Apache VirtualHost Help Chris1989 Linux - Server 6 11-08-2009 05:30 PM
Apache - VirtualHost setting not working? Splenden Linux - Server 9 01-14-2007 12:15 PM
Help with Apache <VirtualHost> please. smakkythecamel Linux - Networking 2 06-12-2003 07:15 PM
apache virtualhost jonfa Linux - Networking 5 08-12-2002 06:07 PM

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

All times are GMT -5. The time now is 03:02 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
Open Source Consulting | Domain Registration