以OSPod官方网站部署为例,OSPod官方网站包括
www.ospod.com一级域名,还包括forum.ospod.com/blog.ospod.com两个二级域名。
<
Host
name
="localhost"
appBase
="webapps"
unpackWARs
="true"
autoDeploy
="true"
xmlValidation
="false"
xmlNamespaceAware
="false"
>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
<
Context
path
=""
docBase
="/app/ospod/cms"
debug
="5"
reloadable
="true"
>
<
Resource
name
="jdbc/ecms"
auth
="Container"
type
="javax.sql.DataSource"
maxActive
="60"
maxIdle
="30"
maxWait
="10000"
username
="root"
password
="mysql"
driverClassName
="com.mysql.jdbc.Driver"
url
="jdbc:mysql:///ecms?zeroDateTimeBehavior=convertToNull"
/>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
</
Context
>
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
</
Host
>
打开Tomcat的安装目录下的conf/server.xml,进行修改。
找到<Engine name="Catalina" defaultHost="localhost"部分,在<Engine></Engine>中间添加一级域名配置:
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
forum.ospod.com二级域名配置:
<
Host
name
="forum.ospod.com"
appBase
="webapps"
unpackWARs ="true" autoDeploy ="true"
xmlValidation ="false" xmlNamespaceAware ="false" >
< Context path ="" docBase ="/app/ospod/forum"
debug ="5" reloadable ="true" >
< Resource name ="jdbc/eforum" auth ="Container" type ="javax.sql.DataSource"
maxActive ="60" maxIdle ="30" maxWait ="10000"
username ="root" password ="mysql" driverClassName ="com.mysql.jdbc.Driver"
url ="jdbc:mysql:///eforum?zeroDateTimeBehavior=convertToNull" />
</ Context >
</ Host >
unpackWARs ="true" autoDeploy ="true"
xmlValidation ="false" xmlNamespaceAware ="false" >
< Context path ="" docBase ="/app/ospod/forum"
debug ="5" reloadable ="true" >
< Resource name ="jdbc/eforum" auth ="Container" type ="javax.sql.DataSource"
maxActive ="60" maxIdle ="30" maxWait ="10000"
username ="root" password ="mysql" driverClassName ="com.mysql.jdbc.Driver"
url ="jdbc:mysql:///eforum?zeroDateTimeBehavior=convertToNull" />
</ Context >
</ Host >