Skip to content

Instantly share code, notes, and snippets.

@Anime4000
Last active September 7, 2018 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anime4000/bec913285c1f689ecb7ded420abe2e57 to your computer and use it in GitHub Desktop.
Save Anime4000/bec913285c1f689ecb7ded420abe2e57 to your computer and use it in GitHub Desktop.
Get WampServer a HTTPS

Create a certificate

Just like create OpenVPN certificate

Copy newly created certificate

  • Create a cert folder at: C:\wamp64\bin\apache\apache2.4.33\conf
  • Copy certificate.crt and private.key to C:\wamp64\bin\apache\apache2.4.33\conf\cert

Edit httpd.conf

  • Location: C:\wamp64\bin\apache\apache2.4.33\conf\httpd.conf
  • Uncomment # each this line
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

Edit httpd-ssl.conf

  • Location: C:\wamp64\bin\apache\apache2.4.33\conf\extra\httpd-ssl.conf
  • Find <VirtualHost _default_:443>
  • Edit as follow
DocumentRoot "c:/wamp64/www"
ServerName localhost:443
ServerAdmin admin@localhost
ErrorLog "c:/wamp64/bin/apache/apache2.4.33/logs/error.log"
TransferLog "c:/wamp64/bin/apache/apache2.4.33/logs/access.log"

SSLCertificateFile "c:/wamp64/bin/apache/apache2.4.33/conf/cert/certificate.crt"

SSLCertificateKeyFile "c:/wamp64/bin/apache/apache2.4.33/conf/cert/private.key"

CustomLog "c:/wamp64/bin/apache/apache2.4.33/logs/ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

Restart WampServer

To check Apache status, type:

C:\wamp64\bin\apache\apache2.4.33\bin\httpd -t

Extra

You can use other port than 443, as example 4433

Edit httpd-ssl.conf

  • Location: C:\wamp64\bin\apache\apache2.4.33\conf\extra\httpd-ssl.conf
  • Find Listen 443 replace with Listen 4433
  • Find <VirtualHost _default_:443> replace with <VirtualHost _default_:4433>
  • Find ServerName localhost:443 replace with ServerName localhost:4433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment