def __generate_server_xml(self):
    server_xml = os.path.join(self.get_path(), 'resources', 'tomcat', 'conf', 'server.xml')
    if os.path.isfile(server_xml):
        os.remove(server_xml)
    with open(server_xml, 'w+') as f:
        f.write('<Server port="8005" shutdown="SHUTDOWN">\n')
        f.write('  <Service name="Solr">\n')
        f.write(('    <Connector port="8983" address="%s" protocol="HTTP/1.1" connectionTimeout="20000" maxThreads = "200" URIEncoding="UTF-8"/>\n' % self.network_interfaces['thrift'][0]))
        f.write('    <Engine name="Solr" defaultHost="localhost">\n')
        f.write('      <Host name="localhost"  appBase="../solr/web"\n')
        f.write('            unpackWARs="true" autoDeploy="true"\n')
        f.write('            xmlValidation="false" xmlNamespaceAware="false">\n')
        f.write('      </Host>\n')
        f.write('    </Engine>\n')
        f.write('  </Service>\n')
        f.write('</Server>\n')
        f.close()
def __generate_server_xml(self):
    server_xml = os.path.join(self.get_path(), 'resources', 'tomcat', 'conf', 'server.xml')
    if os.path.isfile(server_xml):
        os.remove(server_xml)
    with open(server_xml, 'w+') as f:
        f.write('<Server port="8005" shutdown="SHUTDOWN">\n')
        f.write('  <Service name="Solr">\n')
        f.write(('    <Connector port="8983" address="%s" protocol="HTTP/1.1" connectionTimeout="20000" maxThreads = "200" URIEncoding="UTF-8"/>\n' % self.network_interfaces['thrift'][0]))
        f.write('    <Engine name="Solr" defaultHost="localhost">\n')
        f.write('      <Host name="localhost"  appBase="../solr/web"\n')
        f.write('            unpackWARs="true" autoDeploy="true"\n')
        f.write('            xmlValidation="false" xmlNamespaceAware="false">\n')
        f.write('      </Host>\n')
        f.write('    </Engine>\n')
        f.write('  </Service>\n')
        f.write('</Server>\n')
        f.close()