httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Agnello George" <>
Subject Re: [users@httpd] How to start Apache automatically with certificate?
Date Fri, 29 Aug 2008 11:52:26 GMT
On 8/28/08, Tan, Liao <> wrote:
> Folks,
>  Pls gimme some direction on how to start apache (already with the https certificate
installed)automatically,that means, without informing manually the passwords, phrase?
Here is a little documention i had worked out ( just check it out and
let me know if its helpful !!

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/

2. Make the followin directory structure

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

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 for a password when it restart we
do the following )

cd /usr/local/apache2/conf/domains_ssl/ ------> your
location of the keys for domain agnello
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
openssl rsa -in -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

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

( add the following  if not already there )

<IfModule ssl_module>
  Listen 443
  SSLRandomSeed startup builtin
  SSLRandomSeed connect builtin

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


DocumentRoot /websites/
SSLEngine on
SSLCertificateKeyFile /usr/local/apache2/conf/domains_ssl/
SSLCertificateFile /usr/local/apache2/conf/domains_ssl/
ErrorLog /websites/
CustomLog /websites/ common

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

Now view you site

Agnello D'souza

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message