Вы находитесь на странице: 1из 1

How to setup https on apache (windows 64bit)

1. Open a command prompt (WindowsKey + R > cmd > click OK) and enter the following commands.
cd c:\wamp64\bin\apache\apache2.4.27\bin
openssl genrsa -aes256 -out private.key 2048
openssl rsa -in private.key -out private.key
openssl req -new -x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500 -config
c:\wamp64\bin\apache\apache2.4.27\conf\openssl.cnf

Note: You can pretty much answer the questions any way you want though real answers are best. The one
question that really matters here is the FQDN. It should be: localhost.

2. Move the private.key and certificate.crt files from c:\wamp64\bin\apache\apache2.4.27\bin to the


c:\wamp64\bin\apache\apache2.4.27\conf\key\ folder. If the key folder doesn't already exist, create it.

3. Using a text editor like Notepad, open c:\wamp64\bin\apache\apache2.4.27\conf\httpd.conf and un-


comment following 3 lines:
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

4. Using a text editor like Notepad, open c:\wamp64\bin\apache\apache2.4.27\conf\extra\httpd-ssl.conf


and apply the following changes:
Below the line: <VirtualHost _default_:443>, check the following parameters to ensure they are config-
ured correctly and not commented.
-------------------------------------
DocumentRoot "c:/wamp64/www"
ServerName localhost:443
ServerAdmin admin@example.com
SSLSessionCache "shmcb:c:/wamp64/bin/apache/apache2.4.27/logs/ssl_scache(512000)"
ErrorLog "c:/wamp64/bin/apache/apache2.4.27/logs/error.log"
TransferLog "c:/wamp64/bin/apache/apache2.4.27/logs/access.log"
SSLCertificateFile "c:/wamp64/bin/apache/apache2.4.27/conf/key/certificate.crt"
SSLCertificateKeyFile "c:/wamp64/bin/apache/apache2.4.27/conf/key/private.key"
-------------------------------------
5. Save the file and close it.

6. You are done. To check the validity of file, at the command prompt, enter:

c:\wamp64\bin\apache\apache2.4.27\bin\httpd -t and then use your web browse to go to


https://localhost/

From this point on, you should be able to start, stop and restart Wamp Server and SSL-HTTPS will continue to
work.

Вам также может понравиться