Apache:Httpd:SSL
lastmod 2025-02-14created 2017-01-032 edits
When installing httpd, the OpenSSL module must be added. This is required to use the https security protocol.
How to generate an OpenSSL private key
- Go to the httpd root directory.
- Run
/bin/openssl.exe. - Check that the command line switches to
OpenSSL>. - Generate the private key to use for encryption.
req -config ..\conf\openssl.cnf -new -out mydomain.csr - Enter the private key password.
- Enter the country code.
Country Name (2 letter code) [AU]:KO - Enter the other information.
- Check that the following files are created.
/bin/.rnd/bin/privkey.pem/bin/mydomain.csr - Set up the public key that Apache will use.
rsa -in privkey.pem -out mydomain.key - Enter the private key password entered above again.
- Configure the certificate.
req -config ..\conf\openssl.cnf -new -x509 -days 365 -key mydomain.key -out mydomain.crt - Enter the country code.
Country Name (2 letter code) [AU]:KO - Enter the other information.
- Check that the following files are created.
/bin/mydomain.crt,/bin/mydomain.key - Done (exit).
OpenSSL> exit
The other information above can be entered as below (it can also be left blank).
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:BLACKHOLE
Organizational Unit Name (eg, section) []:mydomain.com
Common Name (eg, YOUR name) []:mydomain.com
Email Address []:[email protected]
How to use OpenSSL
The following module must be loaded. (Default setting when installed together with OpenSSL)
LoadModule ssl_module modules/mod_ssl.so
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Add OpenSSL validation.
Specify the HTTPS virtual host. (Default port 443)
Turn on OpenSSL. (The OpenSSL security key must be used.)
SSLEngine on
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
SSLCertificateFile "conf/openssl/mydomain.crt"
SSLCertificateKeyFile "conf/openssl/mydomain.key"