2. Add certificate and enable https
Add a SSL certificate to your Apache Web server reverse proxy.
Scenario
Section titled “Scenario”Configure HTTPS for the connection from clients to Apache. Step 3 configures the separate connection from Apache to each Fortified ID backend.
Prerequisite
Section titled “Prerequisite”Complete Install on Windows and verify that the Apache service responds locally. Confirm that the hostname clients will use resolves to the reverse proxy from their network.
Create a certificate to use for https communication
Section titled “Create a certificate to use for https communication”Obtain a PEM server certificate that covers the proxy hostname and is trusted by the intended clients. Store the private key where the Apache service account can read it and restrict access to authorized accounts.
The examples use proxy.example.com and files in C:\Apache24\conf\extra\certificates. Substitute your own hostname and certificate paths.
Enable HTTPD-SSL configuration
Section titled “Enable HTTPD-SSL configuration”You enable httpd-ssl configuration by including the configuration file in httpd.conf file. That file will include configuration for https (443).
-
Open file httpd.conf C:\Apache24\conf
-
Locate following lines and remove comment for httpd-ssl.conf.
Correct configuration should look like follows:# Secure (SSL/TLS) connectionsInclude conf/extra/httpd-ssl.conf -
Save file httpd.conf
Add references to your certificate
Section titled “Add references to your certificate”Open C:\Apache24\conf\extra\httpd-ssl.conf. In the HTTPS virtual host, set SSLCertificateFile to your server certificate PEM, including any required intermediates in leaf-first order. Set SSLCertificateKeyFile to the matching private key and ServerName to the hostname clients use. Save the file.
ServerName proxy.example.com:443SSLCertificateFile "C:\Apache24\conf\extra\certificates\proxy.example.com-crt.pem"SSLCertificateKeyFile "C:\Apache24\conf\extra\certificates\proxy.example.com-key.pem"See the Apache certificate directive reference for the PEM chain format.
Add mandatory modules for https
Section titled “Add mandatory modules for https”Enable TLS and HTTP reverse proxy support for the example. The shared-memory cache module supports the TLS session cache in the example configuration.
- Open the file httpd.conf (located in /conf/ folder)
- Find and enable following modules. You enable by removing the # character.
- LoadModule proxy_module modules/mod_proxy.so
- LoadModule proxy_http_module modules/mod_proxy_http.so
- LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
- LoadModule ssl_module modules/mod_ssl.so
- Save httpd.conf
Enable https protocol
Section titled “Enable https protocol”-
Open the file httpd-ssl.conf (located in /conf/extra/ folder)
-
Locate Listen 443
-
Remove # in front of listen, result should look like:
Listen 443 -
Save httpd-ssl.conf
-
From
C:\Apache24\bin, run the Windows service configuration test in PowerShell. Use your installed service name if it differs.Terminal window .\httpd.exe -n "Apache HTTP Server" -t -
After
Syntax OK, start or restart the Apache service.
Verify https
Section titled “Verify https”- Open a browser
- Open your reverse proxy URL, for example
https://proxy.example.com/. Replaceproxy.example.comwith the hostname on your certificate. - Confirm that the browser accepts the certificate and shows the Apache landing page in the example setup. If the connection fails, check DNS, the listener on port 443, the firewall, and the Apache error log.
Disable http (optional)
Section titled “Disable http (optional)”Check that port 80 is free of dependencies such as redirects, certificate validation, and other sites before disabling its listener.
- Open the file httpd.conf (located in /conf/ folder)
- Locate Listen 80
- Put a # in front of listen, result should look like:
#Listen 80 - Save httpd.conf
- Run the service configuration test again, then restart Apache if it reports
Syntax OK. Verify that HTTPS still responds and that port 80 is no longer served by this instance.
Next step
Section titled “Next step”After HTTPS works at the proxy hostname, continue with Configure the Fortified ID virtual host.