Ubuntu 12.04下解决Tomcat自启动问题(
2016-03-06 19:34
447 查看
当我们安装好Tomcat使用后发现,每次启动都需要在终端中手动键入sudo /var/tomcat/bin/startup.sh,那么我们怎么解决这个问题呢
以下是我的解决方案:
1.首先打开终端,输入su,接着输入ROOT的密码获得ROOT权限。进入/etc文件夹(使用cd /etc命令)
2.打开rc.local文件(在/etc目录下使用vi rc.local命令)
3.rc.local文件内容默认如下
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/var/tomcat/bin/startup.sh
exit 0
4.红色内容为我们手动添加的内容,这里指的是tomcat启动项,那么如何更改呢,首先键入A 进入INSERT模式,移动光标到红色位置输入准确路径,按ESC退出INSERT模式,光标移动到行尾,键入:wq保存文件
至此,我们已经解决这个问题,重启Ubuntu我们发现已经可以自动访问Tomcat下的内容了
以下是我的解决方案:
1.首先打开终端,输入su,接着输入ROOT的密码获得ROOT权限。进入/etc文件夹(使用cd /etc命令)
2.打开rc.local文件(在/etc目录下使用vi rc.local命令)
3.rc.local文件内容默认如下
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/var/tomcat/bin/startup.sh
exit 0
4.红色内容为我们手动添加的内容,这里指的是tomcat启动项,那么如何更改呢,首先键入A 进入INSERT模式,移动光标到红色位置输入准确路径,按ESC退出INSERT模式,光标移动到行尾,键入:wq保存文件
至此,我们已经解决这个问题,重启Ubuntu我们发现已经可以自动访问Tomcat下的内容了
相关文章推荐
- Ngix+Tomcat配置集群负载均衡
- Linux下的Tomcat安装
- centos 下tomcat 自动启动
- Solr学习笔记-在Tomcat上部署执行Solr
- tomcat单个ip配置多个域名及配置用户角色查看服务器状态
- Linux下tomcat JVM内存 配置
- 1。ubuntu15.10+eclispse4.5+tomcat7+jdk8+mysql5环境搭建
- Tomcat之一系列新手问题全解决
- tomcat发布项目时,localhost可以访问,用ip地址不能访问,同时其他电脑也不能访问。
- JavaWeb开发 Tomcat安装及配置教程
- linux下用tomcat部署产品
- Tomcat设置环境变量
- tomcat session持久化
- 怎么解决tomcat占用8080端口问题
- 添加tomcat的相关类
- 关于在tomcat中点击startup.bat cmd一闪而过的原因以及分析这个问题的方法
- tomcat+nginx
- Eclipse+Maven+Tomcat+Git生产环境搭建
- tomcat的log文件夹下不生成log文件的问题
- CentOS下Yum安装Mysql和JDK和tomcat