Apache - Example to re compile apache with open ssl, Re-Compiling apache with open ssl n SOAP

Example to re compile apache with open ssl

The below is an simple example to recompile apache. Normally apache is installed with some basic modules, here we are re-compiling apache with opwn-ssl and SOAP module, which is normally not installed along with the apache.

Steps to install apache
 # su 

 # wget http://www.eng.lsu.edu/mirrors/apache//httpd/httpd-2.2.17.tar.gz

 # tar -zxvf httpd-2.2.17.tar.gz
Login as root, after that download apache from its website, extract the tar and then compile it with specified modules as below.

  --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs 
  --enable-ftp --enable-mbstring --with-mysql=/usr/local/mysql5 
  --with-mysqli=/usr/local/mysql5/bin/mysql_config --enable-zend-multibyte 
  --with-libxml-dir=/usr/src/libxml2-2.6.26 --with-curl=/usr/src/curl-7.15.4 
  --with-gd --enable-gd-native-ttf --with-ttf 
  --with-freetype-dir=/usr/local/include/freetype2 --with-jpeg-dir 
  --with-png-dir --with-zlib --with-zip=/usr/src/zziplib-0.10.82 
  --with-pdflib=/usr/ --with-gettext --with-pdo-sqlite --enable-pdo 
  --with-mcrypt=/usr/local/bin/mcrypt --enable-soap --with-openssl=shared

 # make

 # make install

Enable SSL in httpd.conf
 # vi /usr/local/apache2/conf/httpd.conf

   Include conf/extra/httpd-ssl.conf
Uncomment the httpd-ssl.conf Include line in the /usr/local/apache2/conf/httpd.conf file. You can find the httpd-ssl in below location. But there is no need to make changes in the file.

 # vi /usr/local/apache2/conf/extra/httpd-ssl.conf

 # egrep 'server.crt|server.key' httpd-ssl.conf

   SSLCertificateFile "/usr/local/apache2/conf/server.crt"
   SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"
The SSL certificate and key are required before we start the Apache. The server.crt and server.key file mentioned in the httpd-ssl.conf needs to be created before we proceed further.

Create server.crt and server.key file
 # openssl genrsa -des3 -out server.key 1024
First, Generate the server.key using openssl. The openssl command will ask for password, Dont forget the password, it is required later.

After creating server.key, then create server.csr from the same file as below.
 # openssl req -new -key server.key -out server.csr

Finally, generate a self signed ssl certificate (server.crt) using the above server.key and server.csr file.
 # openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Copy the server.key and server.crt
 # cd ~

 # cp server.key /usr/local/apache2/conf/

 # cp server.crt /usr/local/apache2/conf/

Now start apache with the password
 # /usr/local/apache2/bin/apachectl configtest

 # /usr/local/apache2/bin/apachectl start
Specify the password or your private-key which our entered earlier. By default Apache SSL runs on 443 port. Open a web browser and verify that you can access your Apache using https://[your-ip-address]

The topic on Apache - Example to re compile apache with open ssl is posted by - Math

Hope you have enjoyed, Apache - Example to re compile apache with open sslThanks for your time

Tech Bluff