Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 virtual hosts with SSL

Status
Not open for further replies.

Crundy

Programmer
Jul 20, 2001
305
GB
I have set up 2 virtual hosts on my server each of which uses it's own key and certificate (obviously!). Problem is, the second one (webmail) seems to be using the same certificate as the first one ( Here is my httpd.conf:

ServerType standalone
ServerAdmin webmaster@domainname.com
User www
Group www
Port 443
Listen 443
PidFile /usr/local/apache-ssl/logs/httpd.pid
AddHandler cgi-script .pl
NameVirtualHost *

<VirtualHost *>
ServerName SSLEngine on
SSLVerifyClient 0
SSLVerifyDepth 10
SSLCertificateKeyFile /usr/local/apache-ssl/conf/ssl.key/SSLCertificateFile /usr/local/apache-ssl/conf/ssl.crt/DocumentRoot /web
DirectoryIndex index.html index.htm welcome.html welcome.htm index.xml
ScriptAlias /cgi-bin/ &quot;/web/cgi-bin/&quot;
TransferLog /usr/local/apache-ssl/logs/access.log
SSLLogFile /usr/local/apache-ssl/logs/ssl.log
ErrorLog /usr/local/apache-ssl/logs/error.log
</VirtualHost>

<VirtualHost *>
ServerName webmail.domainname.com
DocumentRoot /neomail
DirectoryIndex index.html
SSLEngine on
SSLVerifyClient 0
SSLVerifyDepth 10
SSLCertificateKeyFile /usr/local/apache-ssl/conf/ssl.key/webmail.domainname.com.key
SSLCertificateFile /usr/local/apache-ssl/conf/ssl.crt/webmail.domainname.com.crt
ScriptAlias /cgi-bin/ &quot;/neomail/cgi-bin/&quot;
TransferLog /usr/local/apache-ssl/logs/access.log
SSLLogFile /usr/local/apache-ssl/logs/ssl.log
ErrorLog /usr/local/apache-ssl/logs/error.log
</VirtualHost>

Does anyone know why both hosts are using the same certificate? They point to the correct DocumentRoots.

P.S. I tried setting up as the main server (not as a VirtualHost) but this caused both domains to point to webmail's documentroot.

P.P.S both the hosts need to be SSL enabled.
C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!
 
I'm no pro at this, but I've run into the same problem before. Apparently, your two virtual hosts are using the same certificate because you are using name virtual hosts. In order for you to be able to host more than one virtual host having certificates for each one, you have to use IP virtual hosting. If you own more than one IP address, use network interface aliasing to assign multiple IP addresses to your network interface.

--REI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top