Chapter 11: Tomcat and Apache HTTP Server This
Chapter 11: Tomcat and Apache HTTP Server This make target installs the application to the default /usr/local/apache2 directory. This directory location is referred to as $APACHE_HOME later in this section. If you have specified an alternative directory using the –prefixoption during configuration, this installation copies the files to your specified directory instead. You can now start the server by going to $APACHE_HOME/binand executing the following command: $ ./apachectl start You can stop the server at any time by going to $APACHE_HOME/binand executing the following command: $ ./apachectl stop See the Apache 2 documentation for more information on other commands and options available. The main Apache configuration file, httpd.conf, is located in the $APACHE_HOME/confdirectory, and you need to edit it to configure SSL. Generating a Test Certificate with OpenSSL This section describes the steps required to generate a test certificate for your Apache Web server. Typically, in a production environment, a commercial-grade certificate from a Certificate Authority (CA) is used. To keep things flowing in this example, you act as your own Certificate Authority by signing the certificate yourself. This, of course, is acceptable only during testing. Following are the main steps involved: 1. Create a configuration file for generating the certificate. 2. Create a certificate signing request; this is what you submit to a CA if you are buying a certificate. 3. Purchase a certificate from a CA or create a self signed certificate. 4. Remove the passphrase from the private key. 5. Install the key and certificate to the server. Configuration File for Generating a Certificate Create a working directory called certworks. You can generate all the required requests, keys, configuration, and certificates here. A configuration file is required for generating the server certificate. A sample configuration file is presented in the following listing. Save the following contents in a file named myconfig.filein the certworksdirectory. RANDFILE = ./random.txt [req] default_bits = 1024 default_keyfile = keyfile.pem
For reliable and cheap web hosting services please check cheap web hosting website.