Install tomcat7
sudo apt-get install tomcat7
Start tomcat7
sudo service tomcat7 start
Stop tomcat7
sudo service tomcat7 stop
Restart tomcat7
sudo service tomcat7 restart
Tomcat7 runs on port 8080 by default. Remember to add port 8080 to the security group in the Amazon EC2 Management Console.
Change from port 8080/8443 to 80/443
sudo vi /etc/tomcat7/server.xml
123456789101112 |
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- change the ports from 8080 and 8443 to 80 and 443 respectively -->
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="443" />
|
Enable AUTHBIND
sudo vi /etc/default/tomcat7
# If you run Tomcat on port numbers that are all higher than 1023, then you
# do not need authbind. It is used for binding Tomcat to lower port numbers.
# NOTE: authbind works only with IPv4. Do not enable it when using IPv6.
# (yes/no, default: no)
#AUTHBIND=no
AUTHBIND=yes
Create AUTOBIND permission files
touch /etc/authbind/byport/80
touch /etc/authbind/byport/443
chmod 0755 /etc/authbind/byport/80
chmod 0755 /etc/authbind/byport/443
chown tomcat7:tomcat7 /etc/authbind/byport/80
chown tomcat7:tomcat7 /etc/authbind/byport/443
Restart Tomcat7
sudo service tomcat7 restart
Check if Tomcat is running.
netstat -tulpn
Active Internet connections (only servers)Tomcat7 is running on port 80 as process "java".
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8005 0.0.0.0:* LISTEN 1268/java
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 18848/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1268/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 619/sshd
tcp6 0 0 :::22 :::* LISTEN 619/sshd
udp 0 0 0.0.0.0:68 0.0.0.0:* 431/dhclient3
Deployment root path: /var/lib/tomcat7/webapps
Log path: /var/log/tomcat7
You can change the deployment root path in /etc/tomcat7/server.xml. Search for "webapps".
You will also need to change logging.properties
Search for
1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = /vol1/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = /vol1/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
CATALINA_HOME and CATALINA_BASE are defined in:
vi /etc/init.d/tomcat7
# Directory where the Tomcat 6 binary distribution resides$NAME is tomcat7
CATALINA_HOME=/usr/share/$NAME
# Directory for per-instance configuration files and webapps
CATALINA_BASE=/var/lib/$NAME
Change webapps location to EBS volume:
sudo vi /etc/tomcat7/server.xmlFind
Change appBase to "/vol/webapps" or your desired location.
/vol is the mounted point of a EBS volume. To create a EBS volume, read the post - Amazon EC2 - Mounting a EBS drive.
Restart tomcat7.
Deploy a war file to "/vol/webapps" and access the application at
http://{ec2-domain}/{app_name}
相关推荐
Install Tomcat on linux platform step by step
Tomcat, Mac, Mod_JK,Database Access OS X developer tools must be installed to compile the MOD_JK connector, Native Library, or the JSVC daem.
How_to_install_JDK1.5_on_Ubuntu
install-tl-ubuntu, 在Ubuntu上,安装TeX脚本 install-tl-ubuntu用法sudo./install-tl-ubuntu [OPTIONS]快速下载我推荐使用 git clone,但我已经了解到许多Github用户没有 Git 。 在这些情况下,可以直接下载
Failed to install Tomcat6 service(Tomcat6安装失败解决方法)
The experience of the install of next softwares Ubuntu Hudson Tomcat FTP Twiki
Install Windows 7 on your Mac using Boot Camp(苹果电脑安装windows系统官方指南)
How to install ssh on ubuntu
How to install mysql on ubuntu
How to install apache on ubuntu
How to install openjdk on ubuntu
Install Ubuntu 14.04 on i.MX7D-SDB This document describe the setup detail for ubuntu core on MX7D SDB
install 12c RAC on linux 6.4PUB V2
install tomcat for linux
从Ubuntu软件库安装Tomcat: apt-get install tomcat8 您可能还需要安装tomcat8-docs,tomcat8-examples和tomcat8-admin工具,这些工具提供了文档,测试和允许您基于Web的应用程序管理Tomcat。 您可以使用以下命令...
ubuntu U盘自动安装autoinstall.seed
How to install OMNET++ on Ubuntu 12.10
InstallAnywhere7_1打包J2EE项目(Java+Tomcat+MySQL)
在Ubuntu18.04中安装NFS服务器以及配置NFS 客户端,详细安装步骤过程,简单实用,一学就会
第三步:在bin目录下的命令行输入 service bat install Tomcat6(注:Tomcat6为服务名 这个随你自己取) OK 现在就去系统服务里面去找到你的tomcat吧 如果你想从Windows服务中移除 请使用命令: service bat ...