Install and deploy tomcat on linux
- You must have java environment.
1. Download tomcat.Tomcat Homepage
2. Install and config tomcat:
1 | $ unzip apache-tomcat-6.0.30.zip |
- Then connect tomcat with ‘http://localhost:8080'
3. Config ‘tomcat-users.xml’
You can config tomcat user permission and pass by add lines to conf/tomcat-users.xml
in , this setup make user has total permission:1
2
3
4
5
6
7<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="root" password="root" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
4. Restart tomcat
1 | sh ./catalina.sh stop |
5. Troubleshoot
If you see exception like this, this say that the SYSTEM user has not full access to the Tomcat folder, so that when Tomcat runs, it can not freely create folders and files within its own directory. You need run tomcat with sudo.1
2
3
4
5org.apache.jasper.JasperException: java.lang.IllegalStateException: No output folder
run with sudo -->
sudo ./catalina.sh stop
sudo ./catalina.sh start
6. Deploy services to tomcat:
(1) In Tomcat Manage Page, Click Manage App
find WAR file to deploy
and select some war file and click deploy
button.
(2) Or copy war file to webapps folder in Tomcat Installing folder.
Deploy Done !!! Just So Easy.