Download Tomcat
Download Tomcat from official website http://tomcat.apache.org/and save it in the/home directory
Download Tomcat installs the package in a Linux environment and determines where it is located.
This example apache-tomcat-7.0.56.tar.gz installation package in the root/tools/directory
1. Enter the directory where the apache-tomcat-7.0.56.tar.gz is located
The operation is as follows
CD Tools---ls--
CP apache-tomcat-7.0.56.tar.gz/opt/
(Copy the apache-tomcat-7.0.56.tar.gz to the/opt/directory)
2. Enter the/opt/directory
Here's how:
cd/opt/-----ls---
TAR-ZXVF apache-tomcat-7.0.56.tar.gz
(Unzip the apache-tomcat-7.0.56.tar.gz)----ls
(a blue apache-tomcat-7.0.56 appears)
3. Configuring APACHE-TOMCAT-7.0.56 Environment variables
The configuration of the APACHE-TOMCAT-7.0.56 environment variable is also
/etc/profile this file.
/etc/profile "This is an environment configuration file"
Here's how:
Vim/etc/profile
tomcat_home=/opt/apache-tomcat-7.0.56
Catalina_home= $TOMCAT _home
Path= $TOMCAT _home/bin: $PATH
Export Tomcat_home catalina_home PATH (note space)
4. Must log out and re-login in order to verify that Tomcat is configured correctly
5. How Tomcat works in a Linux system
Tomcat Directory parsing:
Bin: Holds executable scripts for starting and shutting Tomcat.
Conf:tomcat configuration files, such as Server.xml (Tomcat server configuration file) and Web. XML (shared by all WebApps profiles), the password forgot to look at tomcat-users.xml.
WebApps: Store Web applications, and applications that users themselves need to deploy are also placed in this directory.
Work:tomcat the temporary files generated by the runtime, including the class files generated after the JSP compilation.
Logs: The log file is stored.
TEMP:JVM the directory used to hold temporary files (java.io.tmpdir).
[Email protected]:/home/apache-tomcat-6.0.18/bin#./startup.sh
Start Tomcat
[Email protected]:/home/apache-tomcat-6.0.18/bin#./shutdown.sh
Close Tomcat
[Email protected]:/home/apache-tomcat-6.0.18/logs# tail-f catalina.out
View the Tomcat log (-F means that a new log will be printed continuously)
Tomcat console displayed under Linux
$TOMCAT _home for the TOMCAT installation directory. In Linux if you press $tomcat_home/bin/ Startup.sh to start Tomcat without a console effect like windows, it's inconvenient to view the logs. Isn't there a console like Windows under Linux, it's not, it's just that everyone is used to starting it. Under Linux, how do you make tomcat boot like Windows? , the solution is as follows:
[Email protected]:/home/apache-tomcat-6.0.18/bin#./catalina.sh Run
CTRL + C: Can end log printing, but does not affect normal application operation.
TOP-C: Windows-like Task Manager.
Viewing the Java process: Ps-ef |grep java
Kill the corresponding ID process: kill-9 PID//-9 i.e. force
Kill PID: Kill the process, PID from top-c execution get (PID for process number), note before running remember to check the process number.
Tomcat Environment Configuration