Perform the following tasks to configure the Apache HTTP Server:Documentation Index
Fetch the complete documentation index at: https://docs.futurex.com/llms.txt
Use this file to discover all available pages before exploring further.
- Set FXPKCS11 environment variables.
- Generate a key pair on the CryptoHub by using pkcs11-tool.
- Generate a Certificate Signing Request (CSR) using the Apache Server private key.
- Create a self-signed root certificate authority (CA).
- Sign the Apache Server CSR.
- Configure Apache to use the signed certificate and the private key stored in CryptoHub.
- (Optional) Create a client certificate for the browser that connects to the Apache HTTP Server.
- (Optional) Confirm that Apache uses the TLS certificate and private key stored in CryptoHub for HTTPS connections.
Set environment variables
In a terminal, run the following commands to set the required FXPKCS11 environment variables:Text
Generate a key pair
Perform the following steps to generate a key pair:In a terminal, run the following command to create a new key pair on the CryptoHub by using pkcs11-tool:
Text
At the time of writing, there is a bug in Apache that prevents RSA certificates from being served correctly to the browser. Until the bug is fixed, create and use an ECC certificate as demonstrated.
Enter the identity password configured inside the
<CRYPTO-OPR-PASS> tag in the fxpkcs11.cfg file when prompted for the** User PIN**.If the command succeeds, the keys display in the output, as shown in the following example:This process creates one private ECC 256-bit key with asymmetric sign usage and one public ECC 256-bit key with verify usage.
None
Generate a CSR
Before completing the remaining steps in this section, create a directory to store the TLS certificates that will be created, then navigate to that directory.
Text
The common name of the Apache server certificate should match the domain name of the virtual host it is configured for.
Create a CA
This example uses a self-signed root certificate authority (CA). In a production environment, you should use a secure certificate authority (such as the CryptoHub) for all private key generation and certificate signing operations.
Text
Sign the Apache Server CSR
In a terminal, run the following command to issue a signed Apache Server certificate by using the self-signed root CA created in the previous step:Text
Configure Apache
This section covers modifying the configuration file for a virtual host running in Apache. Configuring a virtual host is outside the scope of this guide. Refer to this article for your operating system if you have not configured a virtual host. Perform the following steps to configure Apache to use the signed certificate and the private key stored in CryptoHub:In a text editor, open the configuration file for the virtual host for which you want to configure HTTPS and modify it as shown in the following example:
The location of the configuration file is specific to your system.
Text
You must modify the location of the signed Apache certificate specified in the
SSLCertificateFile define according to where you stored it on your system.The object name of the Apache private key specified in the
SSLCertificateKeyFile define must match the label that you set in the pkcs11-tool command.(Optional) Create a client certificate
This step is required only if you want to use mutual authentication.
(Optional) Confirm Apache configuration
If you did not create a client certificate for mutual authentication in the previous section, skip this step.
The following steps assume you are using a Firefox web browser. There might be some differences in the actions taken when using a different browser, but the overall intent of the process is the same.
Under the Your Certificates tab, select [ Import ] to import the client certificate converted to PKCS #12 (
ssl-client-pkcs12.p12).Under the Authorities tab, select [ Import ] to import the CA certificate (such as
ssl-ca-cert.pem).Go to the IP address from which Apache is running over HTTPS.
If a client certificate was configured in the browser for mutual authentication, you should see a lock icon next to the web address. If you did not configure a client certificate, bypass the warning and connect to the website.

