Wednesday, March 27, 2013

Enable SSL with Apache HTTPD server 2.4.3

To enable SSL in apache httpd server, you need to have mod_ssl module installed. Below commands will install apache with mod_ssl.

openssl genrsa -out iugateway.key 1024
view raw key.sh hosted with ❤ by GitHub
Then you need to create key file and the cert files.

Create the key file

./configure --enable-ssl --enable-so
make
make install
view raw install.sh hosted with ❤ by GitHub
Create the cert file

openssl req -new -key iugatewy.key -out iugatewy.csr
view raw cert.sh hosted with ❤ by GitHub
.key file is your private key. After generating key file and the cert file, you can configure httpd.conf file.  

Configure httpd.conf

Make sure mod_ssl.so is enabled in modules list section.

LoadModule ssl_module modules/mod_ssl.so
view raw mod.sh hosted with ❤ by GitHub
Then add following lines to your httpd.conf.

SSLEngine on
SSLProxyEngine on
SSLCertificateFile /usr/local/apache2/conf/keys/iugateway.crt
SSLCertificateKeyFile /usr/local/apache2/conf/keys/iugateway.key
view raw ssl.sh hosted with ❤ by GitHub
Now restart apache server and now your http server will only accepts https requests. To work with apache HTTPD server 2.4.3, you need to have openssl-1.0.1e or higher. If your current openSSL version is minor to this, you will have to set LD_LIBRARY_PATH to a newer version.


export LD_LIBRARY_PATH=openssl-1.0.1e/dist/lib/
view raw path.sh hosted with ❤ by GitHub

1 comment:

Unknown said...

Hi,

Can you please suggest where this LD_LIBRARY_PATH has to be set?