Install Tomcat
These instructions will explain How to install Tomcat and configuring the web server to act as a proxy server to redirect port 8080 traffic to port 80:
If the following packages are not installed, install them:
- yum install tomcat6
- yum install java-1.6.0-openjdk
- yum install httpd
How to check if they are installed or not:
- rpm -qa |grep
Start the tomcat6 service:
- /etc/init.d/tomcat6 start
Now Make this service to be run after restarting the Linux box as well by doing chkconfig:
- chkconfig tomcat6 on
- chkconfig --list tomcat6
tomcat6 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Now access the tomcat home page using below URL:
- http://localhost:8080
Create a sample test page
Create a directory called dev in the tomcat’s webapps folder
- mkdir /var/lib/tomcat6/webapps/dev
Create a test page in the dev directory
- vim /var/lib/tomcat6/webapps/dev/test.html
- Welcome to sample test page
- Save and exit.
Now access the test page using below URL:
- http://localhost:8080/dev/test.html
If you want to access/see the directory listing from dev directory using a browser, Then we need to enable the listings in the web.xml file
Open the web.xml file and change(/etc/tomcat6/web.xml)
<param-name>listings</param-name>
<param-value>false</param-value>
To
<param-name>listings</param-name>
<param-value>true</param-value>
Note: You can place all your required content in the webapps/dev directory and access them using http://localhost:8080/dev
<param-value>false</param-value>