12 Nisan 2018 Perşembe

Tomcat server.xml Engine - Servlet'i Temsil Eder

Engine
Açıklaması şöyle.
This represents the entire request processing machinery associated with a particular Catalina service. It receives and process all requests from one or more Connectors, and returns the completed response to the Connector for its ultimate transmission back to the client.
Açıklaması şöyle
The Engine component represents a runnable Servlet instance, including the core functions of the Servlet container, which can have one or more virtual hosts (Host). Its main function is to delegate the request to the appropriate virtual host for processing, that is, to match the appropriate virtual host for processing according to the configuration of the URL path.
Engine 
Realm ve Host kısımlarından oluşur.

Host
Açıklaması şöyle.
This element represents a virtual host, which is an association of a network name of a server, i.e. www.sample.com, with the particular server on which Tomcat is running.
Context ve Valve kısımlarından oluşur.

Şöyle yaparız.
<Engine name="Catalina" defaultHost="localhost">
  ...
  <Host name="localhost" appBase="webapps">
    <Context docBase="ROOT.war" path="">
      <Valve className="org.apache.catalina.authenticator.SpnegoAuthenticator"
        storeDelegatedCredential="true" />
    </Context>
  </Host>
</Engine>
Valve
Örnek
Şöyle yaparız.
 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
         prefix="localhost_access_log" suffix=".txt"
        pattern="%h %l %u %t &quot;%r&quot; %s %b" />
Örnek
Şöyle yaparız.
<Valve className="org.apache.catalina.valves.RemoteIpValve"
       remoteIpHeader="x-forwarded-for" />

<Valve className="org.apache.catalina.valves.AccessLogValve"
    requestAttributesEnabled="true"
     pattern="Rempote Ip is: %{org.apache.tomcat.remoteAddr}r" />

Hiç yorum yok:

Yorum Gönder