This is a discussion on Virtual Hosting question within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello again, I am running Apache on an XP computer as a server. I have two domains pointing at my ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello again,
I am running Apache on an XP computer as a server. I have two domains pointing at my IP address. It doesn't matter which address I type in from a browser, only "company1" comes up. The server is behind a hardware firewall, and is assigned 192.168.0.2. I suspect this is easy, but I am just learning Apache configuration. Here is what I have in the hppd.conf: NameVirtualHost *:80 <VirtualHost 192.168.0.2> Servername www.company1.com DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company1" </VirtualHost> <VirtualHost 192.168.0.2> Servername www.company2.com DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company2" </VirtualHost> Thanks in advance, Jim |
|
|||
|
James Warren wrote:
> Hello again, > I am running Apache on an XP computer as a server. I have two domains > pointing at my IP address. It doesn't matter which address I type in from a > browser, only "company1" comes up. The server is behind a hardware > firewall, and is assigned 192.168.0.2. I suspect this is easy, but I am > just learning Apache configuration. I had a similar problem when switching from Apache 1.3.x to 2.0.x. I don't know if this is the correct way to do it but it works for me. I added a dummy domain in as the default using the same document root as my first real domain. I had more than two domains going and the first worked (default), the second gave me the default, the rest worked. So now, the (dummy) default is never used, the second gives me the default, and the rest work. -- Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html Webmaster/Computer Center Manager, NMSU at Alamogordo Coordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB '94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg A zest for living must include a willingness to die. - R.A. Heinlein |
|
|||
|
"James Warren" <warren.james.d@att.net> wrote in
news:GNzXd.117361$Th1.63295@bgtnsc04-news.ops.worldnet.att.net: > Hello again, > I am running Apache on an XP computer as a server. I have two domains > pointing at my IP address. It doesn't matter which address I type in > from a browser, only "company1" comes up. The server is behind a > hardware firewall, and is assigned 192.168.0.2. I suspect this is > easy, but I am just learning Apache configuration. > > > Here is what I have in the hppd.conf: > > NameVirtualHost *:80 > <VirtualHost 192.168.0.2> > Servername www.company1.com > DocumentRoot "c:/program files/Apache > Group/Apache2/htdocs/usr/Company1" > </VirtualHost> > > <VirtualHost 192.168.0.2> > Servername www.company2.com > DocumentRoot "c:/program files/Apache > Group/Apache2/htdocs/usr/Company2" > </VirtualHost> > As noted, drop the IP address. Begin each <VirtualHost> with <VirtualHost *:80> Then, turn off the service, open a command line window, and start Apache manually. This way, you can see any error messages generated. -- Terry Austin www.hyperbooks.com Campaign Cartographer now available |
|
|||
|
On Wed, 09 Mar 2005 09:59:02 GMT, "James Warren" <warren.james.d@att.net> wrote:
>Hello again, >I am running Apache on an XP computer as a server. I have two domains >pointing at my IP address. It doesn't matter which address I type in from a >browser, only "company1" comes up. The server is behind a hardware >firewall, and is assigned 192.168.0.2. I suspect this is easy, but I am >just learning Apache configuration. > > >Here is what I have in the hppd.conf: > >NameVirtualHost *:80 ><VirtualHost 192.168.0.2> > Servername www.company1.com > DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company1" ></VirtualHost> > ><VirtualHost 192.168.0.2> > Servername www.company2.com > DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company2" ></VirtualHost> > >Thanks in advance, >Jim > Here are VirtualHost entries which should work: <VirtualHost *:80 *:443> DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company1" ServerName company1.com ServerAlias *.company1.com CustomLog logs/company1_access_log combined </VirtualHost> <VirtualHost *:80 *:443> DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company2" ServerName company2.com ServerAlias *.company2.com CustomLog logs/company2_access_log combined </VirtualHost> -- Brendan |
|
|||
|
BWK wrote:
> On Wed, 09 Mar 2005 09:59:02 GMT, "James Warren" <warren.james.d@att.net> wrote: > > >>Hello again, >>I am running Apache on an XP computer as a server. I have two domains >>pointing at my IP address. It doesn't matter which address I type in from a >>browser, only "company1" comes up. The server is behind a hardware >>firewall, and is assigned 192.168.0.2. I suspect this is easy, but I am >>just learning Apache configuration. >> >> >>Here is what I have in the hppd.conf: >> >>NameVirtualHost *:80 >><VirtualHost 192.168.0.2> >> Servername www.company1.com >> DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company1" >></VirtualHost> >> >><VirtualHost 192.168.0.2> >> Servername www.company2.com >> DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company2" >></VirtualHost> >> >>Thanks in advance, >>Jim >> > > > Here are VirtualHost entries which should work: > > <VirtualHost *:80 *:443> > DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company1" > ServerName company1.com > ServerAlias *.company1.com > CustomLog logs/company1_access_log combined > </VirtualHost> > > <VirtualHost *:80 *:443> > DocumentRoot "c:/program files/Apache Group/Apache2/htdocs/usr/Company2" > ServerName company2.com > ServerAlias *.company2.com > CustomLog logs/company2_access_log combined > </VirtualHost> > > -- > Brendan The only thing I will suggest is that the ServerAlias should be www.company1.com not *.company1 or company2.com the reason being is that if say I wanted sub virtual domains the above would answer to anything, which might not be the desired effect. ie: employees.company1.com repair.company1.com I wuld be sure in this case it would send the user to an undesired directory. Just a thought |
|
|||
|
Thank you all very much, I truely appreciate the response. I'll make the
recommended changes and get back with you on the result. Regards, Jim "David" <dwmoar@findmoore.net> wrote in message news:y_ednbuIvJWYobLfRVn-jg@megapath.net... > BWK wrote: >> On Wed, 09 Mar 2005 09:59:02 GMT, "James Warren" <warren.james.d@att.net> >> wrote: >> >> >>>Hello again, >>>I am running Apache on an XP computer as a server. I have two domains >>>pointing at my IP address. It doesn't matter which address I type in >>>from a browser, only "company1" comes up. The server is behind a >>>hardware firewall, and is assigned 192.168.0.2. I suspect this is easy, >>>but I am just learning Apache configuration. >>> >>> >>>Here is what I have in the hppd.conf: >>> >>>NameVirtualHost *:80 >>><VirtualHost 192.168.0.2> >>> Servername www.company1.com >>> DocumentRoot "c:/program files/Apache >>> Group/Apache2/htdocs/usr/Company1" >>></VirtualHost> >>> >>><VirtualHost 192.168.0.2> >>> Servername www.company2.com >>> DocumentRoot "c:/program files/Apache >>> Group/Apache2/htdocs/usr/Company2" >>></VirtualHost> >>> >>>Thanks in advance, >>>Jim >> >> >> Here are VirtualHost entries which should work: >> >> <VirtualHost *:80 *:443> >> DocumentRoot "c:/program files/Apache >> Group/Apache2/htdocs/usr/Company1" >> ServerName company1.com >> ServerAlias *.company1.com >> CustomLog logs/company1_access_log combined >> </VirtualHost> >> >> <VirtualHost *:80 *:443> >> DocumentRoot "c:/program files/Apache >> Group/Apache2/htdocs/usr/Company2" >> ServerName company2.com >> ServerAlias *.company2.com >> CustomLog logs/company2_access_log combined >> </VirtualHost> >> >> -- >> Brendan > > > The only thing I will suggest is that the > ServerAlias should be www.company1.com not *.company1 or company2.com > > the reason being is that if say I wanted sub virtual domains the above > would answer to anything, which might not be the desired effect. > > ie: employees.company1.com > repair.company1.com > > I wuld be sure in this case it would send the user to an undesired > directory. > > Just a thought |
|
|||
|
You guys are awsome! Problem solved, and we are off and running - er -
VirtualHosting. God Bless, Jim "BWK" <cyclorider1@yahoo.com> wrote in message news:ludu219plds42c8c8g2i1gts6lash0m7kg@4ax.com... > On Wed, 09 Mar 2005 09:59:02 GMT, "James Warren" <warren.james.d@att.net> > wrote: > >>Hello again, >>I am running Apache on an XP computer as a server. I have two domains >>pointing at my IP address. It doesn't matter which address I type in from >>a >>browser, only "company1" comes up. The server is behind a hardware >>firewall, and is assigned 192.168.0.2. I suspect this is easy, but I am >>just learning Apache configuration. >> >> >>Here is what I have in the hppd.conf: >> >>NameVirtualHost *:80 >><VirtualHost 192.168.0.2> >> Servername www.company1.com >> DocumentRoot "c:/program files/Apache >> Group/Apache2/htdocs/usr/Company1" >></VirtualHost> >> >><VirtualHost 192.168.0.2> >> Servername www.company2.com >> DocumentRoot "c:/program files/Apache >> Group/Apache2/htdocs/usr/Company2" >></VirtualHost> >> >>Thanks in advance, >>Jim >> > > Here are VirtualHost entries which should work: > > <VirtualHost *:80 *:443> > DocumentRoot "c:/program files/Apache > Group/Apache2/htdocs/usr/Company1" > ServerName company1.com > ServerAlias *.company1.com > CustomLog logs/company1_access_log combined > </VirtualHost> > > <VirtualHost *:80 *:443> > DocumentRoot "c:/program files/Apache > Group/Apache2/htdocs/usr/Company2" > ServerName company2.com > ServerAlias *.company2.com > CustomLog logs/company2_access_log combined > </VirtualHost> > > -- > Brendan |