Showing posts with label apache configuration. Show all posts
Showing posts with label apache configuration. Show all posts

Monday, December 17, 2012

Apache webserver install on Linux


Apache Webserver install on linux ( Httpd )

APACHE – WEBSERVER

The Apache HTTP Server, commonly referred to as Apache is web serversoftware notable for playing a key role in the initial growth of the World Wide Web. In 2009 it became the first web server software to surpass the 100 million web site milestone. The majority of web servers using Apache run a Linux operating system.

Apache is primarily used to serve both static content and dynamic Web pages on the World Wide Web. Many web applications are designed expecting the environment and features that Apache provides.

Current Apache webserver : APACHE 2.2.14 / Release on : October 5, 2009

APACHE Httpd installation on Solaris :

1. Download the file httpd-2.2.14.tar.gz from the link :http://httpd.apache.org/

2. Unzip using command gzip –d httpd-2.2.14.tar.gz

3. UnTar the Existing file using the command tar -xvf httpd-2.2.14.tar

4. After untaring you have to go to the httpd folder cd httpd-2.2.14

5. Configure by using command which enables all the proxy modules
./configure –prefix=/opt/apache22 –enable-proxy –enable-proxy-ajp –enable-proxy-balancer –enable-proxy-http

6. If you get a gcc and make not found error, then find whether GCC is available or not by typing
echo gcc or gcc –v
echo make

if you did not find the gcc then go to the root and find the path for gcc using below command

find . -name gcc and find . –name make

after finding the path get back to httpd-2.2.14 dir and add the path,

for gcc export PATH=$PATH:/usr/sfw/bin
for make export PATH=$PATH:/usr/ccs/bin

and now you can configure
After configuring type the command make

7. After make the type the command make install

8. Installation is completed. Now operate the apache . To start the apache go to the bin folder cd /opt/apache22/bin
Type ./apachectl start (stop/restart)

If you have the problem with the ports then change the port numbers in httpd.conf file, after changing the port restart the apache

Most of us had a general error ” server not found”.
To fix this open main configuration file with vi editor and un comment the line “server name pc name com:80″

Now try again and restart the apache.
Now goto webbrowser and type http://localhost/ If the page displays IT WORKS then the apache is working perfectly.

Mod_jk connector to connect Webserver & Appserver


Mod_Jk Connector to connect web server(Apache) to application server (Tomcat)
Mod_jk is used to connect apache webserver with tomcat application server

Download the mod_jk connector from

Extract the file using below command
tar -xzvf apache-tomcat-6.0.18.tar.gz

Add the path of apxs to the env $PATH by
export PATH=$PATH:/home/subha/apps/webserver/httpd-2.2.11/bin/apxs

Go to this folder
cd tomcat-connectors-1.2.27-src/native
./configure  –with-apxs=/home/subha/apps/webserver/httpd-2.2.11/bin/apxs
make
make install (assuming the user is root)

Copy the file mod_jk.so to httpd-2.2.11/modules/ (if not already present)
-   vi /httpd-2.2.11/conf/workers.properties

Paste the following output into the file:
.tomcat_home=/home/subha/apps/appserver/apache-tomcat-6.0.18
workers.java_home=/usr/bin/java
ps=/
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=worker1

-   vi httpd.conf
-   Append the following to httpd.conf
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /home/subha/apps/webserver/httpd-2.2.11/conf/workers.properties
JkLogFile /home/subha/apps/appserver/apache-tomcat- 6.0.18/logs/mod_jk.log
JkLogLevel debug
JkMount /sample/* worker1
JkMount /sample1/* worker1
JkMount /servlet/* worker1
JkMount /*.jsp worker1
-   Test by http://localhost/sample/