【问题标题】:setting up tomcat in Ubuntu在 Ubuntu 中设置 tomcat
【发布时间】:2013-06-26 00:00:35
【问题描述】:

我已经阅读了许多在我的 Ubuntu 系统中安装 tomcat 的教程。我安装了tomcat7。 tomcat7-admin、tomcat7-examples 和 tomcat7-docs 通过以下命令:

apt-get install tomcat7
apt-get install tomcat7-admin
apt-get install tomcat7-docs
apt-get install tomcat7-examples

完成此设置后,我可以启动,通过以下方式停止服务器:

/etc/init.d/tomcat7 start/stop

我有以下文件和文件夹:

/usr/share/tomcat7/
/etc/tomcat7/
/var/lib/tomcat7/

我在 /usr/sharetomcat7/conf/tomcat-users.xml/etc/tomcat7/tomcat-users.xml 下的 tomcat-users.xml 文件中添加了以下用户

<user username="admin" password="amdin" roles="admin-gui,standard,manager-gui"/>

现在,当我打开 localhost:8080 时,我得到一个枯燥的页面,上面写着“它可以工作”,这与我们通常得到的彩色页面不同。这些是页面的内容:

You might consider installing the following packages, if you haven't already done so:

tomcat7-docs: This package installs a web application that allows to browse the Tomcat 7 documentation locally. Once installed, you can access it by clicking here.

tomcat7-examples: This package installs a web application that allows to access the Tomcat 7 Servlet and JSP examples. Once installed, you can access it by clicking here.

tomcat7-admin: This package installs two web applications that can help managing this Tomcat instance. Once installed, you can access the manager webapp and the host-manager webapp.

但是当我点击上面的“点击这里”链接打开管理员、文档或示例时,我得到"HTTP status 404: The requested resource is not available."

但我已经安装了管理、示例和文档。我不明白。请帮忙!我正在使用 Ubuntu 13.04

【问题讨论】:

    标签: apache tomcat ubuntu


    【解决方案1】:

    为 webapps 文件夹中的每个应用程序创建一个链接,如下所示:

    cd /var/lib/tomcat7/webapps
    sudo ln -s /usr/share/tomcat7-examples/examples examples
    sudo ln -s /usr/share/tomcat7-docs/docs docs
    sudo ln -s /usr/share/tomcat7-admin/manager manager
    sudo ln -s /usr/share/tomcat7-admin/host-manager host-manager
    

    【讨论】:

      【解决方案2】:

      在 ubuntu 14.04 上,它使用以下命令对我有用:

      sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples
      

      【讨论】:

        猜你喜欢
        • 2018-01-22
        • 1970-01-01
        • 1970-01-01
        • 2010-11-24
        • 1970-01-01
        • 2014-06-27
        • 2010-10-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多