About tomcat-configure IP address access in tomcat6.0 without adding a port or project name

Source: Internet
Author: User
Tags i18n

 

Configure the server. xml file in the tomcat/conf directory.

Tomcat directory

C:/program files/Apache Software Foundation/tomcat 6.0/Conf

 

1. First find port 8080 and change the port to 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="80" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443" />    <!-- A "Connector" using the shared thread pool-->  

  

Note: Set Port = "80" for the connector node ".

 

2. Configure project directory access.

   <Host name="localhost"  appBase="webapps/i18n"            unpackWARs="true" autoDeploy="true"            xmlValidation="false" xmlNamespaceAware="false">  <Context path="" docBase="." />  <Context path="/i18n" docBase="." /> 

  

Note: Set the name of the host node to "localhost". The name is the access method. If you use localhost to access the Web project, you can directly use localhost to access the Web project, other LAN colleagues can access the service directly through the IP address of the local connection. Appbase = "webapps/i18n", webapps app directory. Here I set the relative directory of webapps/i18n. The absolute path of the Project is (C:/program files/Apache Software Foundation/tomcat 6.0/webapps/i18n), that is, the project directory where i18n is deployed under webapps under tomcat.

 

The following are the materials you can find from the Internet. If you do not know appbase and docbase, you can check them out.

Differences between appbase and docbase in Tomcat <Context docbase = "D:/AAA/BBB"> </context>
</Host>

Let's first look at appbase, which indicates:
1. The subdirectories under this directory will be automatically deployed as applications.
2. The. War file under this directory will be automatically decompressed and deployed as an application.

Docbase only points to the directory of an application, which has nothing to do with appbase.

Summary:
If you want to specify the path
If you want to make it simple, just copy them to the appbase.

If you repeat them, that is, you can run the two directories, but each subdirectory under your application is actually deployed as a separate application.
For example, if your application is

MyApp, placed in
D:/project/MyApp
There are 2 subdirectories
D:/project/MyApp/Images
D:/project/MyApp/JS

You can use
1. Set appbase to point to D:/project for automatic system deployment.
2 You can manually specify docbase to D:/project/MyApp
3. If you specify appbase to D:/project/MyApp
D:/project/MyApp/images is no longer a common subdirectory, but a separate virtual directory or application. Because it is automatically deployed
D:/project/MyApp/Js.

 

About tomcat-configure IP address access in tomcat6.0 without adding a port or project name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.