Modifying the Configuration File of the Apache Web Server 
The Apache Web server has a central configuration file httpd.conf that contains all configuration information. To configure the Apache Web server for SSL, modify this configuration file.
Then enter the following information into httpd.conf:
Certificate of the Web Server
Enter the path to the files that contain the private key of the Web server, the server certificate, and the root certificate of the CA.
Owner and Issuer of the Client Certificate (TREX Java Client)
The owner and issuer of the certificate that belongs to the Java client. The Web server can authenticate the Java client using this information.
You have made the following files available:
The private key of the Web server (serveru.key)
The server certificate of the Web server that the certification authority (CA) issued (serveru.crt)
The CA root certificate in the form CERTIFICATE_AUTHORITY.crt (ca.crt)
Note
Below, the root certificate of your CA is referred to as ca.crt. Enter the valid root certificate of your CA in all places where ca.crt appears.
Storage Locations for Certificates and Keys
The files are stored in the following directories.
Certificate/Key |
Directory |
|---|---|
serveru.key |
<TREX_DIR>/Apache/conf/ssl.key |
serveru.crt ca.crt |
<TREX_DIR>/Apache/conf/ssl.crt |
serveru.csr |
<TREX_DIR>/Apache/conf/ssl.csr |
You have provided the certificates for the Java client (see Providing the Certificates for the Java Client). The information on the subject name (DN; owner) and issuer name (issuerDN; issuer) of the certificate that belongs to the Java client can be obtained from the SAP NetWeaver Administrator. You then enter the owner and issuer into the configuration file httpd.conf.
Log on with the user that you used to install TREX.
Stop TREX.
Go to the TREX installation directory and then into the configuration directory of the Web server.
cd <TREX_DIR>/Apache/conf
Open the configuration file httpd.conf and enter the information specified in the sections below. Save the configuration file and close the text editor.
Caution
Make a backup copy of the configuration file httpd.conf in case you decide in the future that you no longer want to run the Apache Web server over a secure connection.
Restart TREX.
Search for the instruction SSLCACertificateFile in the httpd.conf configuration file. Enter the path to the file that contains the root certificate of your CA (ca.crt).
Example
SSLCACertificateFile conf/ssl.crt/ca.crt
Search for the instruction SSLCertificateFile. Enter the path to the file that contains the server certificate of your CA (serveru.crt).
Example
SSLCertificateFile conf/ssl.crt/serveru.crt
Search for the instruction SSLCertificateKeyFile Enter the path to the file that contains the private key of your CA (serveru.key).
Example
SSLCertificateKeyFile conf/ssl.key/serveru.key
Note
You may have to remove the comment signs from some entries in the configuration file httpd.conf so that the settings become valid. You do this by deleting the comment signs (#) from each relevant line.
The information on the subject name (DN; owner) and issuer name (issuerDN; issuer) of the client certificate can be obtained from the SAP NetWeaver Administrator.
Start the SAP NetWeaver Administrator.
Navigate to .
The Content: Key Storage Views area displays the keystores and certificates that you already created.
Use filter function to find the TREXKeyStore and select the TREXKeyStore entry.
The Entries: Keystore Entries window displays the parameters of the TREX keystore.
SAP NetWeaver Administrator displays the following information on the subject name (DN; owner) and issuer name (IssuerDN; issuer):
Subject name: CN=myhost.mydomain, OU=mydepartment, O=mycompany, L=mycity, ST=mystate, C=mycountry, EMAIL=myaccount@mydomain
Issuer name: CN=My Certificate Authority (CA), OU=Certificate Center, O=CA Company, L=CA City, ST=CA State, C=CA Country, EMAIL=caaccount@cacompany.com
Copy the specifications for the subject name (DN; owner) and issuer name (issuerDN; issuer) and enter the information in the httpd.conf Apache configuration file.
In the httpd.conf configuration file, search for the line with the second SSLRequire instruction, which is within the tags <Location /TREX> and </Location>. The default httpd.conf configuration file is delivered in the following form:
Syntax
<Location /TREX>
SetHandler trex-handler
# usage of SSLRequire:
# standard apache example:
# SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/# SAP Portal example
# SSLRequire (%{SSL_CLIENT_S_DN} eq "/C=DE/ST=BW/L=Walldorf/O=SAP Portals/OU=TREX/CN=p54896 client/Email=andreas.mustermann@sap.com" and \%{SSL_CLIENT_I_DN} eq "/C=DE/ST=BW/L=Walldorf/O=SAP Portals/OU=TREX/CN=CA TREX/Email=andreas.mustermann@sap.com" )</Location>
Note
Make sure that you use a backslash (\) to divide lines that are too long.
The instruction SSLRequire is commented out by default. To activate it, remove the comment sign (#) from the line SSLRequire.
Enter the subject name (DN; owner) and issuer name (IssuerDN; issuer) of the client certificate there in the following form: SSLRequire (%{SSL_CLIENT_S_DN} eq "<owner [DN]>" and %{SSL_CLIENT_I_DN} eq "< issuer [IssuerDN]>")
Example
(%{SSL_CLIENT_S_DN} eq "/C=DE/ST=Baden Wuerttemberg/L=Walldorf/O=SAP AG/OU=TREX/CN=TREX Java Client/Email=my.account@sap.com" and %{SSL_CLIENT_I_DN} eq "/C=DE/ST=Baden Wuerttemberg/L=Walldorf/O=CA Company/OU=Certificate Center/CN=My Certificate Authority/Email=ca.account@ca-company.com" )
Caution
Note that you have to enter the owner and issuer in two different places in the configuration file httpd.conf. There is a tag <Location / trex> (TREX lowercase) and a tag <Location / TREX> (TREX uppercase).
You have now configured the Apache Web server for secure communication using SSL. You should now change the start mode of the Apache Web server.