Linux相关问题-Ubuntu 12.04下解决Tomcat自启动问题
2013-05-30 11:03
218 查看
当我们安装好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下的内容了
相关文章推荐
- Linux相关问题-CentOS6.5 x64版本号下Tomcat无法自启动的解决的方法
- Ubuntu 12.04下解决Tomcat自启动问题(每次启动都要在终端输入)
- Ubuntu 12.04下解决Tomcat自启动问题
- Ubuntu 12.04下解决Tomcat自启动问题(
- Linux相关问题-CentOS6.5 x64版本下Tomcat无法自启动的解决办法
- 解决Mac OS lion下(ubuntu等linux也一样)启动tomcat的Cannot find ./catalina.sh 的问题
- 解决linux中zookeeper,tomcat等依赖jdk的程序自启动失败问题
- [问题解决方法汇总] ubuntu 12.04安装fbterm和yong输入法
- ubuntu 12.04 teamviewer 安装问题及解决
- ubuntu 16.04下搜狗输入法不能输入中文解决(linux下常见软件崩溃问题解决方案)
- 解决linux下tomcat8上传图片无法通过Nginx查看的问题
- 双系统下Linux(ubuntu)不能进入windows的NTFS分区之挂载错误问题解决
- linux下的tomcat内存溢出问题解决
- 关于ubuntu 12.04 下android adb无法找到Nexus 7的问题个人解决经历
- VM之Linux:Linux的Ubuntu中,解决安装后屏幕太小的问题
- ubuntu下Eclipse相关问题及解决方法
- ubuntu 12.04 问题解决笔记集(1)-自动挂windows分区-QT实例出现GL/gl.h:No such file的错误
- linux释放内存脚本,解决ubuntu老是死机问题
- linux环境weblogic & tomcat 下报表里报出的图表类不能显示和乱码的错误-java.lang.NoClassDefFoundError: sun/awt/X11 问题解决
- ubuntu-linux 下硬盘读写时声音很响问题的解决