SSL Configuration on wamp server

ssl[1]


I’ve just realized that I need this Apache 2.2.11 (include OpenSSL),

to continue working using OpenSSL.

Okay, let’s do the next steps.

1. Create SSL Certificate and Key

a. Ekstrak OpenSSL to your directory, and copy this file:

openssl.cnf to .\Apache2.2.11\conf\
from folder bin, copy all files to .\Apache2.2.11\bin\
// Replace the old files!

b. Open DOS command window by typing CMD in your search menu.

c. Type this cd C:\wamp\bin\apache\apache2.2.11\bin

d. Create a server private key with 1024 bits encryption by entering this command: openssl genrsa -des3 -out server.key 1024

// It’ll ask you a pass phrase (password), just enter any password you like .

e. Remove the pass phrase from the RSA private key (while keeping a backup copy of the original file). Enter this:

copy server.key server.key.org

openssl rsa -in server.key.org -out server.key

// It’ll ask you the pass phrase, just type it.

f. Create a self-signed Certificate (X509 structure) with the RSA key you just created. Enter this: openssl req -new -x509 -nodes -sha1 -days 365 -key server.key -out server.crt -config C:\wamp\bin\apache\apache2.2.11\conf\openssl.cnf

2. Copy the server.key and server.crt files

a. In the Apache2.2.11\conf\, create two folders named as ssl.key and ssl.crt

b. Copy the server.key file to ssl.key folder and server.crt file to ssl.crt folder

3. Edit the httpd.conf file, php.ini, and httpd_ssl.conf

a. Open httpd.conf file

b. Remove the comment ‘#’ at the line which says: LoadModule ssl_module modules/mod_ssl.so

c. Remove the comment ‘#’ at the line which says: Include conf/extra/httpd-ssl.conf

d. Open this file-> C:\wamp\bin\php\php5.3.8\php.ini

e. Remove the comment ‘;’ at the line which says: extension=php_openssl.dll

f. Open this file -> C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd_ssl.conf

g. Find the line which says: .

h. Right after it, change the line which says:

Change the line “DocumentRoot …” to DocumentRoot “C:/wamp/www/”
Change the line “ServerName…” to ServerName localhost:443
Change the line “ErrorLog….” to Errorlog “C:/wamp/bin/apache/Apache2.2.11/logs/sslerror.log”
Change the line “TransferLog ….” to TransferLog “C:/wamp/bin/apache/Apache2.2.11/logs/sslaccess.log”
Change the line “SSLCertificateFile ….” to SSLCertificateFile “C:/wamp/bin/apache/Apache2.2.11/conf/ssl.crt/server.crt”
Change the line “SSLCertificateKeyFile ….” to SSLCertificateKeyFile “C:/wamp/bin/apache/Apache2.2.11/conf/ssl.key/server.key”
Change the line which says or something like that (sorry I’m forget what its default dir :p) to
Add the following lines inside those … tags:
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Change the line “CustomLog…” to CustomLog “C:/wamp/bin/apache/Apache2.2.11/logs/ssl_request.log”
4. Make sure it works!

a. In the previous DOS Command windows, enter httpd -t . If it displays Sysntax is OK, then go to next step. If not, then correct the wrong syntax and redo step 3.

b. Restart the Apache server. If restart is successful, then open the browser and enter https://localhost/

How it goes? Works, eh? Congratz!

Aaand lastly, to redirect non-https entered link to https, do this.

1. Open file .\Apache2.2.11\conf\httpd.conf

2. Add this after the last line

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

3. Try this: http://localhost

About the Author

Hi! I'm Ahmad. I have a degree in Computer Science from Birzeit University and you might call me a bit of computer geek. I am the Founder of Greenbackend Turnkey Solutions a leading Cloud and Hosting Company in the Middle East, Also I am the Founder of Ahmad Naser Turnkey Solutions in Harvey, LA, USA. I'm comfortable with a large range of languages and techniques. After implementing enterprise applications using Salesforce and Siebel CRM for 3 years and with professional experience in building websites, cloud apps, iOS apps, Unity games, Android mobile apps and educational games for 8 years. I decided to share my technical knowledge with people all over the world to benefit from my experience and build their own careers specially because I am a real world example with over 20 successful apps on Google Play Store, Asset Store and Apple Store, So your success is mine and I want to help you reach your goals step by step exactly as I do. I'm passionate about teaching people about technologies, so from time to time I gave courses online and in learning centers and teach beginners and professionals on many technologies and development frameworks. One of my greatest goals in life is growing the next generation of software professionals and to keep teaching programming at every opportunity I get. I can't wait to help you experience the achievement and financial freedom that having a deep understanding of technology brings. So why not start learning to design & develop now by joining our epic Unity 3D professional 2d game development course? See you soon! Ahmad

>