View Single Post
  #3  
Old 23rd February 2011, 21:18
menahem menahem is offline
Member
 
Join Date: Aug 2006
Posts: 40
Thanks: 0
Thanked 1 Time in 1 Post
Default

falko,

It is working but i need your eyes over it to help me do it on another server.
What i did is:
preliminary notes:

A. I used ispconfig manual in order to have SSL configured.
B. The server i used has 1 IP address with numerous virtual hosts on it. That meas that (With accordance to the ispconfig manual) only one Vhost can have the SSL certificate.

The Howto:
I set to one of the Vhosts it own SSL certificate.
then:
Code:
vi /etc/apache2/sites-available/default-ssl
And chanced it from:
Code:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
	ServerAdmin webmaster@localhost
	
	DocumentRoot /var/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
to:
Code:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
	ServerAdmin webmaster@localhost
	
	DocumentRoot /var/www/example.com/web
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/example.com/web>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
And then restarted apache with:
Code:
/etc/init.d/apache2 restart
I ended with the following:
When ever i do https://example.com, i get an answer feom the server and everything looks o.k. - But: when ever i do https://hostname.com i am redirected by the server to example.com or ,if you like, to /var/www/example.com/web.
As far as i can see with this server configuration only one Vhost can have SSL access because there is only 1 SSL certificate to it IP address.
That is fine.

Now i need your help/opinion regarding another server who have 4 ip address and many Vhosts on any IP address. This server is a production server and i do not and can not play with it.

I think that it can be done by adding multiple data to default-ssl it might look like this (but i am not shure about that):
Code:
<VirtualHost _default_:443>
	ServerAdmin webmaster@localhost
	
	DocumentRoot /var/www/example.com/web
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/example.com/web>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
<VirtualHost _default_:443>
	ServerAdmin webmaster@localhost
	
	DocumentRoot /var/www/domain.com/web
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/domain.com/web>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
<VirtualHost _default_:443>
	ServerAdmin webmaster@localhost
	
	DocumentRoot /var/www/domain2.com/web
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/domain2.com/web>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
Thank`s for your help. Please advice.
Menahem
Reply With Quote