Xampp web server, apache Integration with tomcat apache using Proxypass and Proxypassreverse

Xampp web server, apache integration with tomcat apache using Proxypass and Proxypassreverse.

Following apache modules required to load in httpd.conf file.

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

LoadModule proxy_http_module modules/mod_proxy_http.so

Tomcat : Java servlet engine.

Tomcat Apache is an open source application server written in Java, The default port for  Java base application server is 8080 and apache 80.

In order to integrate apache as front end and application server as backend, required proxy module or mod_jk connector.

In our example, we are configuring Tomcat Apache  using proxy gateway between Apache and Apache Tomcat application server as part of installation and configuration.

Proxy : ProxyPass and ProxyPassRevers(proxy_module modules/mod_proxy.so).

A proxy module redirects the request received on port 80 to 8080 internally, which will not be visible to users.

Apache  Tomcat   installation and configuration guide has prepared for following platform and services.

Operating System                : Windows 7

Webserver                       :apache

Application Server              : apache-tomcat (bundled in xampp php stack)

Domain                          :                                    demo.com

Aapache Tomcat  server IP       : 192.168.1.9

Scope        : Apache integration with Apache  Tomcat using (mod_proxy)

Dependencies:

Packages      : xampp which includes(mysql server apache , ftp & tomcat apache) & JDK / JRE

Services and associate port numbers

apache port        : 80

mysql port         :3306

ftp                :21

apache tomcat      :8080

Tomcat Apache configuration Steps :

Step 1 : Download and install XAMPP server

Step 2 : Apache tomcat configuration

Step 3 : Verify configuration

Let us the steps in Details :

Step 1 : Download and install XAMPP server

1.1 Download latest version of XAMPP server software package from following URL .

http://citylan.dl.sourceforge.net/project/xampp/XAMPP%20Windows/1.8.2/xampp-win32-1.8.2-5-VC9-installer.exe

1.2 Install as administrator xampp-win32-1.8.2-5-VC9-installer.exe .

With our guide we are going to install XAMPP in c:\ Drive (C:\xampp), installation location can be changed while installing it.

1.3 Download, Install JDK and Set environment variables (JAVA_HOME and PATH).

Download location

Set Environment variable

Start -> Computer -> Property ->Advance System Settings ->Advance -> Environment Variables.

User variables : -JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_21\

System variables: Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Lenovo Fingerprint Reader\;JAVA_HOME%\bin;%CATALINA_HOME%\bin;

Step 2 : Apache tomcat configuration

2.1 Enable mod_proxy apache module in httpd.conf (C:\xampp\apache\conf\)

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

LoadModule proxy_http_module modules/mod_proxy_http.so

2.2 Modify Apache configuration (httpd.conf) to enable proxy module and define  ProxyPass and ProxyPassReverse container.

“C:\xampp\apache\conf\extra\httpd-vhosts.conf”

Note : for virtual host configuration refer :http://www.youtube.com/watch?v=M5266aZiDNs

<VirtualHost *:80>

ServerAdmin postmaster@demo.com

DocumentRoot “c:\xampp\htdocs\demo.com”

ServerName demo.com

ServerAlias www.demo.com

ErrorLog “logs/demo.com-error.log”

CustomLog “logs/demo.com.log” combined

<Location /agilefant>

ProxyPass    http://www.demo.com:8080/agilefant

ProxyPassReverse  http://www.demo.com:8080/agilefant

Order Allow,Deny

Allow from all

</Location>

<Location /example>

ProxyPass    http://www.demo.com:8080/agilefant

ProxyPassReverse  http://www.demo.com:8080/agilefant

Order Allow,Deny

Allow from all

</Location>

</VirtualHost>

Save & Exit!

Start / Restart Apache , mysql & tomcat apache

2.3 In our example we are going to configure agile fant java based application on tomcat apache as configured in step 2.2

download agilefant from following location

http://sourceforge.net/projects/agilefant/files/latest/download

copy agilefant-3.5.2.zip to C:\xampp\tomcat\D:\xampp\tomcat\webapps\

Extract agilefant-3.5.2.zip .

2.4 Login to mysql with root access

C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql.exe

Create database for agilefant instance and create the permission required for agilefant instance.

mysql> create database agilefant;

mysql> grant all on agilefant.* to agilefant@localhost identified by “agilefant”;

or

Invoke this URL:  http://localhost/phpmyadmin

2.5 Create a DNS record of demo.com and demo.com in order to  point it webserver IP. Or else you can use the hosts file located in Windows\System32\dirvers\etc\hosts.

Add below host entries to map IP to hostname / domain name.

Note : make sure to open hosts file as administrator otherwise changes made in can’t be saved due to permissions

192.168.1.9 demo.com

192.168.1.9 www.demo.com

Save & Exit!

Step 3 : Verify configuration

3.1  Launch a command prompt and execute ping www.demo.com and demo.com

Invoke the URL www.demo.com:8080 to confirm apache tomcat service has started

3.2 Launch the URL www.demo.com/agilefant and www.demo.com/example

Thanks for Watching.

For more Details you can watch Video and subscribe for more Videos :

Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk