httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Greenlees" <ja...@shaw.ca>
Subject Re: [users@httpd] Multiple virtual hosts and https
Date Mon, 06 Jan 2003 21:16:39 GMT


Mark A Christofferson wrote:
> Is there a method by which one can run a server that accepts http://
> requests for all virtual hosts, some of which could be secured via mod_ssl
> and the https protocol, and others which are standard http protocols?  I
> see many websites that employ SSL only where it is necessary, in this case
> I would like to employ that technique and apply it to multiple IP Based
> Virtual Hosts.
Mark,
from the archives of the list here is how to configure multiple hosts.
add a listen xxx.xxx.xxx.xxx:443 for those that will be using ssl as 
well. where the xxx.xxx.xxx.xxx is the ip of the site.

http://marc.theaimsgroup.com/?l=apache-httpd-users&m=103942163824361&w=2

There are two ways you can go - depending on whether you want to declare
many aliases for your IP in DNS...

(1) If you do not mind paying for many Domain-Names which resolve to
your IP, then:

Use Name-based VirtualHosts, like this (assume your IP = 192.168.1.1 and
your sites are called www.site1.com, www.site2.com etc..):

	NameVirtualHost 192.168.1.1

	<VirtualHost 192.168.1.1>
	  ServerName www.site1.com
	  DocumentRoot /home/site1/html
	  ... etc.
	</VirtualHost>

	<VirtualHost 192.168.1.1>
	  ServerName www.site2.com
	  DocumentRoot /home/site2/html
	  ... etc.
	</VirtualHost>

(2) Alternatively, if you can have only one Domain Name, use Aliases to
separate the document roots, e.g. (assuming your FQDN is www.mysite.com)

	Listen 192.168.1.1
	ServerName www.mysite.com
	DocumentRoot /home/default/html

	Alias /site1 /home/site1/html
	<Directory /home/site1/html>
	  Allow from all
	</Directory>

	Alias /site2 /home/site2/html
	<Directory /home/site2/html>
	  Allow from all
	</Directory>

Now http://www.mysite.com/site1 will go to /home/site1/html etc. NB
/home/default/html is necessary - this is where www.mysite.com ends up
(you can just put a simple page there with links to the other sites).


Jaqui


---------------------------------------------------------------------
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


Mime
View raw message