You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tom Shi <tm...@yahoo.com> on 2007/06/20 17:16:15 UTC

[users@httpd] How to configure Host-Header based VirtualHost in Apache? IIS works.

We have to host two web sites, for example, www.mytestsite1.com and www.mytestsite2.com with one computer and one IP address.

When user access the websites, the router will route the requests to my local IP address, for example 192.168.1.100.

 <VirtualHost 192.168.1.100>
ServerName www.mytestsite1.com
...
</VirtualHost>

<VirtualHost 192.168.1.100>
ServerName www.mytestsite2.com
...
</VirtualHost>

Apache route all of the requests to www.mytestsite1.com even we start the requests with http://www.mytestsite2.com.

In IIS, we can create websites with IP address, port and host header, the requests can be routed to the specified sites.


Does the Apache support the host header based virtual hosting?

If yes, can anyone show me how to do it?

If not, is there any software based router that can support host-header routing for http requests?





Thanks
Tom
 
---------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile and 
always stay connected to friends.

Re: [users@httpd] How to configure Host-Header based VirtualHost in Apache? IIS works.

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 20.06.07 08:38, Dan_Mitton@Notes.YMP.GOV wrote:
> Also, name-based virtual hosting only works with HTTP.  You can not run 
> HTTPS that way.

Surely he can. There are only a few limitations (one ssl certificate per
ip/port)
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
   One OS to rule them all, One OS to find them, 
One OS to bring them all and into darkness bind them 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to configure Host-Header based VirtualHost in Apache? IIS works.

Posted by Da...@Notes.YMP.GOV.
Also, name-based virtual hosting only works with HTTP.  You can not run 
HTTPS that way.



Please respond to users@httpd.apache.org
Sent by:        jslive@gmail.com
To:     users@httpd.apache.org
cc:      (bcc: Dan Mitton/YD/RWDOE)
Subject:        Re: [users@httpd] How to configure Host-Header based 
VirtualHost in Apache? IIS works.
LSN: Not Relevant
User Filed as: Not a Record

On 6/20/07, Tom Shi <tm...@yahoo.com> wrote:

> Does the Apache support the host header based virtual hosting?

Yes. We call it name-based virtual hosting:

>
> If yes, can anyone show me how to do it?

http://httpd.apache.org/docs/2.2/vhosts/name-based.html

Your config looks pretty close. The only thing missing is the
NameVirtualHost directive.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to configure Host-Header based VirtualHost in Apache? IIS works.

Posted by Joshua Slive <jo...@slive.ca>.
On 6/20/07, Tom Shi <tm...@yahoo.com> wrote:

> Does the Apache support the host header based virtual hosting?

Yes. We call it name-based virtual hosting:

>
> If yes, can anyone show me how to do it?

http://httpd.apache.org/docs/2.2/vhosts/name-based.html

Your config looks pretty close. The only thing missing is the
NameVirtualHost directive.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org