一,改端口
1,修改默认访问端口8080,改为80
# vim /usr/local/tomcat/conf/server.xml (路径不一定,就是自己的安装目录)
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/> 修改端口 <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/> 这样的话,在输入127.0.0.1之后就可以省略:80端口
二,基于域名访问
1,修改配置
# vim /usr/local/tomcat/conf/server.xml (路径不一定,就是自己的安装目录)
添加HOST
<Host name="name1" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Alias>www.cc8w.com</Alias> <Context path="" docBase="webapps下的路径" reloadable="true" caseSensitive="false" debug="0"></Context> </Host>
如:
<Host name="www.cc8w.com" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Alias>www.cc8w.com</Alias> <Context path="" docBase="/xinqi/tomcat85/webapps/javaweb_maven" reloadable="true" caseSensitive="false" debug="0"></Context> </Host>