Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

IUC – 3iAc – Cs2i 3 Travaux pratiques administration et hébergement web

I. Configuration SSL HTTPS sur apache


One of the most commonly used Web servers, the Apache Hypertext Transport Protocol Server was
first released to the public in 1995. The Apache Project has evolved over the years, but it remains
devoted to remaining free -- great news for any business looking to establish a Web server. With a
little time and the right commands, your business can host its own website and set up OpenSSL for
secure communications using the Secure Sockets Layer technology for encrypted transactions over
the Web.

1. Problems with openssl.cnf


Browse to your Apache conf directory, "C:\wamp64\bin\apache\apache2.4.46\conf\" and check the
openssl.cnf file. Substitute the correct version number for "." Windows may have reassociated the
.cnf extension with Notepad++ or another program.

 Go to "Control Panel," then "Folder Options."


 Click on the "File Types" tab and browse down the list to the .cnf association.
 Click on "Change..." to associate the file with Notepad or another text editor.
2. Keys and Configuration
 Open a command prompt. Press the Windows key and "R" simultaneously to bring up the
"Run" dialog box. Type "cmd" in the text box and press "Enter" to launch the Windows
command prompt.
 Type "cd C:\wamp64\bin\apache\apache2.4.46\bin" at the command prompt,
substituting the version number for "," to browse to the bin directory.
 Type "set OPENSSL_CONF=C:\wamp64\bin\apache\apache2.4.46\conf\openssl.cnf" to
define the location of the openssl.cnf file. You may need to adjust the command to
match it to your individual server installation.
 Type 'openssl req -config "C:\wamp64\bin\apache\apache2.4.462.2\conf\openssl.cnf" -
new -out default_web_site.csr -keyout default_web_site.pem' and follow the prompts to
create your certificate. The PEM pass phrase is your private key password; write it down
and keep it in a secure location. Note that the command creates keys in the terminal's
current working directory, which should be /bin.
 Type "openssl rsa -in default_web_site.pem -out default_web_site.key" to create an
unprotected key for the Apache server.
 Type "openssl x509 -in default_web_site.csr -out default_web_site.cert -req -signkey
default_web_site.key -days 365" to generate the x509 certificate.
 Check through your httpd.conf file, by default in
"C:\wamp64\bin\apache\apache2.4.46\conf\" and remove the hash (#) tags on the
following lines:
o LoadModule ssl_module modules/mod_ssl.so
o Include conf/extra/httpd-ssl.conf
 Open the httpd-ssl.conf file in "C:\wamp64\bin\apache\apache2.4.46\conf\extra\" and
update these settings to fit your install:
o VirtualHost default:443
o SSLCertificateFile
o SSLCertificateKeyFile
 Restart the Apache server. You can test your configuration by navigating to
"https://localhost/" in your Web browser.

Enseignant : Willy-joel TCHANA

You might also like