Tomcat Notes (1) Directory, Virtual Host, Server.xml, Tool Management Principles

xiaoxiao2021-03-06  47

About Tomcat Administration

Tool left interface

Name: ok.aa.com [localhost]

Application Base: WebApps / / Compared to Tomcat_home

Host (ok.aa.com [localhost])

Context (/) // root physical catalog

/ / But as DocBase is a virtual directory (relative to Application Base)

// It is url: //ok.aaa.com [localhost] virtual (alias) root directory, this is different from Apache!

// Application Base is the real URL: //ok.aaa.com [localhost] root directory,

// The system will automatically generate when starting (by testing the web-inf, web.xml under root)

Context (/ admin) // system default (delete corresponding admin.xml does not automatically restore)

Context (/ Balancer) // Principle is the same with context (/ admin)

Context (/ jsp-example) // The system is automatically generated when starting relative to Application Base.

Context (/ manager) // principle is on context (/ admin)

Context (/ servlets-example) // physical directory, the system will automatically generate when starting relative to Application Base.

Context (/ tomcat-docs) // physical directory, the system is automatically generated when starting relative to Application Base.

Context (/ WebDAV) // Physical Directory, the system will automatically generate relative to Application Base.

Principle: Tomcat starts searching for the physical directory under the AppBase of Host, the physical directory has web-inf, web.xml information is loaded into the TOOL interface, not loaded, but the physical directory that is not loaded is of course still passed. URL to access; the XML file corresponding to the virtual directory (Alias) can be loaded, no time (corresponding XML deleted) does not load, and is not accessible through the URL. But root is different, after deleting root.xml, it can be loaded because it has a double. Each directory will be used normally, the XML of Tomcat_Home / Catalina / Ok.aaa.com [localhost] / generates its same name, but it is best to name the characterful text. .

About Server.xml

-

// URL port is 80, the default is 8080

- / / Here is the default host, which is the host accessed by IP, localhost.

- // Virtual host ok.aa.com

Ok.bbb.com // The alias of the virtual host ok.aa.com and the real URL: //ok.aa.com [localhost] rooted WebApps

Yes.AAA.com //

Yes.bbb.com //

- // Virtual host aaa.com and real URL: //aaa.com [localhost] root directory f: // myWeb

bbb.com // virtual host aaa.com alias

www.bbb.com //

www.aaa.com //

// alias ABC points to physical directory D: // freeweb

Note: HereB Description "DOCBASE =" D: // freeWeb "path =" abc "Usenaming =" false "/> // alias ABC points to the physical directory D: // freeweb After adding, restart Tomcat, it will generate an abc.xml in Tomcat_home / conf / Catalina / Aaa.com. The content is:

After that, then in Tomcat Administration Tool Commit Change, the word

Finally, I want to say that when you make a backup, you must only use the server.xml web.xml ..... These files are available (not the Apache), and you will prepare the entire confed directory! ! ! I used to think that in server.xml wrote Context, it is possible to hand over the directory to Server.xml. But this is a very wrong idea. Server.xml is not keeping Context, it just adds you to the Context generation file, then delete the statements you added in it. It only has the generation function, there is no direct management function, and the function will give the corresponding Alias ​​XML file!

转载请注明原文地址:https://www.9cbs.com/read-45222.html

New Post(0)