1、在/usr/local/apache-tomcat-7.0.68/bin中有commons-daemon-native.tar.gz  压缩包

2、解压commons-daemon-native.tar.gz

tar -zxvf commons-daemon-native.tar.gz 

3、解压完成,出现commons-daemon-1.0.15-native-src文件夹(目录)

4、  执行configure 文件

cd commons-daemon-1.0.-native-src/unix
./configure

5、  编译

[root@localhost ~]# make

6、 编译完成后出现jsvc文件夹,复制jsvc到/usr/local/apache-tomcat-7.0.68/bin目录下面

[root@localhost ~]# cp jsvc ../../ 

7、避免内存溢出,设置环境变量(添加setenv.sh,内容如下)

[root@sso bin]# more setenv.sh

#add tomcat pid

CATALINA_PID="$CATALINA_BASE/tomcat.pid"

#add java opts

JAVA_OPTS="-server -XX:PermSize=256M -XX:MaxPermSize=1024m -Xms512M -Xmx2048M -XX:MaxNewSize=256m"

8、/usr/local/apache-tomcat-7.0.68/bin/daemon.sh start启动tomcat

9、将tomcat添加到服务

[root@sso system]# vi /usr/lib/systemd/system/tomcat.service 

[Unit]
Description=Tomcat
After=syslog.target network.target remote-fs.target nss-lookup.target [Service]
Type=forking
PIDFile=/usr/local/apache-tomcat-7.0./tomcat.pid
ExecStart=/usr/local/apache-tomcat-7.0./bin/daemon.sh start
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true [Install]
WantedBy=multi-user.target

10、允许开机启动

systemctl enable tomcat

使用jsvc启动tomcat的更多相关文章

  1. 使用 jsvc 启动tomcat(使用普通用户运行)

    使用 jsvc 启动tomcat(使用普通用户运行) jsvc简介 在生产中,tomcat应该以daemon的模式运行,而且如果需要以普通用户的身份启动tomcat,那么就不能使用1024以下的端口, ...

  2. lunux 启动 tomcat

    本人从官网http://tomcat.apache.org/上面下载的6.0.1_31版本,并解压包后改名存放在:/usr/share/tomcat6 本人使用的是root用户登录,下面就说说具体的操 ...

  3. eclipse启动tomcat无法访问

    eclipse启动tomcat无法访问 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误.同时其他项目页面也不能 ...

  4. Error configuring application listener of class。。。NoClassDefFoundError。。某Listener 之启动tomcat报错

    当你启动tomcat的时候如果报类似下面的错误: WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to ' ...

  5. eclipse启动tomcat, http://localhost:8080无法访问

    原地址 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误.同时其他项目页面也不能访问. 关闭eclipse里面的 ...

  6. Eclipse启动Tomcat时发生java.lang.IllegalArgumentException: <session-config> element is limited to 1 occurrence

    在学习struts 2时,为了方便,直接从下载的struts的apps目录下的struts2-blank.war压缩包下的WEB-INF\复制的web.xml,当我启动Tomcat时,发生 java. ...

  7. Mac下没有权限启动tomcat的解决办法

    问题描述 在Mac中通过./startup.sh执行启动脚本文件,启动tomcat时报如下错误: -bash: ./startup.sh: Permission denied 解决方法 错误信息说明了 ...

  8. maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    maven项目启动tomcat报错: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi ...

  9. 直接启动tomcat时为tomcat指定JDK

    第一种: 在windows环境下以批处理文件方式启动tomcat,只要运行<CATALINA_HOME>/bin/startup.bat这个文件,就可以启动Tomcat.在启动时,star ...

随机推荐

  1. clearfix--清除浮动

    .clearfix { zoom: ; display: table; width: %; } .clearfix:after { content: " "; display: b ...

  2. jQuery parent.append和$after的区别

    首先假设我们有个id为test的div和一个id为test2的div: <div id="test">     我是测试div </div> <div ...

  3. 【8-30】oracle数据库学习

    oracle安装:将两个文件合并 全局用户:achievec 口令:Admin123456 用户:scott 口令:tiger oracle开发工具: sqlplusw 和sqlplus和pl/sql ...

  4. 理解Memcached的分布式

    Memcached尽管是"分布式"的缓存系统,但是服务器端并没有分布式功能.各个Memcached实例不会相互通信以共享信息,Memcached如何进行分布式完全取决于客户端的实现 ...

  5. matlab求解相关系数

    最近收到一项新任务,要求两个矩阵的相关系数,说白了就是转换成向量两两计算.本来这个工作我是想自己写个小程序搞定的,但是大家纷纷反映matlab自带了此项功能,本着活到老学到老的心态,我开始查找这个函数 ...

  6. CRect类

    类CRect是对Windows结构RECT的封装,凡是能用RECT结构的地方都可以用CRect代替. 结构RECT表示一个矩形的位置和尺寸,其定义为: typedef struct tagRECT{ ...

  7. 有关jquery checkbox获取checked的问题

    $("input").attr("checked"); <input type="checkbox" value="1&qu ...

  8. [译]git remote

    git remote命令让我们可以创建, 查看, 删除一个到其他仓储的连结. 下图展示了我们的本地仓储有两个remote连接, 一个是中央仓储, 一个是其他开发者的仓储. 除了使用完整的url指向他们 ...

  9. Jquery Md5加密解密

    首先需要调用md5解析的js文件.(右击-目标另存为方式下载) http://files.cnblogs.com/files/colinliu/md5.js 加密方法参考: <script ty ...

  10. SpringMVC的Controller方法的参数不能直接绑定List、Set、Map

    List需要绑定在对象上,而不能直接写在Controller方法的参数中. http://www.iteye.com/topic/973918