The Apache Web server is
installed on servers around the world, providing solid performance and
features to those who use it. Apache provides security for e-commerce
through SSL certificates, the de facto standard for such transactions.
OpenSSL is typically used to create the certificates, and both Apache
and OpenSSL are frequently used on a Linux platform.
Instructions
-
-
1
Install the Apache2 Web server, OpenSSL and PHP5 using the following commands at the Linux command prompt:
apt-get install apache2 openssl libapache2-mod-php5 php5-cli php5-common php5-cgi
apt-get update
The second command ensures that all software contains the most current updates. -
2
Create an SSL certificate using the following command at the command prompt:
openssl req $@ -new –x509 –days 700 –nodes –out /etc/apache2/apache.pem –keyout /etc/apache2/sslcert.pem
The resulting process will ask you for information about the server. The more accurate the information you provide, the more security the certificate will be able to provide. -
3
Set permissions for the “sslcert.pem” file using the following command:
chmod 600 /etc/apache2/sslcert.pem
Use a text editor to change the /etc/apache2/ports.conf file, adding this line line to cause Apache2 to listen on port 443:
Listen 443
Save the file and close it. -
4
Enable SSL support for your Apache2 server using the following command:
a2enmod ssl -
5
Change your site’s configuration file to allow Apache2 to use SSL. Be sure the following two lines are present:
NameVirtualHost *.80 (change from NameVIrtualHost *)
NameVirtualHost *.443 (permit SSL connections) -
6
Restart the Apache server with the following command:
/etc/init.d/apache2 restart -
7
Test your server. Open a Web browser, key https://localhost in the URL and press “Enter.” You should see your Web server’s home page with “https” at the front of the URL.
-
1