例如 我的正常的工程路径如下   http://127.0.0.1:8080/web/ 这样的路径才可以访问工程现在我想 http://127.0.0.1  这样就可以访问上面的工程  应该怎么处理?
我记得apache 代理功能,但是apache的代理好像只能够不显示端口。请教。。  最好能写好详细步骤。 谢谢

解决方案 »

  1.   

    比如你使用Tomcat
    1.去掉端口号:
        在server.xml中把Http端口改成80,因为浏览器默认使用80端口,如:<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="8443"/>
    2.去掉工程名:
        在server.xml中加入如下context设置(假设你的Tomcat在C:\Java\apache-tomcat-6.0.18,工程名为test):
    <Context docBase="C:\Java\apache-tomcat-6.0.18\webapps\test" path="" reloadable="true" /></Host>
    其中的docBase为找到工程的路径,path就是你的工程context,这里什么也不写。如果你写成"hello",那么此时你的访问路径就是:http://localhost/hello,这里什么也没写,所以访问路径是:http://localhost 
    看看这些行不行
      

  2.   

    默认端口改为80《---server.xml:port="8080"
    然后在tomcat 的web.xml
      <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/..的路径(试试,也可能是在别的地方 呵呵)
      

  3.   

    。。
    <Context docBase="C:\Java\apache-tomcat-6.0.18\webapps\test" path="" reloadable="true" />

    学习。。
      

  4.   

    修改端口 项目可放在webapps的root里面
      

  5.   

    嗯,一楼的答案差不多已经能回答你的问题了要首先改端口,80端口是默认的,所以不必写出来。再到你的tomcat 安装目录里面的server.xml 里面配置下host
    把path 路径改成/web再者,你可以用跳转的方式实现啊。
    先在tomcat 的web.xml
      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
    在index.html 里面用js 跳转到http://localhost:8080/web/
      

  6.   

    还有一个问题  我的WebLogic.xml文件好像在工程中不起作用,这有什么特殊要配置的地方吗
      

  7.   

    http://xiaoxinshome.javaeye.com/blog/255848这个讲的比较好,可以参考一下!!
      

  8.   

    http://xiaoxinshome.javaeye.com/blog/255848