Suraj chhetry

Small Programming help

  • Top Posts

    • None

Tomcat-Apache Integration(Php and Java supported Web Server)

Posted by surajchhetry on November 4, 2008

1. Download zip version of apache from http://www.apachefriends.org/en/xampp-windows.ht
2. Also download tomcat apache tomcat add-ons from http://www.apachefriends.org/en/xampp-windows.html#644
3. Unzip apache any location example c:\xampp
4. Also unzip tomcat add-ons on the same directory(c:\xampp). While doing so it will ask for replace existing one .Press “Yes”.
5. Goto xampp folder and run the batch file setup_xampp.bat
6. Open readme-addon-tomcat.txt file which is present in Your_Xampp_Folder(eg c:\xammp)
7. Search “Tomcat Doc Root” on that file. You will see as below
“Tomcat Doc Root = .\xampp\tomcat\webapps”
8. Copy only tomcat location i.e “\tomcat\webapps”.
9. Now open apache configuration file which you can find at apache/conf/httpd.conf
10. Search for DocumentRoot Tab DocumentRoot “C:/xampp/htdocs” Modify the DocumentRoot as         DocumentRoot “C:/xampp/tomcat/webapps”
11. Search and pest above DocumentRoot path it will looks like
12. Add two line any where( not in directory tab ) below ServerName localhost:80

ServerSignature Off
ServerTokens Prod

This two lines preventing the server to any show kind of version information and security policy.
13. Add –Indexes to tab “Directory” tab as

Options FollowSymLinks -Indexes

And “Directory “C:\xampp\tomcat\webapps”

Options – Indexes

14. Save and exit.
15. Run xampp control(xampp-control.exe) from c:\xampp
16. Try to run Mysql and Apache If it runs then configuration is okay upto now.
17. Goto htdocs folder which is on Your_Apache_Folder(c:\htdocs)
18. Copy xampp folder and pest it to Your_Apache_Folder /tomcat/webapp directory
19. Open a browser and type address http://localhost/xampp
20. You will see welcome screen of Xampp choose your language
21. Click on security
22. You will see unsecure status for PhpMyadmin,Admin root
Click on http://localhost/security/xamppsecurity.php
23. Setup password for mysql and click “Password changing”
Setup password for xampp and click “Make safe the xampp directory”
24. Go back to Security this time you will see a window which will ask for username password give your xampp username and password
25. Now you will see status is changed to secure.
26. You will see a message that Php is running on safe mode.
Stop Apache and Mysql from xampp-control
27.Open apache/bin/php.ini
Search safe_mode.By default it is Off change it to on and save that.
28.Restart the server.goto http://localhost/xampp.click on Security now everything is secure.
29.Now copy xmapp from htdocs and pest it to tomcat/webapp/xampp for security to take effect
Stop the server.
30. Open apache/conf/extra/ mod_jk.conf
Now add the fllowing line in mod_jk.Where “helloworld” is your j2ee project and present in tomcat/webapp.
jkMount /helloworld/* ajp13
31. Start tomcat by executing tomcat_start.bat
32. Start apach.Goto web browser and type http://localhost/helloword/index.jsp

Now Enjoy Tomcat-Apache .

Posted in Tomcat | Tagged: , | Leave a Comment »