1.修改Tomcat/webapps/ROOT/WEB-INF下的web.xml文件如下:
<?
xml version="1.0" encoding="ISO-8859-1"
?>
<! DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
< web-app >
< welcome-file-list >
< welcome-file > index.html </ welcome-file >
< welcome-file > index.htm </ welcome-file >
< welcome-file > index.jsp </ welcome-file >
</ welcome-file-list >
</ web-app >
<! DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
< web-app >
< welcome-file-list >
< welcome-file > index.html </ welcome-file >
< welcome-file > index.htm </ welcome-file >
< welcome-file > index.jsp </ welcome-file >
</ welcome-file-list >
</ web-app >
2.在Tomcat/webapps/ROOT建立index.html文件,写入如下代码:
<
head
><
meta
http-equiv
="REFRESH"
content
="1; url=../工程文件夹"
></
head
>
3.修改Tomcat/conf下的server.xml文件,把8080端口改成80:
<!--
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
< Connector port ="80" maxHttpHeaderSize ="8192"
maxThreads ="150" minSpareThreads ="25" maxSpareThreads ="75"
enableLookups ="false" redirectPort ="8443" acceptCount ="100"
connectionTimeout ="20000" disableUploadTimeout ="true" />
< Connector port ="80" maxHttpHeaderSize ="8192"
maxThreads ="150" minSpareThreads ="25" maxSpareThreads ="75"
enableLookups ="false" redirectPort ="8443" acceptCount ="100"
connectionTimeout ="20000" disableUploadTimeout ="true" />
此时在浏览器键入本地IP即可访问工程网站!