artheus
September 28th, 2009, 12:51 PM
Hi there!
I've got a server, and I've gotten two valid signed certificates now. And want to install them both for different sub-domains on my server.
- 1 -
mail.mydomain.com
- 2 -
www.mydomain.com
mydomain.com
is supposed to get two different ssl certificates.
So I copy these certificates to the correct folders, and add settings in a new sites-available conf file. And I get "- 1 -" to work, the one for mail.mydomain.com. But when I then try to add one more site which is the www.mydomain.com and mydomain.com the browser still gets the mail.mydomain.com certificate.
So my question is, Is it possible to use multiple certificate files for my apache server?
my /etc/apache2/sites-available/ssl file :
NameVirtualHost *:443
<virtualhost *:443>
ServerName mail.mydomain.com
ServerAlias mail.mydomain.com
ServerAdmin webmaster@localhost
SSLEngine On
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/apache2/ssl/ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/ssl.key
SSLCertificateChainFile /etc/apache2/conf/sub.class1.server.ca.pem
SSLCACertificateFile /etc/apache2/conf/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /var/log/apache2/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
DocumentRoot /mnt/sdb1/roundcubemail
<directory />
Options FollowSymLinks
AllowOverride None
</directory>
<directory /mnt/sdb1/roundcubemail>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
</virtualhost>
<virtualhost *:443>
ServerName mydomain.com
ServerAlias mydomain.com www.mydomain.com
ServerAdmin webmaster@localhost
SSLEngine On
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/apache2/ssl/mydomain.com/ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/mydomain.com/ssl.key
SSLCertificateChainFile /etc/apache2/conf/sub.class1.server.ca.pem
SSLCACertificateFile /etc/apache2/conf/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /var/log/apache2/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
DocumentRoot /mnt/sdb1/www/mydomain
<directory />
Options FollowSymLinks
AllowOverride None
</directory>
<directory /mnt/sdb1/www/mydomain>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
</virtualhost>
What am I doing wrong?
Cheers,
Artheus
I've got a server, and I've gotten two valid signed certificates now. And want to install them both for different sub-domains on my server.
- 1 -
mail.mydomain.com
- 2 -
www.mydomain.com
mydomain.com
is supposed to get two different ssl certificates.
So I copy these certificates to the correct folders, and add settings in a new sites-available conf file. And I get "- 1 -" to work, the one for mail.mydomain.com. But when I then try to add one more site which is the www.mydomain.com and mydomain.com the browser still gets the mail.mydomain.com certificate.
So my question is, Is it possible to use multiple certificate files for my apache server?
my /etc/apache2/sites-available/ssl file :
NameVirtualHost *:443
<virtualhost *:443>
ServerName mail.mydomain.com
ServerAlias mail.mydomain.com
ServerAdmin webmaster@localhost
SSLEngine On
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/apache2/ssl/ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/ssl.key
SSLCertificateChainFile /etc/apache2/conf/sub.class1.server.ca.pem
SSLCACertificateFile /etc/apache2/conf/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /var/log/apache2/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
DocumentRoot /mnt/sdb1/roundcubemail
<directory />
Options FollowSymLinks
AllowOverride None
</directory>
<directory /mnt/sdb1/roundcubemail>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
</virtualhost>
<virtualhost *:443>
ServerName mydomain.com
ServerAlias mydomain.com www.mydomain.com
ServerAdmin webmaster@localhost
SSLEngine On
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
SSLCertificateFile /etc/apache2/ssl/mydomain.com/ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/mydomain.com/ssl.key
SSLCertificateChainFile /etc/apache2/conf/sub.class1.server.ca.pem
SSLCACertificateFile /etc/apache2/conf/ca.pem
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog /var/log/apache2/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
DocumentRoot /mnt/sdb1/www/mydomain
<directory />
Options FollowSymLinks
AllowOverride None
</directory>
<directory /mnt/sdb1/www/mydomain>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
</virtualhost>
What am I doing wrong?
Cheers,
Artheus