My environment is Win2003+jdk+tomcat, the version is as follows
Jdk:jdk-6u10-rc2-bin-b32-windows-i586-p-12_sep_2008.exe
Tomcat:apache-tomcat-6.0.35.exe
I only need these 2 software can, do not have to create environment variables or anything, I have seen my environment variables are not. The network is copied to copy, I these are the practice of their own.
Steps:
1, first install JDK, such as installed in the D:\JDK directory
2, second reload Tomcat, when installed Tomcat, will automatically find JDK directory, so we have to install JDK, otherwise tomcat can not install. There are in the installation of Tomcat will be installed in a user name and password, must be filled, otherwise the network said the default is admin, the password is empty, so it is not safe.
There is no skill in installing everything, so I'll simply say it.
3, the key is the following configuration of multi-site methods, which is also every webmaster want, such as your program in the Webroot directory such as D-Disk under the AAA directory that d:\webroot\aaa, another station is D:\WEBROOT\BBB directory, there are 2 stations to publish. Then we need to modify the Tomcat installation directory under a conf directory of server.xml files, if you want to change the default port to 80 that is to change 3 places, as follows:
(1) Modify 80 port
Copy Code code as follows:
<!--A "Connector" represents A endpoint by which requests are received
and responses are returned. Documentation at:
Java HTTP Connector:/docs/config/http.html (Blocking & non-blocking)
Java AJP Connector:/docs/config/ajp.html
APR (HTTP/AJP) Connector:/docs/apr.html
Define a Non-ssl http/1.1 Connector on port 8080
-->
<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
Redirectport= "8443" uriencoding= "UTF-8"/>
The top of the port= "8080" inside the 8080 change to 80 on it.
(2) secondly
Copy Code code as follows:
<engine name= "Catalina" defaulthost= "localhost" >
This red part of the back localhost can be changed, if you can avoid some people with IP access, if changed to the domain name, that is, with IP access, access to that domain name corresponding to the site. Now understand the principle and Apache inside to prohibit the default site to open the same truth.
(3) its three
Copy Code code as follows:
<logger classname= "Org.apache.catalina.logger.FileLogger" directory= "D:\webroot\aaa\logs" prefix= "Aaa_log". suffix= ". txt" timestamp= "true"/>
<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= D:\webroot\aaa\logs "prefix=" Aaa_ Access_log. "suffix=". txt "pattern=" common "resolvehosts=" false "/>
<context path= "" docbase= "D:\webroot\aaa" ></Context>
</Host>
<logger classname= "Org.apache.catalina.logger.FileLogger" directory= "D:\webroot\bbb\logs" prefix= "Bbb_log". suffix= ". txt" timestamp= "true"/>
<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= D:\webroot\bbb\logs "prefix=" bbb_ Access_log. "suffix=". txt "pattern=" common "resolvehosts=" false "/>
<context path= "" docbase= "D:\WEBROOT\BBB" ></Context>
</Host>
The above 2 host directory is D:\WEBROOT\AAA and d:\webroot\bbb these 2 directories, the corresponding program placed in these 2 directories can be, there is a domain name change can, others do not change, the network most people copy to copy, some people say appbase also want to change, This value do not change, and Web.xml also do not change, these 3 changes after the restart of Tomcat on it, it will take the initiative in Tomcat's installation directory Conf\catalina this directory will automatically generate the domain name you bind to the folder, So this directory does not have to manually build or create what XML file, it will automatically generate, the network also said this to build what, in fact, I do not have to study a day to study out.
These are the simplest multi-site methods for configuring JSP.
This article is from the "Ice Fish" blog