Browse archives
User login |
Setting Up secure web server using Apache and OpenSSLUsing apache and OpenSSL you can create your own secure web server to keep authentication and other information private. Having a secure web server is very necessity if you are doing on-line administration, banking and/or e-commerce. You may just have personal information you need to access over the web and wish to make secure. Using a secure web server is perfect for these implementations. You must have the following packages installed: Apache 1.3.12 or later Yuo must compile the OpenSSL first $ ./config Now you should comply and install Mod_ssl $ cd mod_ssl-2.6.x-1.3.x Configure httpd.conf for SSL Support After Apache mod-ssl is installed, you can configure your httpd.conf like you would for a normal site. You will, however, have to setup your SSL secure site through a VirtualHost. You will access with https://my.site.com instead of http://my.site.com. There are many configuration options and requirements for a VirtualHost in Apache. Since there is too much to talk about here I will only give you an example of a basic VirtualHost. A VirtualHost contains the server name, system administrators e-mail address, the path to the files and a path to the logs for the host. It turns out looking something like this: ServerAdmin admin@mysite.com To add SSL support to your VirtualHost you must enable it and tell it where you have your certificate and key to decrypt it with. Add these lines before the '' tag: SSLEngine on These are basic SSL options for VirtualHosts. There are many more than can be listed in this short document. When you install mod_SSL into Apache the new httpd.conf will have examples and descriptions of VirtualHosts and SSL options. You can also find numerous documents at www.apache.org and www.modssl.org. Once configured, you are all set to start up the server. Start Apache in SSL mode by typing the following: [root@myhost #] /usr/sbin/httpd -startssl Notice it asks you for a password. It will require a password to decrypt your key for the SSL encryption. This could prevent apache from working on startup. Here is a way around it, but it can be a security hazard. [root@myhost #] cp /path/to/apache-conf/ssl.key/server.key server.key.old Now, using OpenSSL, decrypt the key: [root@myhost #] /usr/sbin/openssl rsa -in server.key.old -out server.key It will prompt you for your password and decrypt your key. server.key now contains an unencrypted key. You must still start apache with httpd --startssl or the start-up file included with your RPM or dpkg. |
||||||||||||||||||||||||||||||||||||||||||