Fedora 14 下 安装 Apache Tomcat

Apache Tomcat is a free and open source software implementation for Java Servlets. It provides support for the Java Server Pages (JSP) that power many popular web-based applications.

This guide assumes that you have a working installation of Fedora 14, and that you have followed our getting started guide to get your system working and up to date. If you are new to Linux system administration, you may be interested in our Linux administration basics guide or other documents in our series on using Linux.

Set the Hostname

Before you begin installing and configuring the components described in this guide, please make sure you've followed our instructions for setting your hostname. Issue the following commands to make sure it is set properly:

hostname
hostname -f

The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN).

Install Apache Tomcat

Issue the following command to install the latest version of Tomcat 6, along with the OpenJDK runtime environment and developer tools:

yum update
yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps java-1.6.0-openjdk-devel.i686
chkconfig tomcat6 on

Issue the following command to ensure that the file permissions of crucial folders are set properly:

chmod -R g+w /var/log/tomcat6 /etc/tomcat6/Catalina /var/lib/tomcat6/webapps/ /var/log/tomcat6/ /var/cache/tomcat6/temp /var/cache/tomcat6/work

Start the tomcat6 service with the following command:

/etc/init.d/tomcat6 start

Tomcat should now be totally functional. In the future, if you need to start, stop, or restart, you can use the following commands:

/etc/init.d/tomcat6 start
/etc/init.d/tomcat6 stop
/etc/init.d/tomcat6 restart

Test and use Tomcat

You can test your Tomcat installation by pointing your browser to http://[yourdomain-or-ip-address]:8080/. By default, files are located at/usr/share/tomcat6/webapps/.

At this point, you may want to create a user to access the "Tomcat Manager" web application. This will give you some information concerning your Tomcat instance, as well as some demo applications for testing. To add a user, edit the /etc/tomcat6/tomcat-users.xml file to include the following line, substituting your own username and password. Make sure you keep the "manager" role.

File excerpt:/etc/tomcat6/tomcat-users.xml

<user name="squire" password="ducklingtonmorris" roles="manager" />

Once you have saved the tomcat-users.xml file, restart the tomcat6 service with the following command:

/etc/init.d/tomcat6 restart

At this point, you will be able to log in to the Tomcat Manager application and begin deploying Java Servlets with Apache Tomcat!

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值