Step one: Install Apache, enable it to support SSL, and install PHP
1. Install the apache,apache_2.2.8-win32-x86-openssl-0.9.8g with SSL module
2. Configure Apache to support SSL:
1) Open the Apache configuration file conf/httpd.conf
LoadModule Ssl_module modules/mod_ssl.soinclude conf/extra/httpd-ssl.conf
Remove the previous # of two lines
2) Note Modify the two fields in the httpd-ssl.conf file:
Sslcertificatefile "C:/APACHE2.2/CONF/SERVER.CRT" Sslcertificatekeyfile "C:/apache2.2/conf/server.key"
3. Install PHP, integrate Apache and PHP (slightly)
Step two: Generate certificate and private key file for website server
1. Generate the private key of the server
Go to the command line:
D:\local\apache2\bin\openssl Genrsa-out Server.key 1024
A Server.key generated sign-up request is generated in the current directory
2. Generate a sign-up request
D:\local\apache2\bin>openssl req-new–out Server.csr-key server.key-config. \conf\openssl.cnf
The signature file SERVER.CSR is generated at this time.
Possible error: Unable to locate ordinal xxx in dynamic link library libeay32.dll, workaround: Copy the Libeay32.dll file under Apache's Bin directory to C:\Windows\System32.
Step three: Sign the certificate for the Web server through the CA
1. Generate the CA private key
D:\local\apache2\bin\openssl Genrsa-out Ca.key 1024
Multiple out of Ca.key files
2. Using the CA's private key to generate the CA's self-signed certificate
D:\local\apache2\bin\openssl req-new-x509-days 365-key ca.key-out ca.crt-config. \conf\openssl.cnf
At this point, you need to enter some information, note common name for the server domain name, if it is native, the native IP.
3.CA signing a certificate for the Web server
D:\local\apache2\bin\openssl ca-in server.csr-out server.crt-cert ca.crt-keyfile ca.key-config. \conf\openssl.cnf
But at this time will be error, so in the current directory to create Democa, which created the following files, index.txt,serial:serial content of 01, the other is empty, and the folder Newcert. Execute again to generate SERVER.CRT file
Step four: Copy the Server.crt,server.key to Apache's conf folder and restart Apache
Step Five: Configure Windows
Open the Etc file under C:\WINDOWS\system32\drivers\etc:
Modified to:
127.0.0.1 localhost127.0.0.1 www.10000ja.net
Step Six:
Create a site under Apache. Access
Https://www.10000ja.net
This article from the "Gamma Blog" blog, declined to reprint!