First, make sure that you have installed jdk in Ubuntu and set the JAVA_HOME environment variable. Then
First, make sure that you have installed jdk in Ubuntu and set the JAVA_HOME environment variable.
Then
Tar-zxvf apache-tomcat-5.5.27.tar.gz
Get a folder apache-tomcat5.5.27
At this point, tomcat has been installed.
After tomcat is installed, it cannot be run. That is to say, entering http: // locathost: 8080 in the address bar does not show that the installation is successful.
So, I execute
Sudo/usr/share/tomcat5/apache-tomcat-5.5.27/bin/startup. sh
The JAVA_HOME environment variable is not set. The solution is listed below.
Run
Sudo vi/usr/share/tomcat5/apache-tomcat-5.5.27/bin/catalina. sh
Modify the catalina. sh file and insert it After commenting at the beginning of the file
Reference:
JAVA_HOME = "/usr/lib/jvm/java/jdk1.6.0 _ 12"
Then execute
Sudo/usr/share/tomcat5/apache-tomcat-5.5.27/bin/startup. sh
In this way, tomcat can be started successfully.
The last step is to easily start, close, and restart tomcat.
In ~ /Add the following in the bashrc file:
Reference:
Alias starttomcat = 'sudo/usr/share/tomcat5/apache-tomcat-5.5.27/bin/startup. Sh'
Alias shutdowntomcat = 'sudo/usr/share/tomcat5/apache-tomcat-5.5.27/bin/shutdown. Sh'
Alias restarttomcat = 'shutdowntomcat & starttomcat'
Then execute
Source ~ /. Bashrc
You can modify the server. xml file to omit the Port during access. For example, the default port of tomcat5.5.27 is 8080. to change it to 80, perform the following operations:
Run
Sudo vi/usr/share/tomcat/apache-tomcat-5.5.27/conf/server. xml
Modify server. xml, change all the numbers 8080 to 80, and change the Port location
Reference:
Port 80 is special. If you change the port to 80, you can directly enter http: // localhost/in the address bar to access your web