win2003 jsp operating environment erection experience of jdk+tomcat

  • 2020-05-07 20:41:32
  • OfStack

My environment is win2003+jdk+tomcat with the following version
JDK: jdk u10 4-6 rc2 bin - b32 windows - i586 - p - 12 _sep_2008. exe
tomcat: apache-tomcat-6.0.35.exe
I just need these two pieces of software, and I don't have to create environment variables or anything, and I've seen that none of my environment variables exist. The network is to copy to copy, I these are their own practice out.
Steps:

1. Install JDK first, if in D:\JDK directory

2. Install tomcat in the second part. When installing tomcat, it will automatically find the jdk directory. Also, when installing tomcat, there will be 1 item to fill in the user name and password, 1 must be filled in, otherwise the default on the network is admin, the password is empty, so it is not safe.
There's no trick to installing 1 slice, so I'll just say it.

3, the key is to configure the following multi-site method, which is also what every webmaster wants, such as your program in the webroot directory such as D disk aaa directory d:\webroot\aaa, another site is d:\webroot\bbb directory, there are 2 sites to be released. Then we need to modify the server.xml file in the tomcat installation directory with 1 conf directory. If we want to change the default port to 80, we need to change 3 places, as follows:

(1) modify port 80
 
<!-- A "Connector" represents an 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" /> 

Just change the 8080 in port="8080" to 80.

(2) its 2
 
<Engine name="Catalina" defaultHost="localhost"> 

After this red part, localhost can be changed or not. If you don't change it, you can avoid some people visiting with IP. If you change the domain name to IP, you will visit the site corresponding to that domain name when you visit with IP. Now understand the principle of apache to disable the default site to open 1 of the reason.
(3) its 3

 
<Host name=" Domain name to bind " debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true"> 

<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> 

<Host name=" To tie in the first 2 The domain name of the host " debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true"> 
<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> 


Above two host directory is d: \ webroot \ aaa and d: \ webroot \ bbb these two directories, corresponding program on the two directory, there is a domain name change under 1 can, other do not change, copy to copy to most people on the Internet, some people say that appBase also want to change, don't change this value, and web. xml don't change, this 3 after the restart is good to 1 tomcat is ok, It will take the initiative in tomcat installation directory conf\Catalina this directory will automatically generate with your binding domain name folder, so the directory here does not need to manually build or create xml files, it will automatically generate, the network also said that this is to build what, in fact, it does not need, I was a research 1 day to research out.
The above is the simplest multi-site way to configure jsp.

This is from the icefish blog

Related articles: