Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.92 KB | None | 0 0
  1. for instancia in instancias:
  2. configxml = open( os.path.join(instancia,'conf','server.xml'), 'r')
  3. soup = BeautifulStoneSoup(''.join(configxml.read()))
  4. print soup.findAll('Connector')
  5.  
  6. <!-- Example Server Configuration File -->
  7. <!-- Note that component elements are nested corresponding to their
  8. parent-child relationships with each other -->
  9.  
  10. <!-- A "Server" is a singleton element that represents the entire JVM,
  11. which may contain one or more "Service" instances. The Server
  12. listens for a shutdown command on the indicated port.
  13.  
  14. Note: A "Server" is not itself a "Container", so you may not
  15. define subcomponents such as "Valves" or "Loggers" at this level.
  16. -->
  17.  
  18. <Server port="9050" shutdown="SHUTDOWN" debug="0">
  19.  
  20.  
  21. <!-- Comment these entries out to disable JMX MBeans support -->
  22. <!-- You may also configure custom components (e.g. Valves/Realms) by
  23. including your own mbean-descriptor file(s), and setting the
  24. "descriptors" attribute to point to a ';' seperated list of paths
  25. (in the ClassLoader sense) of files to add to the default list.
  26. e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
  27. -->
  28. <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
  29. debug="0"/>
  30. <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
  31. debug="0"/>
  32.  
  33. <!-- Global JNDI resources -->
  34. <GlobalNamingResources>
  35.  
  36. <!-- Test entry for demonstration purposes -->
  37. <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
  38.  
  39. <!-- Editable user database that can also be used by
  40. UserDatabaseRealm to authenticate users -->
  41. <Resource name="UserDatabase" auth="Container"
  42. type="org.apache.catalina.UserDatabase"
  43. description="User database that can be updated and saved">
  44. </Resource>
  45. <ResourceParams name="UserDatabase">
  46. <parameter>
  47. <name>factory</name>
  48. <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
  49. </parameter>
  50. <parameter>
  51. <name>pathname</name>
  52. <value>conf/tomcat-users.xml</value>
  53. </parameter>
  54. </ResourceParams>
  55.  
  56. </GlobalNamingResources>
  57.  
  58. <!-- A "Service" is a collection of one or more "Connectors" that share
  59. a single "Container" (and therefore the web applications visible
  60. within that Container). Normally, that Container is an "Engine",
  61. but this is not required.
  62.  
  63. Note: A "Service" is not itself a "Container", so you may not
  64. define subcomponents such as "Valves" or "Loggers" at this level.
  65. -->
  66.  
  67. <!-- Define the Tomcat Stand-Alone Service -->
  68. <Service name="Catalina">
  69.  
  70. <!-- A "Connector" represents an endpoint by which requests are received
  71. and responses are returned. Each Connector passes requests on to the
  72. associated "Container" (normally an Engine) for processing.
  73.  
  74. By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
  75. You can also enable an SSL HTTP/1.1 Connector on port 8443 by
  76. following the instructions below and uncommenting the second Connector
  77. entry. SSL support requires the following steps (see the SSL Config
  78. HOWTO in the Tomcat 5 documentation bundle for more detailed
  79. instructions):
  80. * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
  81. later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
  82. * Execute:
  83. %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
  84. $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
  85. with a password value of "changeit" for both the certificate and
  86. the keystore itself.
  87.  
  88. By default, DNS lookups are enabled when a web application calls
  89. request.getRemoteHost(). This can have an adverse impact on
  90. performance, so you can disable it by setting the
  91. "enableLookups" attribute to "false". When DNS lookups are disabled,
  92. request.getRemoteHost() will return the String version of the
  93. IP address of the remote client.
  94. -->
  95.  
  96. <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
  97. <Connector port="9051"
  98. maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
  99. enableLookups="false" acceptCount="100"
  100. debug="0"
  101. disableUploadTimeout="true" />
  102. <!-- Note : To disable connection timeouts, set connectionTimeout value
  103. to 0 -->
  104.  
  105. <!-- Note : To use gzip compression you could set the following properties :
  106.  
  107. compression="on"
  108. compressionMinSize="2048"
  109. noCompressionUserAgents="gozilla, traviata"
  110. compressableMimeType="text/html,text/xml"
  111. -->
  112.  
  113. <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
  114. <!--
  115. <Connector port="9052"
  116. maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
  117. enableLookups="false" disableUploadTimeout="true"
  118. acceptCount="100" debug="0" scheme="https" secure="true"
  119. clientAuth="false" sslProtocol="TLS" />
  120. -->
  121.  
  122. <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
  123. <Connector port="9053"
  124. maxThreads="400" minSpareThreads="25" maxSpareThreads="75"
  125. enableLookups="false" acceptCount="100"
  126. debug="0"
  127. disableUploadTimeout="true"
  128. protocol="AJP/1.3" />
  129.  
  130. <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
  131. <!-- See proxy documentation for more information about using this. -->
  132. <!--
  133. <Connector port="9054"
  134. maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
  135. enableLookups="false"
  136. acceptCount="100" debug="0"
  137. proxyPort="80" disableUploadTimeout="true" />
  138. -->
  139.  
  140. <!-- An Engine represents the entry point (within Catalina) that processes
  141. every request. The Engine implementation for Tomcat stand alone
  142. analyzes the HTTP headers included with the request, and passes them
  143. on to the appropriate Host (virtual host). -->
  144.  
  145. <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
  146. <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
  147. -->
  148.  
  149. <!-- Define the top level container in our container hierarchy -->
  150. <Engine name="Catalina" defaultHost="localhost" debug="0">
  151.  
  152. <!-- The request dumper valve dumps useful debugging information about
  153. the request headers and cookies that were received, and the response
  154. headers and cookies that were sent, for all requests received by
  155. this instance of Tomcat. If you care only about requests to a
  156. particular virtual host, or a particular application, nest this
  157. element inside the corresponding <Host> or <Context> entry instead.
  158.  
  159. For a similar mechanism that is portable to all Servlet 2.4
  160. containers, check out the "RequestDumperFilter" Filter in the
  161. example application (the source for this filter may be found in
  162. "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
  163.  
  164. Request dumping is disabled by default. Uncomment the following
  165. element to enable it. -->
  166. <!--
  167. <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
  168. -->
  169.  
  170. <!-- Global logger unless overridden at lower levels -->
  171. <Logger className="org.apache.catalina.logger.FileLogger"
  172. prefix="catalina_log." suffix=".txt"
  173. timestamp="true"/>
  174.  
  175. <!-- Because this Realm is here, an instance will be shared globally -->
  176.  
  177. <!-- This Realm uses the UserDatabase configured in the global JNDI
  178. resources under the key "UserDatabase". Any edits
  179. that are performed against this UserDatabase are immediately
  180. available for use by the Realm. -->
  181. <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
  182. debug="0" resourceName="UserDatabase"/>
  183.  
  184. <!-- Comment out the old realm but leave here for now in case we
  185. need to go back quickly -->
  186. <!--
  187. <Realm className="org.apache.catalina.realm.MemoryRealm" />
  188. -->
  189.  
  190. <!-- Replace the above Realm with one of the following to get a Realm
  191. stored in a database and accessed via JDBC -->
  192.  
  193. <!--
  194. <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  195. driverName="org.gjt.mm.mysql.Driver"
  196. connectionURL="jdbc:mysql://localhost/authority"
  197. connectionName="test" connectionPassword="test"
  198. userTable="users" userNameCol="user_name" userCredCol="user_pass"
  199. userRoleTable="user_roles" roleNameCol="role_name" />
  200. -->
  201.  
  202. <!--
  203. <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  204. driverName="oracle.jdbc.driver.OracleDriver"
  205. connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
  206. connectionName="scott" connectionPassword="tiger"
  207. userTable="users" userNameCol="user_name" userCredCol="user_pass"
  208. userRoleTable="user_roles" roleNameCol="role_name" />
  209. -->
  210.  
  211. <!--
  212. <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
  213. driverName="sun.jdbc.odbc.JdbcOdbcDriver"
  214. connectionURL="jdbc:odbc:CATALINA"
  215. userTable="users" userNameCol="user_name" userCredCol="user_pass"
  216. userRoleTable="user_roles" roleNameCol="role_name" />
  217. -->
  218.  
  219. <!-- Define the default virtual host
  220. Note: XML Schema validation will not work with Xerces 2.2.
  221. -->
  222. <Host name="localhost" debug="0" appBase="webapps"
  223. unpackWARs="true" autoDeploy="true"
  224. xmlValidation="false" xmlNamespaceAware="false">
  225.  
  226. <!-- Defines a cluster for this node,
  227. By defining this element, means that every manager will be changed.
  228. So when running a cluster, only make sure that you have webapps in there
  229. that need to be clustered and remove the other ones.
  230. A cluster has the following parameters:
  231.  
  232. className = the fully qualified name of the cluster class
  233.  
  234. name = a descriptive name for your cluster, can be anything
  235.  
  236. debug = the debug level, higher means more output
  237.  
  238. mcastAddr = the multicast address, has to be the same for all the nodes
  239.  
  240. mcastPort = the multicast port, has to be the same for all the nodes
  241.  
  242. mcastBindAddr = bind the multicast socket to a specific address
  243.  
  244. mcastTTL = the multicast TTL if you want to limit your broadcast
  245.  
  246. mcastSoTimeout = the multicast readtimeout
  247.  
  248. mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
  249.  
  250. mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
  251.  
  252. tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
  253.  
  254. tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
  255. in case of multiple ethernet cards.
  256. auto means that address becomes
  257. InetAddress.getLocalHost().getHostAddress()
  258.  
  259. tcpListenPort = the tcp listen port
  260.  
  261. tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
  262. has a wakup bug in java.nio. Set to 0 for no timeout
  263.  
  264. printToScreen = true means that managers will also print to std.out
  265.  
  266. expireSessionsOnShutdown = true means that
  267.  
  268. useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
  269. false means to replicate the session after each request.
  270. false means that replication would work for the following piece of code:
  271. <%
  272. HashMap map = (HashMap)session.getAttribute("map");
  273. map.put("key","value");
  274. %>
  275. replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
  276. * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
  277. * Synchronous means that the thread that executes the request, is also the
  278. thread the replicates the data to the other nodes, and will not return until all
  279. nodes have received the information.
  280. * Asynchronous means that there is a specific 'sender' thread for each cluster node,
  281. so the request thread will queue the replication request into a "smart" queue,
  282. and then return to the client.
  283. The "smart" queue is a queue where when a session is added to the queue, and the same session
  284. already exists in the queue from a previous request, that session will be replaced
  285. in the queue instead of replicating two requests. This almost never happens, unless there is a
  286. large network delay.
  287. -->
  288. <!--
  289. When configuring for clustering, you also add in a valve to catch all the requests
  290. coming in, at the end of the request, the session may or may not be replicated.
  291. A session is replicated if and only if all the conditions are met:
  292. 1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
  293. 2. a session exists (has been created)
  294. 3. the request is not trapped by the "filter" attribute
  295.  
  296. The filter attribute is to filter out requests that could not modify the session,
  297. hence we don't replicate the session after the end of this request.
  298. The filter is negative, ie, anything you put in the filter, you mean to filter out,
  299. ie, no replication will be done on requests that match one of the filters.
  300. The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
  301.  
  302. filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
  303. ending with .gif and .js are intercepted.
  304.  
  305. The deployer element can be used to deploy apps cluster wide.
  306. Currently the deployment only deploys/undeploys to working members in the cluster
  307. so no WARs are copied upons startup of a broken node.
  308. The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
  309. When a new war file is added the war gets deployed to the local instance,
  310. and then deployed to the other instances in the cluster.
  311. When a war file is deleted from the watchDir the war is undeployed locally
  312. and cluster wide
  313. -->
  314.  
  315. <!--
  316. <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
  317. managerClassName="org.apache.catalina.cluster.session.DeltaManager"
  318. expireSessionsOnShutdown="false"
  319. useDirtyFlag="true">
  320.  
  321. <Membership
  322. className="org.apache.catalina.cluster.mcast.McastService"
  323. mcastAddr="228.0.0.4"
  324. mcastPort="45564"
  325. mcastFrequency="500"
  326. mcastDropTime="3000"/>
  327.  
  328. <Receiver
  329. className="org.apache.catalina.cluster.tcp.ReplicationListener"
  330. tcpListenAddress="auto"
  331. tcpListenPort="4001"
  332. tcpSelectorTimeout="100"
  333. tcpThreadCount="6"/>
  334.  
  335. <Sender
  336. className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
  337. replicationMode="pooled"/>
  338.  
  339. <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
  340. filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
  341.  
  342. <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
  343. tempDir="/tmp/war-temp/"
  344. deployDir="/tmp/war-deploy/"
  345. watchDir="/tmp/war-listen/"
  346. watchEnabled="false"/>
  347. </Cluster>
  348. -->
  349.  
  350.  
  351.  
  352. <!-- Normally, users must authenticate themselves to each web app
  353. individually. Uncomment the following entry if you would like
  354. a user to be authenticated the first time they encounter a
  355. resource protected by a security constraint, and then have that
  356. user identity maintained across *all* web applications contained
  357. in this virtual host. -->
  358. <!--
  359. <Valve className="org.apache.catalina.authenticator.SingleSignOn"
  360. debug="0"/>
  361. -->
  362.  
  363. <!-- Access log processes all requests for this virtual host. By
  364. default, log files are created in the "logs" directory relative to
  365. $CATALINA_HOME. If you wish, you can specify a different
  366. directory with the "directory" attribute. Specify either a relative
  367. (to $CATALINA_HOME) or absolute path to the desired directory.
  368. -->
  369. <!--
  370. <Valve className="org.apache.catalina.valves.AccessLogValve"
  371. directory="logs" prefix="localhost_access_log." suffix=".txt"
  372. pattern="common" resolveHosts="false"/>
  373. -->
  374.  
  375. <!-- Logger shared by all Contexts related to this virtual host. By
  376. default (when using FileLogger), log files are created in the "logs"
  377. directory relative to $CATALINA_HOME. If you wish, you can specify
  378. a different directory with the "directory" attribute. Specify either a
  379. relative (to $CATALINA_HOME) or absolute path to the desired
  380. directory.-->
  381. <Logger className="org.apache.catalina.logger.FileLogger"
  382. directory="logs" prefix="localhost_log." suffix=".txt"
  383. timestamp="true"/>
  384.  
  385. </Host>
  386.  
  387. </Engine>
  388.  
  389. </Service>
  390.  
  391. </Server>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement