steps to Installing mod_ssl for multiple domains

Apache : mod_ssl for virtual hosting

1. The apache server should be compiled with mod_ssl enabled,. You can check this in the httpd.conf file

LoadModule ssl_module modules/mod_ssl.so

2. Make the followin directory structure

mkdir /usr/local/apache2/conf/domains_ssl/

mkdir /usr/local/apache2/conf/domains_ssl/nokia.com/

3. once this is done create your self-signed ssl certificate and your ssl private key using the openssl toolkit. ( for production purpose you may want to purchase your certificate)

( in orde that apache should not ask fora passwork when it restart we do the following )

cd /usr/local/apache2/conf/domains_ssl/name1.com/ ------>

your location of the keys for domain name1

Step 1: Generate Private Key

openssl genrsa -des3 -out server.key 1024

(

N.B: make sure that that the CN matches that of the domain name )

Step 2: Generate CSR

openssl req -new -key server.key -out server.csr

Step 3: Remove Passphrase

cp server.key server.key.org

openssl rsa -in server.key.org -out server.key

Step 4: Sign the Certificate

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

you would have the follwing keys generated.

server.crt server.csr server.key server.key.org

 

Once this is done go to the very last line in the httpd.conf file

( addthe following if not already there )

<IfModule ssl_module>

Listen 443

SSLRandomSeed startup builtin

SSLRandomSeed connect builtin

</IfModule>

now in the httpd-vhost.conf file ( /usr/local/apache2/conf/extra/httpd-vhosts.conf ) add the following

NameVirtualHost 192.168.0.244:443

<VirtualHost 192.168.0.244:443>

ServerAdmin admin@name1.sys.qualiproj.com

ServerName name1.sys.qualiproj.qualispace.com

ServerAlias www.name1.sys.qualiproj.qualispace.com

DocumentRoot /websites/name1.com/web

SSLEngine on

SSLCertificateKeyFile /usr/local/apache2/conf/domains_ssl/name1.com/server.key

SSLCertificateFile /usr/local/apache2/conf/domains_ssl/name1.com/server.crt

ErrorLog /websites/name1.com/logs/name1.sys.qualiproj.error_log

CustomLog /websites/name1.com/logs/name1.sys.qualiproj.access_log common

</VirtualHost>

  

Now you can restart apache . it will not prompt you for a password .

Now view you site

https://domain.com

 

 

 

No comments:

Other Articles

Enter your email address: