The JAVA_HOME parameter cannot be found when Tomcat is installed in Ubuntu.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.