tomcat 部署站点时遇到的部分问题以及解决方案
一、修改tomcat默认端口平时测试时可以直接访问http://localhost:8080 然后登录。但是部署在外网后,或者为了方便浏览测试,可以更改为http的默认80端口。
修改tomcat目录下的conf/server.xml文件,将原来的“8080”修改为“80”,这样就可以直接访问http://localhost
1
2
3
4
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"URIEncoding="UTF-8"/>
<!-- A "Connector" using the shared thread pool-->
二、域名绑定
在测试时可以直接访问IP地址,但是部署在外网的时候需要绑定指定域名才可以。
修改tomcat目录下的conf/server.xml文件:
1
2
3
4
<Host name="www.xx.com"appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="C:\tomcat\webapps\xxx"/>
</Host>
页:
[1]