在配置tomcat虚拟主机时候,如何每一个虚拟主机写成单独文件,server.xml包含这些子文件? 如以下《OneinStack》中,添加JAVA环境虚拟主机后tomcat配置文件详情:
/usr/local/tomcat/conf/server.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE server-xml [
- <!ENTITY localhost-vhost SYSTEM "file:///usr/local/tomcat/conf/vhost/localhost.xml">
- <!ENTITY java.linuxeye.com-vhost SYSTEM "file:///usr/local/tomcat/conf/vhost/java.linuxeye.com.xml">
- <!ENTITY demo.linuxeye.com-vhost SYSTEM "file:///usr/local/tomcat/conf/vhost/demo.linuxeye.com.xml">
- ]>
- <Server port="8006" shutdown="SHUTDOWN">
- <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
- <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
- <Listener className="org.apache.catalina.core.AprLifecycleListener"/>
- <!--
- <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="8081" rmiServerPortPlatform="8082" />
- -->
- <GlobalNamingResources>
- <Resource name="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>
- <Service name="Catalina">
- <Connector port="8080"
- protocol="org.apache.coyote.http11.Http11AprProtocol"
- connectionTimeout="20000"
- redirectPort="8443"
- maxThreads="1000"
- minSpareThreads="20"
- acceptCount="1000"
- debug="0"
- disableUploadTimeout="true"
- useBodyEncodingForURI="true"
- enableLookups="false"
- URIEncoding="UTF-8" />
- <Engine name="Catalina" defaultHost="localhost">
- <Realm className="org.apache.catalina.realm.LockOutRealm">
- <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
- resourceName="UserDatabase"/>
- </Realm>
- &localhost-vhost;
- &java.linuxeye.com-vhost;
- &demo.linuxeye.com-vhost;
- </Engine>
- </Service>
- </Server>
注:在<server>元素前添加如下格式:
- <!DOCTYPE server-xml [
- <!ENTITY localhost-vhost SYSTEM "file:///usr/local/tomcat/conf/vhost/localhost.xml">
- ]>
并在<Engine>...</Engine]引用它(localhost-vhost,注:不能以数字开头)即可。
下面是每个单独虚拟主机文件:/usr/local/tomcat/conf/vhost/localhost.xml
- <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
- <Context path="" docBase="/data/wwwroot/default" debug="0" reloadable="true" crossContext="true"/>
- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
- prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
/usr/local/tomcat/conf/vhost/demo.linuxeye.com.xml
- <Host name="demo.linuxeye.com" appBase="webapps" unpackWARs="true" autoDeploy="true">
- <Context path="" docBase="/data/wwwroot/demo.linuxeye.com" debug="0" reloadable="true" crossContext="true"/>
- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
- prefix="demo.linuxeye.com_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
/usr/local/tomcat/conf/vhost/java.linuxeye.com.xml
- <Host name="java.linuxeye.com" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Alias>java1.linuxeye.com</Alias>
- <Context path="" docBase="/data/wwwroot/java.linuxeye.com" debug="0" reloadable="true" crossContext="true"/>
- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
- prefix="java.linuxeye.com_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
- </Host>
相关推荐
lnmt(Linux + Nginx+ MySQL+ Tomcat):Nginx处理...http://mirrors.linuxeye.com/oneinstack-full-beta.tar.gz. #完整版下载 包含COS备份 https://oneinstack.com/install/ #安装说明书 https://oneinstack.com
自动分区、格式化、挂载脚本 功能:自动检测是否有尚未分区的数据盘,格式化新的数据盘并自动挂载 ..../auto_fdisk.sh 结果:出现如下即自动分区、格式化、挂载成功: 脚本内容如下: #!/bin/bash # Author: yeho #
wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 ``` 等待安装完成,看到"Congratulations"提示即表示成功。 三、...
./start-kafka.sh ``` 至此,你已经成功地在CentOS 7上使用Kraft模式安装了Kafka 2.12-3.6.0,无需Zookeeper。为了实现高可用性,你需要在多个节点上重复上述步骤,并在`server.properties`中配置不同的`broker.id`...
Nginx虚拟主机上绑定一个带中文域名,比如linuxeye.中国,浏览器不能跳转。 why? 因为操作系统的核心都是英文组成,DNS服务器的解析也是由英文代码交换,所以DNS服务器上并不支持直接的中文域名解析,所有中文域名...
child = subprocess.Popen(['ping', '-c', '4', 'blog.linuxeye.com']) child.wait() print('parent process') ``` 在这个例子中,`Popen`创建了一个子进程`ping`,然后`wait()`使父进程等待子进程结束。 `shell`...
./configure --prefix=%{_prefix} --enable-mbstring --with-mysqli --with-pdo-mysql make %install make install %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc README COPYING %{_prefix}/...
3. 从列表或元组中创建字典:从Python 2.2版本开始,可以使用`dict()`构造函数,例如`fdict = dict((['www','www.linuxeye.com'],['blog','blog.linuxeye.com']))`。 4. 使用`fromkeys()`方法创建:从Python 2.3版本...
child = subprocess.Popen(["ping", "-c", "4", "blog.linuxeye.com"]) child.wait() print("Parent process") ``` `shell=True`参数在`subprocess`函数中使用时,表示使用操作系统shell来执行命令。当`shell=...
linux下的jdk linux下的jdk linux下的jdk linux下的jdk linux下的jdk linux下的jdk linux下的jdk linux下的jdk
一组有序项目的集合 可变的数据类型【可进行增删改查】 ...>>> l = list('linuxeye') >>> l ['l', 'i', 'n', 'u', 'x', 'e', 'y', 'e'] >>> l = list(range(5)) >>> l [0, 1, 2, 3, 4] >>> l = '1;2;3;4;