Question : how to configure Apache Tomcat server in Linux ?
Question : Step by Step Apache tomcat server configuration ?
IP - 10.20.2.33
Hostname - khandwa.lokesh.com
OS - CentOS 6
PORT - 8080
Tomcat Version - 7
Tomcat, is an open-source web server and servlet container developed by the Apache Software Foundation (ASF).It used for deploying Java Servlet and JSP applications. To deploy any application in Tomcat we can simply create a war file and deploy them
Install Java
1. Install Java in Linux
# yum install java
Check Java Version
# java -verison
here i have java 1.8 verison
2. Download Apache Tomcat archive file from Apache tomcat official download page.
# mkdir /download
# cd /download
# wget http://www.eu.apache.org/dist/tomcat/tomcat-7/v7.0.64/bin/apache-tomcat-7.0.64.tar.gz
3. Extract Tomcat
# tar -zxvf apache-tomcat-7.0.64.tar.gz
Move in to "/usr/local/" directory
# mv apache-tomcat-7.0.64 /usr/local/tomcat7
There are no need to configure , just the start Tomcat service
tomcat run on 8080 default port
Check 8080 Port
# netstat -tulpn | grep :8080
# cd /usr/local/tomcat7/bin/
Output
4. Setup User Account
Edit conf/tomcat-users.xml file in your editor and paste inside
<tomcat-users> </tomcat-users>
<!-- user manager can access only manager section -->
<role rolename="manager-gui" />
<user username="manager" password="password" roles="manager-gui" />
<!-- user admin can access manager and admin section both -->
< role rolename="admin-gui" />
< user username="admin" password="password" roles="manager-gui,admin-gui" />
5. Stop Tomcat
# ./usr/local/tomcat7/bin/shutdown.sh
6. Start Tomcat
# ./usr/local/tomcat7/bin/startup.sh
7. Access Tomcat in Browser
http://10.20.2.33:8080
Server Status after provide user name & password , by clicking on "server status tab"
8Change Tomcat Default Port
open server.xml file in "conf" directory & replace 8080 to 80 ( as you wish ) in Connector port section
# vi /usr/local/tomcat7/conf/server.xml
Put your *.jsp page in webapps direcotory with Project name
Example
webapps -> project folder -> *.jsp pages
Webapps -> Project2 folder-> *.jsp pages