LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-12-2010, 08:17 AM   #1
zuessh
Member
 
Registered: Jun 2002
Location: USA
Distribution: Suse 8.0
Posts: 247

Rep: Reputation: 30
Apache VirualHost multiple domains single IP


Hey - I am having a problem with apache's virtualhost directive hosting multiple domains on a single IP with Apache 2.2 on Fedora 11. For example i have domaina.com and domainab.com pointing to the same IP address and have my httpd.conf configured like so:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/domainA
ServerName domaina.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/domainb
ServerName domainb.com
</VirtualHost>

The problem is when i navigate to either domaina.com or domainb.com i get the default Apache page. Its like it is only accepting the default DocumentRoot directive.

Any thoughts or suggestion?
 
Old 01-12-2010, 08:35 AM   #2
SethsdadtheLinuxer
Member
 
Registered: Jun 2007
Posts: 152

Rep: Reputation: 37
http://httpd.apache.org/docs/2.0/vhosts/

probably don't have your Alias(es) set up correctly
 
Old 01-12-2010, 09:01 AM   #3
zuessh
Member
 
Registered: Jun 2002
Location: USA
Distribution: Suse 8.0
Posts: 247

Original Poster
Rep: Reputation: 30
Thanks for the suggestion but that didn't seem to work either. I added the following lines:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/domainA
ServerName domaina.com
ServerAlias domaina.com www.domaina.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/domainb
ServerName domainb.com
ServerAlias domainb.com www.domainb.com
</VirtualHost>

but the default DocumentRoot is still overriding the virtualhost. Am i just missing the forest for all of the trees?
 
Old 01-12-2010, 09:16 AM   #4
zuessh
Member
 
Registered: Jun 2002
Location: USA
Distribution: Suse 8.0
Posts: 247

Original Poster
Rep: Reputation: 30

It was a typo in my httpd.conf


For the directive
<VirtualHost *:80>

I had a . in front of the port rather than a :

 
  


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
[SOLVED] Set up Multiple Domains in Single openwebmail mail4vijay Linux - Server 13 11-19-2009 02:44 AM
Multiple domains names - Single machine jduckett01 Linux - Networking 3 09-18-2006 05:09 AM
Sub Domains & Multiple Domains (Apache) lugos Linux - Server 1 09-01-2006 10:22 PM
multiple domains on a single m/c for sendmail p_test Linux - Networking 1 04-26-2006 12:45 PM
Can I use a single Samba server for multiple domains? help321 Linux - Software 0 08-11-2004 05:20 AM


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