Python third day file operation exercises

Source: Internet
Author: User

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 &quot;%r&quot;%s%b"resolvehosts= "false"/>      </Host>    </Engine>  </Service></Server>

Python third day file operation exercises

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.