Thursday, December 22, 2011

SSL Configuration for Apache 2.2.15-5 in Redhat EL6 64 bit


Stage 1:

1) Create a self signed certificate by using openssl command

#mkdir -p /etc/httpd/conf/ssl

#cd /etc/httpd/conf/ssl

#openssl req -new -x509 -days 365 -sha1 -newkey rsa:1024 -nodes -keyout server.key -out server.crt  -subj '/O=Company/OU=Department/CN=vhost'

2) create seprate directory for ssl access

#mkdir /www/ssl

3) create index.html file in side /www/ssl folder with the below contend .

<html>
<body>
<h3> i am ssl </h3>
</body>
</html>


Stage 2 : SSL configuration on apache httpd.conf file

1) Add the below line to Load the mod_ssl module for ssl configuration in httpd.conf file .

LoadModule ssl_module modules/mod_ssl.so

tip : rename the default configuration file other wise httpd take the default ssl configuration file .
#mv /etc/httpd/conf.d/ssl.conf  /etc/httpd/conf.d/ssl_bk

2) copy the mod_ssl.so file in to the modules directory.

#cp mod_ssl.so /etc/httpd/modules

3) Add the below line to Enable the ssl port "443" in apache configuration file httpd.conf

Listen 443

4)add the virtualhost entry to enable the virtual host for ssl communication in httpd.conf

 NameVirtualHost *:443

<VirtualHost *:443>

    DocumentRoot "/www/ssl"

    SSLEngine on
    SSLOptions +StrictRequire

    <Directory />
        SSLRequireSSL
    </Directory>

    SSLCertificateFile    /etc/httpd/conf/ssl/server.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl/server.key

    SSLVerifyClient none
    SSLProxyEngine off

</VirtualHost>

5) check the virtual configuration in httpd.conf file syntax

#service httpd configtest

6)start the httpd service


#service httpd start

7)check the ssl port "443" enabled in system

# netstat -vatn |grep 443

8) Access the ssl url in the browse

https://localhost -> you will get the ssl page .

Wednesday, December 21, 2011

Apache 2.2.15-5 virtual host configuration on linux machine

Step 1 : create the following  directories
 
 mkdir -p /www/docs
 mkdir -p /www/docs/site
 mkdir -p /www/docs/vhost

Step 2: add the virtual host name into the host file 

vi /etc/hosts
127.0.0.1 localhost     localdomain
127.0.0.1 vhost     vdomain


Step 3: Enable the port listening  /etc/httpd/conf/httpd.conf file


Listen 80 // default server port
Listen 8080 //another port




Step 4: Enable the Name based virtual port

NameVirtualHost *:80      // Default port for  vitual host
NameVirtualHost *:8080   //  Additional port for virtual Host


Step 5: Virtual host Directory Entry

# Default port custom document path
<VirtualHost *:80>
    ServerName virtualhost
    DocumentRoot /www/docs
    <Directory /www/docs>
    Options Indexes FollowSymLinks
    </Directory>
</VirtualHost>
#Additional port with custom Document Path
<VirtualHost *:8080>
    DocumentRoot /www/docs/site
    ServerName virtualhost
    <Directory /www/docs/site>
    Options Indexes FollowSymLinks
   </Directory>
</VirtualHost>
#Additional hostname with custom document path
<VirtualHost *:80>
    ServerName vhost
    DocumentRoot /www/docs/vhost
</VirtualHost>

Step 6: configuration verification

#service httpd configtest

[root@localhost vhost]# service httpd configtest
Syntax OK

Step 7 : start the httpd server

#service httpd start

Step 8: browse the virtual host

default port
#links http://localhost 
additional port
#links http://localhost:8080
additional virtual name
#links http://vhost


Step 9 : check the port listinng 

#netstat -vatn












Wednesday, August 31, 2011

apache server weblogic plug in configuration


LoadModule weblogic_module modules/mod_wl_22.so



<IfModule mod_weblogic.c>
    WebLogicCluster 127.0.0.1:7002,127.0.0.1:7003
    MatchExpression /*
</IfModule>
<Location /weblogic>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7002,127.0.0.1:7003
    PathTrim /weblogic
</Location>