Start Tomcat and Apache at Boot Time
Make sure there is a valid user "tomcat" and that this user has rw permissions in the $CATALINA_HOME/conf and $CATALINA_HOME/logs directories. Also make sure that $JAVA_HOME is set. You will start Tomcat as user "tomcat" to avoid running it as root. The Apache server is started as root because it uses port 80 (lower than 1024) but it spawns processes that run as "nobody".
Save the following scripts as /etc/init.d/tomcat and /etc/init/apache. They will automatically be read and run at boot time. Check the log files if it does not start properly.
Make a link to it from /etc/rc5.d such as:
cd /etc/rc5.d
sudo ln -s ../init.d/tomcat S71tomcat
sudo ln -s ../init.d/apache S72apache
---------------------------- /etc/init.d/tomcat ------------------------
#!/bin/bash
#
# tomcat
#
# chkconfig:
# description: Start up the Tomcat servlet engine.
# Source function library.
. /etc/init.d/functions
RETVAL=$?
CATALINA_HOME="/usr/apps/apache/tomcat/jakarta-tomcat-4.0.4"
case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
/bin/su tomcat $CATALINA_HOME/bin/startup.sh
fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
/bin/su tomcat $CATALINA_HOME/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
----------------------- end of /etc/init.d/tomcat ----------------------
---------------------------- /etc/init.d/apache ------------------------
#!/bin/bash
#
# apache
#
# chkconfig:
# description: Start up the Apache web server.
# Source function library.
. /etc/init.d/functions
RETVAL=$?
APACHE_HOME="/usr/apps/apache/apache"
case "$1" in
start)
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $"Starting Apache"
$APACHE_HOME/bin/apachectl start
fi
;;
stop)
if [ -f $APACHE_HOME/bin/apachectl ]; then
echo $"Stopping Apache"
$APACHE_HOME/bin/apachectl stop
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL
----------------------- end of /etc/init.d/apache ----------------------
分享到:
相关推荐
Apache Tomcat 7.0 Patch Proposals ================================= RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT: [ start all new proposals below, under PATCHES PROPOSED. ] PATCHES ...
Apache Tomcat 7.0 Patch Proposals ================================= RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT: [ start all new proposals below, under PATCHES PROPOSED. ] PATCHES ...
亲测解决tomcat9.08搭配jkd9,搭建servlet环境。常见问题是,The required Server component failed to start so Tomcat is unable to start。这个问题,直接通过配置eclipse来解决这个问题。
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Java\jre1.5.0_11\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\...
Finally, you will look at advanced topics, including real time streaming using Apache Storm, and data analytics using Apache Spark. By the end of the book, you will be well versed with different ...
(2)启动tomcat,在开始菜单中选择“所有程序”-----“apache tomcat 6.0”-----“monitor tomcat”,然后在屏幕右下角,右击tomcat服务器图标,选择“start service”,这样tomcat服务器就启动了。打开IE浏览器,...
按照步骤来,这个问题 就会解决。你懂的。
apache-tomcat-9.0.31.zip Tomcat9的WEB容器,windows环境解压后,直接运行start.bat,即可运行启动
uboot start_armboot分析
这是部署在Linux系统上的Tomcat 7版本 直接解压,在子文件夹bin中运行start.sh命令即可 需要自己打开防火墙8080端口
APACHE 2.2.9+TOMCAT6.0.18配置负载均衡 目标: 使用 apache 和 tomcat 配置一个可以应用的 web 网站,要达到以下要求: 1、 Apache 做为 HttpServer ,后面连接多个 tomcat 应用实例,并进行负载均衡。 2、 为系统...
压缩包已经配制好Apache和Tomcata的集群,解压Apache压缩包到D盘,然后进入cmd 进入Apache/bin。 执行httpd.exe -k install 安装服务,然后httpd.exe -k start命令,启动两个tomcat。 地址栏:localhost/test/test....
绿色版启动tomcat脚本
主要介绍了Spring Boot启动过程(五)之Springboot内嵌Tomcat对象的start的相关资料,需要的朋友可以参考下
apache server service不能成功启动的错误提示
apache-tomcat-10.0.0-M1.tar.gz,Tomcat 10 web容器,Linux环境下,直接加压tar包,执行start.sh,即可启动Tomcat web容器
./catalina.sh start (关闭tomcat ./shutdown.sh stop) 4.、测试 查看Tomcat是否已经启动netstat -ntl |grep 8080 浏览器地址栏输入 http://localhost:8080/ 如果能看到Tomcat的欢迎页表示整合成功,至此已经完成...
即比如Tomcat1当机之后,Apache会自动将发给Tomcat1的请求转发到Tomcat2上, 而Tomcat2因为同步了Tomcat1的Session信息,因此从用户的角度,是感觉不出任何差异的。 单纯的Tomcat测试如下: Tomcat配置: Tomcat1...
bootstart3.0可视化离线布局,不需要网络。拖拉实现布局。测试一切正常使用,无报错
I spent nine years at Amazon and IMDb, wrangling millions of customer ratings and customer transactions to produce things such as personalized recommendations for movies and products and "people who ...