简体   繁体   English

在Ubuntu中设置tomcat

[英]setting up tomcat in Ubuntu

I have gone through many tutorials for installing tomcat in my Ubuntu system. 我已经通过很多教程在我的Ubuntu系统中安装tomcat。 I installed tomcat7. 我安装了tomcat7。 tomcat7-admin, tomcat7-examples and tomcat7-docs by following commands: 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

After this setup I can start, stop the server by: 完成此设置后,我可以启动,停止服务器:

/etc/init.d/tomcat7 start/stop

I have following files and folders: 我有以下文件和文件夹:

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

I have added the following user in tomcat-users.xml file under /usr/sharetomcat7/conf/tomcat-users.xml and /etc/tomcat7/tomcat-users.xml 我在/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"/>

Now when I open localhost:8080, I get a dull page saying 'It works' unlike the colorful page we get generally. 现在,当我打开localhost:8080时,我得到一个沉闷的页面,说“它有效”,而不像我们普遍得到的彩色页面。 These are the contents of page: 这些是页面的内容:

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.

But when I click on 'click here' link above to open admin, docs or examples I get "HTTP status 404: The requested resource is not available." 但是当我点击上面的“点击此处”链接打开管理员,文档或示例时,我得到"HTTP status 404: The requested resource is not available."

But I have installed admin, examples and docs. 但我已经安装了管理员,示例和文档。 I am not getting it. 我没有得到它。 Please help! 请帮忙! I am using Ubuntu 13.04 我正在使用Ubuntu 13.04

在ubuntu 14.04上,它使用以下命令为我工作:

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

Create a link for each application in webapps folder as below: 在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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM