开始访问为:注意红色
第一步:打开 tomcat - ->conf- ->server.xml 编辑,修改端口号为80端口
<Connector URIEncoding="UTF-8" acceptCount="100" connectionTimeout="20000" maxSpareThreads="300"
maxThreads="1000" minSpareThreads="100" port="80" protocol="HTTP/1.1" redirectPort="8443"/>
第二部:修改 Engine - - - defaultHost 改成你的域名
<Engine defaultHost="你的域名" name="Catalina">
第三步:修改 Host – - name =你的域名 再添加Context(如下)
<Host appBase="webapps" autoDeploy="true" name="你的域名" unpackWARs="true">
再添加:
<Context docBase="项目名" path="" reloadable="true" />
结果:
<Host appBase="webapps" autoDeploy="true" name="hy898561937.com" unpackWARs="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context docBase="test" path="" reloadable="true" source="org.eclipse.jst.j2ee.server:test"/></Host>
域名就可以直接访问了