Installation of Tomcat under Linux

xiaoxiao2021-03-06  23

1. Download Tomcat

Download the Tomcat's binary version in the address below

http://mirrors.cs.neu.edu/apache/dist/jakarta/tomcat-4/binaries/

Download file

Tomcat-4.1.18.tar.gz

2. Installation

First decompression

Gunzip Tomcat-4.1.18.tar.gz tar -zxvf tomcat-4.1.18.tar

Get all the files of Tomcat. Then copy it to the location you want to install, such as

/opt/tomcat-4.1.18/

Then for your convenience, you can change the directory name Tomcat-4.1.18 to Tomcat.

3. Set

Set the road to add the following two lines of EXPORT JAVA_HOME = / OPT / JDK1.4 Export Tomcat_Home = / OPT / Tomcat here We assume that Java JDK is installed in the /opt/jdk1.4 directory. The default setting for activating rootroot is not activated (DISABLED). In order to activate the root, open the file tomcat / conf / server.xml and then remove the -> "to remove it! And ->. Activate Invoker Servlet Removes invoker / servlet / * / servlet / * Setting PortTomcat default port number is 8080. Since Tomcat is a stand-alone, it can work independently without Apache, so you can do not install Apache so you can set Tomcat in Port 80. This way you can omit in the URL: 8080. Open the file Tomcat / conf / server.xml, find the following field: and change 8080 to 80. Create a TEMP subdirectory to create a TEMP subdirectory in / opt / tomcat / directory MKDir Temp

4. Start Tomcat

After installation, restart your computer so that Java_Home and Tomcat_home will take effect. Withdrawal

/ OPT / Tomcat / bin

Next, run the command:

./startup.sh

Under normal circumstances, you can see the following information:

Using catalina_base: / opt / tomcat using catalina_home: / opt / tomcat using catalina_temdir: / opt / tomcat / temp using java_home: /opt/jdk1.4

Then open the page as follows by browser

http: // localhost /

or

http: // localhost: 8080 / (If you don't change Port Number to 80) If you see Tomcat's web page (index.jsp), you have proved that Tomcat is successful and has been started.

To close Tomcat, run the following command in / opt / tomcat / bin

./shutdown.sh

5. Register your own project (Project)

Suppose you have a JSP project, he should be installed in the directory below:

/ OPT / Tomcat / WebApps / MyProject

You must join the line in Tomcat / Conf / Server.xml

The corresponding address in the browser is:

http:// localhost / myproject

转载请注明原文地址:https://www.9cbs.com/read-80271.html

New Post(0)