Nurul’s Personal Blog

I have tried to enable SSL on localhost . I found a solution on wampserver forum . You can try this :)

****************
****Step1****** -> Create SSL Certificate and Key
****************

1a) Open the DOS command window and change directory to bin directory of wamp apache directory by using the DOS command without quotes: “cd /d c:\” and then “cd wamp\bin\apache\apache2.2.8\bin”. apache2.2.8 should be changed to what apache folder your wamp server has.

After done, the DOS prompt should look like: C:\wamp\bin\apache\apache2.2.8\bin>

1b) Create a server key with 1024 bits encryption. You should enter this command without quotes:
“openssl genrsa -des3 -out server.key 1024″. It’ll ask you a pass phrase, just enter it. ‘
1c) Remove the pass phrase from the RSA private key (while keeping a backup copy of the original file). Enter this command without quotes: “copy server.key server.key.org” and then “openssl rsa -in server.key.org -out server.key”. It’ll ask you the pass phrase, just type it.

1d) Create a self-signed Certificate (X509 structure) with the RSA key you just created. Enter the command without quotes: “openssl req -new -x509 -nodes -sha1 -days 365 -key server.key -out server.crt -config C:\wamp\bin\apache\apache2.2.8\conf\openssl.cnf”.

You’ll fill in the information after entering this command. The correct location of config file, openssl.cnf may need to be changed. In windows, you won’t see “.cnf” extension of the file openssl, but in DOS you’ll see the full name openssl.cnf.

****************
***** Step2***** -> Copy the server.key and server.crt files.
****************

2a) In the conf folder of apache2.2.8 folder, create two folders named as ssl.key and ssl.crt

2b) copy the server.key file to ssl.key folder and server.crt file to ssl.crt

****************
****Step3****** -> Edit the httpd.conf file and php.ini
****************

3a) In httpd.conf file, remove the comment ‘#’ at the line which says: LoadModule ssl_module
modules/mod_ssl.so

3b) In httpd.conf, remove the comment ‘#’ at the line which says: Include
conf/extra/httpd_ssl.conf
Then move that line after this block <IfModule ssl_module>…. </IfModule>

3c) open the php.ini file located in apache2.2….\bin folder, remove the comment ‘;’ at the line
which says: extension=php_openssl.dll

***************
****Step4***** -> Edit the httpd_ssl.conf file in the folder name, extra
***************

4a) Find the line which says “SSLMutex ….” and change it to “SSLMutex default” without quotes

4b) Find the line which says: <VirtualHost _default_:443>. Right after it, change the line which says “DocumentRoot …” to DocumentRoot “C:/wamp/www/” with quotes. Change the line “ErrorLog….” to Errorlog logs/sslerror_log. Change the line “TransferLog ….” to TransferLog logs/sslaccess_log

4c) SSL crt file: Change the line “SSLCertificateFile ….” to SSLCertificateFile “conf/ssl.crt/server.crt”

4d) SSL key file: Change the line “SSLCertificateKeyFile ….” to SSLCertificateKeyFile “conf/ssl.key/server.key”

4e) Change the line which says <Directory “C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin”> or something similar to <Directory “C:/wamp/www/”> and add the following lines inside those <Directory … >…</Directory> tags:

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

4f) Make sure the line CustomLog “logs/ssl_request_log” \
is uncommented (remove the #). This step is suggested by wmorse1.

**************
****Step5**** In the previous DOS Command windows, enter httpd -t . If it displays Sysntax is OK, then
************** go to Step 6. If not, then correct the wrong syntax and redo step 5.

**************
****Step6***** -> Restart the Apache server
***************

**************
****Step7**** -> if restart is successful, then open the browser and enter “https://localhost&#8221; without
************** quotes.

*************************
****Step8 (Optional)**** -> If you want to allow world wide web access to your HTTPS secure server, then
************** ********** in the httpd_ssl.conf file, change the line which says ‘ServerName localhost:443′ to ‘ServerName http://www.yourwebsitename.com:443′; without quotes. yourwebsitename is your registered internet domain name. If you don’t have it, then just use your WAN IP address. For example ‘ServerName 99.238.53.105:443′. Make sure these setups are correct to allow outside access to secured www server.

8.a The DocumentRoot you modified in step 4b points to the correct website folder on your
computer.

8.b If your computer’s connected to the router, setup the router to allow port 443 forwarding to your
computer.

8.c If your computer has a firewall enabled or behind a network firewall, set up the firewall to allow
incoming port 443 connection

And finally

About these ads

Comments on: "HTTPS and SSL Setup Step-by-Step Guide" (26)

  1. Robert Laing said:

    Thanks for the steps! Really helped. Wish someone had an easy tool for this.

    I had to make one change which I found here

    http://www.wampserver.com/phorum/read.php?2,32986,page=1

    “I added a STEP 4F CustomLog “logs/ssl_request.log” \

    Without this STEP 4F I was getting the same error that fdo reported and I took the advice of jdgiotta. If you adjust this portion of the httpd_ssl.conf (very bottom) file it will restart, if you’re getting the Ok in Step 5. “

  2. kishor Ranga said:

    This Material is superb, it helped me drastically. Really I am looking forward more and more solutions on this web.

    Just Great!!!!

    – Kishor Ranga

  3. 9lThank’s for greate post.1x I compleatly disagree with last post . uyo
    паркет 1t

  4. Thank you very much.
    This is really helpful.

  5. this is realy helpful, thanks a lot

  6. this is great useful!!

    Thanks so much,
    have been looking for good tutorial for ages

  7. Thanks for your helpful points

  8. سمير الدبعي said:

    i need to this bute for use easyphp

  9. olmalex said:

    Thanks a lot for useful post. It’s great!

  10. Awesome article you’ve got there. Keep up the good work!

    Ferienparks

  11. Excuse, I have thought and have removed the idea

    [url=http://www.graj24.pl/darmowe-gry_bijatyki.html]gry bijatyki[/url]
    | [url=http://www.graj24.pl]darmowe gry[/url]

  12. Thank you for posting these instructions. Great help!

  13. Work like a charm ! thanks ! great help me test https

  14. dharmesh said:

    i cant enable ssl using these please help me

  15. dharmesh said:

    “http://localhost” and “https://localhost/” both are not working after ssl enable please any suggest

  16. Works perfect! thanks a lot :)

  17. greate article it help me alot. your article is very simple and clear. there many more tutorial on net, but they confuse us. keep it up and thanks again

  18. Thanks………………………………………….

  19. I tried to follow all ur instruction but my wamp server doesnt work!! how can I fix that problem? :D

    thankss!

    Good post anyway!! congratulations!

  20. finally, an ssl tutorial that works. Thanks

  21. Codernizer said:

    You’re the best, worked . Need to mention that I think it’s better to go trough the entire httpd-ssl.conf (on my wamp version the name was with “-” not “_”) and check every path because there are some wrong paths. And check apache logs regulary because if it won’t work you’ll find the reason there.
    again, thanks for the tutorial

  22. Great steps…..Thank you. Robert’s idea worked for me. I had to append “C:/wamp/www/” to “logs/ssl_request.log” \ before apache could work again. Actually, after carrying out all the steps, then I started having troubles restarting apache. But anyways, that did the magic.

    Thank you, thank you…..

  23. For those with a localhost who still get the >… Certificate was issued to a different address …< error message, just recreate the .key and .crt files with different details such as company names (should be "localhost" without quotes) Then copy the files again to the respective folders, restart internet explorer and your server and open localhost on IE, then you will get the error again. Just carry on, double click the red lock to open the certificate and install it. Then restart IE again and you're done. Do this with IE, even if you dont like IE. Thanks folks and hope this helps. I am Portuguese, sorry for the bad English.

  24. ps: You may need to delete your old installed certificate from your system like I did. If so, just run certlm.msc before doing the steps above.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: