Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.89 KB | None | 0 0
  1. server.xml
  2. -------------------------
  3.  
  4. <?xml version="1.0" encoding="UTF-8"?>
  5. <Server port="${shutdown.port}" shutdown="SHUTDOWN">
  6.  
  7.   <Listener className="org.apache.catalina.core.JasperListener"/>
  8.   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
  9.   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
  10.  
  11.   <Listener accessFile="${catalina.base}/conf/jmxremote.access" authenticate="true" bind="127.0.0.1" className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener" passwordFile="${catalina.base}/conf/jmxremote.password" port="${jmx.port}" useSSL="false"/>
  12.  
  13.   <Listener className="com.springsource.tcserver.serviceability.deploy.TcContainerDeployer"/>
  14.  
  15.   <GlobalNamingResources>
  16.     <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
  17.   </GlobalNamingResources>
  18.  
  19.   <Service name="Catalina">
  20.  
  21.     <Executor maxThreads="300" minSpareThreads="50" name="tomcatThreadPool" namePrefix="tomcat-http--"/>
  22.  
  23.     <Connector acceptCount="100" connectionTimeout="20000" executor="tomcatThreadPool" maxKeepAliveRequests="15" port="${http.port}" protocol="HTTP/1.1" redirectPort="8443"/>
  24.  
  25.     <Engine defaultHost="localhost" name="Catalina">
  26.  
  27.     <Realm className="org.apache.catalina.realm.MemoryRealm"></Realm>
  28.  
  29.  
  30.       <Host appBase="webapps" autoDeploy="true" deployOnStartup="true" deployXML="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
  31.       </Host>
  32.     </Engine>
  33.   </Service>
  34. </Server>
  35.  
  36.  
  37. tomcat-users.xml
  38. -----------------------------------
  39.  
  40. <?xml version='1.0' encoding='utf-8'?>
  41. <tomcat-users>
  42.   <role rolename="test"/>
  43.   <user username="user" password="pass" roles="test"/>
  44. </tomcat-users>
  45.  
  46.  
  47. web.xml (just the bottom of the file)
  48. ---------------------------------
  49.     <welcome-file-list>
  50.         <welcome-file>index.html</welcome-file>
  51.         <welcome-file>index.htm</welcome-file>
  52.         <welcome-file>index.jsp</welcome-file>
  53.     </welcome-file-list>
  54.       <security-constraint>
  55.     <web-resource-collection>
  56.       <web-resource-name>
  57.         web
  58.       </web-resource-name>
  59.       <!-- This would protect the entire site -->
  60.       <url-pattern>/*</url-pattern>
  61.  
  62.     </web-resource-collection>
  63.     <auth-constraint>
  64.       <!-- Roles that have access -->
  65.       <role-name> test </role-name>
  66.     </auth-constraint>
  67.   </security-constraint>
  68.  
  69.   <!-- BASIC authentication -->
  70.   <login-config>
  71.     <auth-method>BASIC</auth-method>
  72.     <realm-name> Example Basic Authentication </realm-name>
  73.   </login-config>
  74.  
  75.   <!-- Define security roles -->
  76.   <!-- <security-role>
  77.    <description> Test role </description>
  78.    <role-name> test </role-name>
  79.  </security-role> -->
  80.  
  81. </web-app>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement