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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? |
|
|||
|
"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> |
|
|||
|
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> |
|
|||
|
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? |