MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / add_vhost

Method add_vhost

class/projectModel/javaModel.py:907–927  ·  view source on GitHub ↗

@name tomcat 填写虚拟主机 @author lkq<2021-08-27> @param path @param domain @return bool

(self, path, domain)

Source from the content-addressed store, hash-verified

905 return None
906
907 def add_vhost(self, path, domain):
908 ''&#x27;
909 @name tomcat 填写虚拟主机
910 @author lkq<2021-08-27>
911 @param path<string>
912 @param domain<string>
913 @return bool
914 ''&#x27;
915 if not os.path.exists(path): os.makedirs(path)
916 if self.get_vhost(domain): return False
917 attr = {
918 "autoDeploy": "true", "name": domain, "unpackWARs": "true",
919 "xmlNamespaceAware": "false", "xmlValidation": "false"
920 }
921 Host = Element("Host", attr)
922 attr = {"docBase": path, "path": "", "reloadable": "true", "crossContext": "true", }
923 Context = Element("Context", attr)
924 Host.append(Context)
925 self.__ENGINE.append(Host)
926 self.save_tomcat()
927 return True
928
929 # Tomcat服务管理
930 def start_tomcat(self, get):

Callers 3

fix_projectMethod · 0.95

Calls 4

get_vhostMethod · 0.95
save_tomcatMethod · 0.95
existsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected