日期:2014-05-16  浏览次数:20568 次

linux 安装带服务的tomcat
安装Tomcat

过程将Tomcat文件夹拷贝目标目录下

手动安装:
修改以下文件内容,以便提供系统服务。
1) 修改Tomcat bin目录下tomcat-8080文件,对文件中tomcat-8080字符修改,数字为指定的端口,如改为8081端口,则为tomcat-8081
2) 修改tomcat conf目录下wrapper.conf文件,将文件中的tomcat-8080字符修改,修改内容同步骤1。
3) 修改tomcat conf目录下server.xml文件,将文件中的port=”8080”修改成上面指定的端口,如8081。将port=”8005”指定为另一个端口。(现在235机器上的tomcat占用端口在“服务器配置文件.txt“)
4) 赋予tomcat-8081(本例中使用8081端口)可执行权限。命令如下:
chmod 755 /usr/local/tsp/tomcat-8180/bin/tomcat-8180
chmod 755 /usr/local/tsp/tomcat-8180/bin/*

5) 创建系统服务,命令如下:
ln –s /usr/local/tsp/tomcat-8180/bin/tomcat-8180 /etc/init.d/tomcat-8180

6) 启动服务
service tomcat start|stop|restart


自动安装:
1) 赋予intallForWrapper.sh可执行权限。命令如下:
chmod 755 installForWrapper.sh
2) 执行安装脚本格式如下:
./installForWrapper.sh install [http port] [server port]
例如安装http端口是8081,server端口是8006,命令则如下:
./installForWrapper.sh install 8081 8006