Install Tomcat in source mode (not recommended)
Tomcat is a network service software developed by Apache Foundation to support JSP (Java Server Page.
sudo apt-get install tomcat6
Wait a moment. Tomcat 6 will be automatically installed in the/usr/share/Tomcat6 directory.
Set the JAVA environment for Tomcat running
First, make sure that Sun's Java Development Toolkit has been installed. If not, refer to Java.
Start and Stop Tomcat
To start Tomcat, run
qii@Ubuntu:~$ sudo /etc/init.d/tomcat6 start * Starting Tomcat servlet engine tomcat6
Open the browser and enter http: // localhost: 8080 in the address bar.
Tomcat is successfully installed.
To stop Tomcat, run
qii@ubuntu:~$ sudo /etc/init.d/tomcat6 stop Stopping Tomcat servlet engine tomcat6
Tomcat configuration file path
Tomcat home directory:/usr/share/tomcat6Tomcat base directory:/var/lib/tomcat6 or/etc/tomcat6
Set the Tomcat Administrator Account
Tomcat user account information is saved in the tomcat-users.xml file, run
sudo nano /var/lib/tomcat6/conf/tomcat-users.xml
Add a line before the </tomcat-users> label
<User username = "username" password = "password" roles = "admin, manager"/>
Save and close. Run tomcat again and enter the user name and password to log on to the Tomcat Management page.
Disadvantages
By default, Ubuntu divides Tomcat into two directories. When the Eclipse Server is configured later, it will drive people crazy. If no path is configured, Eclipse cannot identify the installed Tomcat. Solution:
Sudo ln-s/var/lib/tomcat6/conf/usr/share/tomcat6/conf
Sudo ln-s/etc/tomcat6/policy. d/03catalina. policy/usr/share/tomcat6/conf/catalina. policy
Sudo ln-s/var/log/tomcat6/usr/share/tomcat6/log
Sudo chmod-R 777/usr/share/tomcat6/conf
Download and install the latest Tomcat version
This method bypasses the Ubuntu Package Manager and downloads and uses the Tomcat software directly from the Apache Tomcat homepage. This method is convenient and quick to install the old version or new test version of Tomcat without affecting system stability, easy to use.
Download from the official tomcat page
http://tomcat.apache.org/download-70.cgi
Download the zipw.tar.gz package in Binary-> corecategory, decompress it locally, and rename the newly generated directory to tomcat for ease of use. Move this folder to a PATH /. Please refer to the preceding steps to set environment variables and ports! Run directly
PATH/tomcat/bin/./startup.sh
Tomcat immediately serves in the background. (Replace PATH with the appropriate PATH)
Tomcat started successfully
Configure the development environment Eclipse
Take the downloaded Eclipse for Java EE as an example. Right-click the panel at the bottom and select Servers-New-Server. Select the Tomcat version and add it to the path.
Add Tomcat to Eclipse
Preferences-Server-Runtime Environments
Add Tomcat to Eclipse
Tomcat details: click here
Tomcat: click here
Load Balancing between Apache and multiple Tomcat clusters in Linux
Nginx Tomcat Cluster load balancing solution notes
Instance details Tomcat component installation + Nginx reverse proxy Tomcat + Apache use mod_jk and mod_proxy Reverse Proxy and load balancing
Build an Apache + Tomcat environment (JK deployment process)
In-depth analysis of Tomcat PDF