Tomcat 1.1 drops) basic setup
Currently, the mainstream web servers and their respective services are as follows:
Microsoft IIS |
. Net |
Apache |
Html/PHP |
Nginx |
Html/PHP |
Tomcat |
Jsp |
Preface:Tomcat is a lightweight application server. It is widely used in small and medium-sized systems and not many concurrent users. It is the first choice for JSP program development and debugging. For a beginner, it can be thought that when an Apache server is configured on a machine, it can be used to respond to access requests to HTML pages. In fact, Tomcat is an extension of the Apache server, but it runs independently. Therefore, when you run tomcat, it actually runs independently as a process independent of Apache. When the configuration is correct, Apache serves the HTML page, while Tomcat actually runs the JSP page and Servlet. In addition, Tomcat, like Web servers such as IIS and Apache, can process HTML pages. In addition, it is a Servlet and JSP Container. The independent Servlet container is the default mode of Tomcat. However, Tomcat cannot process static HTML as well as Apache servers. The latest version of Tomcat is 8.0.28. I have never been familiar with Tomcat, so I have learned it with everyone.
1. Tomcat provides services for Jsp pages, so the java environment is required. First install jdkDownload jdk-6u24-linux-i586-rpm.bin to local/usr/java
- Cd/usr/java
- Chmod 755 jdk-6u24-linux-i586-rpm.bin # Add execution Permissions
- ./Jdk-6u24-linux-i586-rpm.bin # The file that generates the jdk-6u1-linux-i586.rpm
-
- When the page displays "Press Enter to continue..." # Press Enter.
After the installation is complete, jdk1.6.0 _ 24 is generated in the current directory. Next, modify the environment variable to make it referenced by the system. Add the following content to/etc/profile:
- JAVA_HOME=/usr/java/jdk1.6.0_24
- CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
- PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
- export PATH CLASSPATH JAVA_HOME
Source/etc/profile # test the configuration file that takes effect immediately: execute java-version. If it is correct, it will show: java version "1.6.0 _ 24" Java (TM) SE Runtime Environment (build 1.6.0 _ 24-b07) Java HotSpot (TM) Client VM (build 19.1-b02, mixed mode, sharing)
2. install tomcat here select "Install-free green") --- that is, unzip the package to useDownload apache-tomcat-6.0.35.tar.gz to/usr/local
- Tar zxf apache-tomcat-6.0.35.tar.gz # Extract files
- Mv apache-tomcat-6.0.35 tomcat # renamed, easy to write path
-
- /Usr/local/tomcat/bin/startup. sh # Start the script
- /Usr/local/tomcat/bin/shutdown. sh # Close the script
By default, port 8080 is monitored. How can I modify the default website directory tomcat/webapps? Find the following section in vim/usr/local/tomcat/conf/server. xml:
- <Connector port = "8001" protocol = "HTTP/1.1" # change the port to the desired port.
- ConnectionTimeout = "20000"
- RedirectPort = "8443" type = "regxph" text = "yourobjectname"/>
Change the default directory: Add a row:
- <Context path = "" docBase = "/web" debug = "0" reloadable = "false" xmlNamespaceAware = "false" xmlValidation = "false"/--> # docBase directory path
Enter the address: http: // ip: 8080 to access. The default homepage is displayed:
650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/034030OV-0.jpg "/>
By now, the basic setup of Tomcat is complete.
Follow-up:Tomcat 1.1 drops 2) configure the application
Tomcat full series notes:
Tomcat 1.1 drops) Build Tomcat 1.1 drops (2) configure the application Tomcat 1.1 drops (3) Integrate Apache and NginxTomcat 1.1 drops (4) Cluster deployment and session sharing Tomcat 1.1 drops (5) performance Tuning
This article is from the "____ documents. Time ^ notes" blog, please be sure to keep this http://xtony.blog.51cto.com/3964396/988706