Saturday, July 05, 2014

Apache 2 SSL Cert and Config

Intro

I am installing a SSL cert for Apache2 and I thought I would document it. I have done it so many times now and kinda feel like its about time to have a place to go to to get the details quickly. I am using a domain level cert because its cheap and will provide encryption without having to verify my "business" (there isnt one yet). The cert I am using for this is Comodo's positivessl cert from Namecheap.com that costs 9.99

Apache2 + mod_ssl

#make sure the module is not there yet
/usr/sbin/apachectl -t -D DUMP_MODULES
#install ssl
sudo yum install openssl-devel
#get and build apache 2 based on your version
cd src
/usr/sbin/apachectl -v
wget http://www.eng.lsu.edu/mirrors/apache//httpd/httpd-2.2.27.tar.gz
tar xvfz httpd-2.2.27.tar.gz
cd httpd-2.2.27
./configure --enable-ssl --enable-so
make
sudo make install
view raw apache-ssl01.sh hosted with ❤ by GitHub

Configuration

<VirtualHost gitpatron.com:443>
ServerAdmin admin@gitpatron.com
ServerName gitpatron.com
SSLEngine on
SSLCertificateKeyFile /etc/ssl/certs/gitpatron.key
SSLCertificateFile /etc/ssl/certs/gitpatron_com.crt
SSLCertificateChainFile /etc/ssl/certs/gitpatron_com.ca-bundle
</VirtualHost>
view raw gistfile1.txt hosted with ❤ by GitHub

Sources