virtual domain problem on apache

This is a discussion on virtual domain problem on apache within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi everyone, I've been trying to get virtual domains working for a few days and I just can't ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-30-2003
Jay Donnell
 
Posts: n/a
Default virtual domain problem on apache

Hi everyone,

I've been trying to get virtual domains working for a few days and I
just can't seem to get it working right. My httpd.conf looks like
this:

NameVirtualHost 69.55.111.111

<VirtualHost 69.55.111.111>
DocumentRoot "/home/tdkcom2/public_html/adomain"
ServerName adomain.com
#ServerAlias www.adomain.org
</VirtualHost>
<VirtualHost 69.55.111.111>
DocumentRoot "/home/jay/public_html/mydomain"
ServerName mydomain.org
#ServerAlias www.mydomain.org
</VirtualHost>

the problem is that I can only get to mydomain.com if i put
http://mydomain.org.
If I put http://www.mydomain.org it shows my the adomain.com site. If
change the order of the VirtualHost's in httpd.conf then the problem
moves from mydomain.com to adomain.com.

Anyone know what this could be?
  #2 (permalink)  
Old 12-30-2003
ChronoFish
 
Posts: n/a
Default Re: virtual domain problem on apache


"Jay Donnell" <jaydonnell@yahoo.com> wrote in message news:a6fdfd6b.0312292114.5f6acf96@posting.google.c om...
> Hi everyone,
>
> I've been trying to get virtual domains working for a few days and I
> just can't seem to get it working right. My httpd.conf looks like
> this:
>
> NameVirtualHost 69.55.111.111
>
> <VirtualHost 69.55.111.111>
> DocumentRoot "/home/tdkcom2/public_html/adomain"
> ServerName adomain.com
> #ServerAlias www.adomain.org
> </VirtualHost>
> <VirtualHost 69.55.111.111>
> DocumentRoot "/home/jay/public_html/mydomain"
> ServerName mydomain.org
> #ServerAlias www.mydomain.org
> </VirtualHost>
>
> the problem is that I can only get to mydomain.com if i put
> http://mydomain.org.
> If I put http://www.mydomain.org it shows my the adomain.com site. If
> change the order of the VirtualHost's in httpd.conf then the problem
> moves from mydomain.com to adomain.com.
>
> Anyone know what this could be?


I'm under the impression that you want name-based virtual hosting since your virtual hosts share the same IP.

Look at the original http.conf file and you will see how they set it up. Here is what I do:

#
# Use name-based virtual hosting.
#
NameVirtualHost *

<VirtualHost *>
DocumentRoot /www/www.first.org/htdocs/
ServerName www.first.org
ErrorLog logs/www.first.org-error_log
<Directory /www/www.first.org>
AllowOverride ALL
AddHandler cgi-script .cgi .pl .py
Options Includes Indexes FollowSymLinks ExecCGI
</Directory>
</VirtualHost>

<VirtualHost *>
DocumentRoot /www/www.second.com/htdocs/
ServerName www.second.com
ErrorLog logs/www.second.com-error_log
<Directory /www/www.second.com>
AllowOverride ALL
AddHandler cgi-script .cgi .pl .py
Options Includes Indexes FollowSymLinks ExecCGI
</Directory>
</VirtualHost>


  #3 (permalink)  
Old 12-30-2003
Jay Donnell
 
Posts: n/a
Default Re: virtual domain problem on apache

I don't see the difference between your setup and mine other than the
fact that I specify my ip and you use *. Is there something I'm
missing?

"ChronoFish" <deja@chronofish.com> wrote in message news:<KGkIb.23364$ti2.20025@lakeread03>...
> "Jay Donnell" <jaydonnell@yahoo.com> wrote in message news:a6fdfd6b.0312292114.5f6acf96@posting.google.c om...
> > Hi everyone,
> >
> > I've been trying to get virtual domains working for a few days and I
> > just can't seem to get it working right. My httpd.conf looks like
> > this:
> >
> > NameVirtualHost 69.55.111.111
> >
> > <VirtualHost 69.55.111.111>
> > DocumentRoot "/home/tdkcom2/public_html/adomain"
> > ServerName adomain.com
> > #ServerAlias www.adomain.org
> > </VirtualHost>
> > <VirtualHost 69.55.111.111>
> > DocumentRoot "/home/jay/public_html/mydomain"
> > ServerName mydomain.org
> > #ServerAlias www.mydomain.org
> > </VirtualHost>
> >
> > the problem is that I can only get to mydomain.com if i put
> > http://mydomain.org.
> > If I put http://www.mydomain.org it shows my the adomain.com site. If
> > change the order of the VirtualHost's in httpd.conf then the problem
> > moves from mydomain.com to adomain.com.
> >
> > Anyone know what this could be?

>
> I'm under the impression that you want name-based virtual hosting since your virtual hosts share the same IP.
>
> Look at the original http.conf file and you will see how they set it up. Here is what I do:
>
> #
> # Use name-based virtual hosting.
> #
> NameVirtualHost *
>
> <VirtualHost *>
> DocumentRoot /www/www.first.org/htdocs/
> ServerName www.first.org
> ErrorLog logs/www.first.org-error_log
> <Directory /www/www.first.org>
> AllowOverride ALL
> AddHandler cgi-script .cgi .pl .py
> Options Includes Indexes FollowSymLinks ExecCGI
> </Directory>
> </VirtualHost>
>
> <VirtualHost *>
> DocumentRoot /www/www.second.com/htdocs/
> ServerName www.second.com
> ErrorLog logs/www.second.com-error_log
> <Directory /www/www.second.com>
> AllowOverride ALL
> AddHandler cgi-script .cgi .pl .py
> Options Includes Indexes FollowSymLinks ExecCGI
> </Directory>
> </VirtualHost>

  #4 (permalink)  
Old 12-30-2003
Jay Donnell
 
Posts: n/a
Default Re: virtual domain problem on apache

I found the problem. I had to change the main ServerName directive to
my ip address. Everything works perfectly now.



jaydonnell@yahoo.com (Jay Donnell) wrote in message news:<a6fdfd6b.0312292114.5f6acf96@posting.google. com>...
> Hi everyone,
>
> I've been trying to get virtual domains working for a few days and I
> just can't seem to get it working right. My httpd.conf looks like
> this:
>
> NameVirtualHost 69.55.111.111
>
> <VirtualHost 69.55.111.111>
> DocumentRoot "/home/tdkcom2/public_html/adomain"
> ServerName adomain.com
> #ServerAlias www.adomain.org
> </VirtualHost>
> <VirtualHost 69.55.111.111>
> DocumentRoot "/home/jay/public_html/mydomain"
> ServerName mydomain.org
> #ServerAlias www.mydomain.org
> </VirtualHost>
>
> the problem is that I can only get to mydomain.com if i put
> http://mydomain.org.
> If I put http://www.mydomain.org it shows my the adomain.com site. If
> change the order of the VirtualHost's in httpd.conf then the problem
> moves from mydomain.com to adomain.com.
>
> Anyone know what this could be?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:11 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0