@name tomcat 填写虚拟主机 @author lkq<2021-08-27> @param path @param domain @return bool
(self, path, domain)
| 905 | return None |
| 906 | |
| 907 | def add_vhost(self, path, domain): |
| 908 | ''' |
| 909 | @name tomcat 填写虚拟主机 |
| 910 | @author lkq<2021-08-27> |
| 911 | @param path<string> |
| 912 | @param domain<string> |
| 913 | @return bool |
| 914 | ''' |
| 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): |
no test coverage detected