Ubuntu 12.04下解决Tomcat自启动问题(每次启动都要在终端输入)
2013-07-03 09:28
585 查看
当我们安装好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下的内容了
相关文章推荐
- Ubuntu 12.04下解决Tomcat自启动问题
- Linux相关问题-Ubuntu 12.04下解决Tomcat自启动问题
- Ubuntu 12.04下解决Tomcat自启动问题(
- eclipse配置虚拟路径后,每次启动tomcat都会虚拟路径失效的问题解决
- Ubuntu Eclipse的Tomcat小问题:不能输入server name,不能启动tomcat
- 解决Mac OS lion下(ubuntu等linux也一样)启动tomcat的Cannot find ./catalina.sh 的问题
- 解决 每次Tomcat启动都报icu4j告警的问题
- Tomcat服务器热启动,解决部署源码时每次手动重启Tomcat问题
- ubuntu系统每次启动屏幕都是最大亮度问题的解决方法
- 解决ubuntu 12.04 64位系统无法启动avd的问题
- ubuntu下解决tomcat无法启动问题
- tomcat可以正常启动,但是输入localhost无法正常显示的问题解决
- 解决 win 8.1 + Ubuntu 12.04 安装双系统后启动,无法进入ubuntu的问题
- Ubuntu 12.04启动时,网络配置不正确,60秒等待问题解决方法
- ubuntu 12.04 终端内启动gvim超慢的解决办法
- ubuntu 12.04 sshd 无法启动问题解决
- ubuntu 12.04系统托盘不显示ibus输入法图标的解决方法
- zip版tomcat(6,7)不能注册成windows服务或者注册后不能启动的问题解决
- ubuntu sublime中文输入问题解决办法
- u盘安装ubuntu 12.04 server问题解决