search

Home  >  Q&A  >  body text

centos 6.4下tomcat6配置虚拟目录失败

centos 6.4,yum安装的tomcat6,默认网页目录/var/lib/tomcat6/webapps/root工作正常。我添加了/etc/tomcat6/Catalina/localhost/home.xml文件:

<Context path="/home" docBase="/home/myname/work/jsp/WebRoot" workDir="/home/myname/work/jsp/work" reloadable="true" privilige="true"></Context>

重启tomcat后访问http://localhost:8080/home出现404错误(默认的网站目录依旧工作正常)。仔细对照配置文件没有发现问题。按照网上修改web.xml中的listings为true,重启,依旧404。

PS:yum安装的tomcat没有找到startup.sh,就一直使用service tomcat6 start 和 /etc/init.d/tomcat6 start来启动服务。

大家讲道理大家讲道理2861 days ago599

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-24 16:01:10

    After various attempts, I found that it may be a system permissions issue: I placed the website's physical path docBase under /var/lib/tomcat6/webapps and kept the workDir as the default, and found that the website was finally normal. However, I found that the problem was not solved by modifying the permissions of /home/myname/work/jsp/work. If anyone has successfully set the physical path of the website to the /home folder and run it successfully, please leave your method, thank you!

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-24 16:01:10

    Does tomcat also need to be installed through yum? I think the best way is to download the compressed package from the official website, and then use startup.sh to start it for convenience. If you want to close it, use the kill command. Shutdown.sh cannot be completely closed

    reply
    0
  • Cancelreply