The file reads as follows: Take Tomcat's Server.xml file as an example
1. Find out how many <Listener> nodes are in the server and print them out
2. At the end of the document I add a
<Service>
Unpackwars= "false" autodeploy= "false" >
</service>, ask the Service to be inside the server
3. Modify, speak of the added service inside the
Unpackwars= "false" autodeploy= "false" to
Unpackwars= "true" autodeploy= "true"
4. Delete the portion of the content that you added
<?XML version= ' 1.0 ' encoding= ' utf-8 '?><ServerPort= "8085"shutdown= "SHUTDOWN"> <ListenerClassName= "Org.apache.catalina.core.AprLifecycleListener"Sslengine= "On" /> <!--Initialize Jasper prior to WebApps is loaded. Documentation At/docs/jasper-howto.html - <ListenerClassName= "Org.apache.catalina.core.JasperListener" /> <!--Prevent memory leaks due to use of particular Java/javax APIs - <ListenerClassName= "Org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <ListenerClassName= "Org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <ListenerClassName= "Org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <globalnamingresources> <Resourcename= "Userdatabase"Auth= "Container"type= "Org.apache.catalina.UserDatabase"Description= "User database that can be updated and saved"Factory= "Org.apache.catalina.users.MemoryUserDatabaseFactory"Pathname= "Conf/tomcat-users.xml" /> </globalnamingresources> <Servicename= "Catalina"> <ConnectorPort= "8099"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8443" /> <ConnectorPort= "8089"Protocol= "ajp/1.3"Redirectport= "8443" /> <Enginename= "Catalina"Defaulthost= "localhost"> <RealmClassName= "Org.apache.catalina.realm.LockOutRealm"> <RealmClassName= "Org.apache.catalina.realm.UserDatabaseRealm"resourcename= "Userdatabase"/> </Realm> <Hostname= "localhost"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true"> <ValveClassName= "Org.apache.catalina.valves.AccessLogValve"Directory= "Logs"prefix= "Localhost_access_log."suffix= ". txt"pattern= "%h%l%u%t "%r"%s%b"resolvehosts= "false"/> </Host> </Engine> </Service></Server>
Python third day file operation exercises