If you compile your own apache form source,your apache will not auto start during boot time.
To enable auto start apache during boot time,you need to do sme configuration on rc.d directory.
Follow the steps below and apache will auto start during boot time;
>> GO to init.d folder
cd /etc/rc.d/init.d
>> Create httpd script
vi httpd
>> Copy and paste the code below and save the file (content below is for user who install their apache at /usr/loacl/apache)
#!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: /usr/local/apache/bin/httpd
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf
# Source function library.
. /etc/rc.d/init.d/functions
# See how we were called.
case “$1″ in
start)
echo -n “Starting httpd: ”
daemon /usr/local/apache/bin/httpd -DSSL
echo
touch /var/lock/subsys/httpd
;;
stop)
echo -n “Shutting down http: ”
killproc httpd
echo
rm -f /var/lock/subsys/httpd
rm -f /var/run/httpd.pid
;;
status)
status httpd
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n “Reloading httpd: ”
killproc httpd -HUP
echo
;;
*)
echo “Usage: $0 {start|stop|restart|reload|status}”
exit 1
esac
exit 0
>>allow httpd script to be executable
chmod 744 httpd
>>Now you need to test if this apache start up script is good,type
./httpd start
in your shell to run the apache start up script
>>If you exectuable the apache start up script with no error then you can continue with the next steps.
>>Create symbolic link at /etc/rc.d/rc3.d folder with name S80httpd than link to /etc/rc.d/init.d/httpd
cd /etc/rc.d/rc3.d
ln -s ../init.d/httpd S80httpd
>>Your server now is ready to start apache during boot time .Please reboot your server to take immediate effect.
>>To check if apache will start up during boot time, type
ps ax | grep httpd
at your shell right after you login with a new reboot , if it shows httpd process then you have configured your apache to start during boot time correctly
分享到:
相关推荐
Apache-Subversion-1.13.0最新版,不...sc create SVNService binPath= "C:\Program Files\Apache-Subversion-1.13.0\bin\svnserve.exe --service -r D:\SVN_ROOT" DisplayName= SVNService depend= Tcpip start= auto
sc config %SERVICE_NAME% start= auto 就OK了,以后开机后tomcat服务就自动启动了 注册服务: 首先,在开始->运行中敲cmd,进入MS-DOS界面 cd 到tomcat的bin目录下 运行命令service install TomcatA 就可以把tomcat...
reids6.x win10版本完美编译,创建环境变量,稳定使用....sc create Tomcat binPath= F:/apache-tomcat/bin/startup.bat start= auto 将Tomcat服务删除: sc delete Tomcat 注意:等号和值之间应该有一个空格
九月 18, 2013 11:39:02 上午 org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina 九月 18, 2013 11:39:02 上午 org.apache.catalina.core.StandardEngine startInternal ...
session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); } catch (JMSException e) { e.printStackTrace(); } } public void getMessage(String disname){ try { Queue queue = ...
Following this, you'll get to grips with CloudFormation, auto scaling, bootstrap AWS EC2 instances, automation and deployment with Chef, and develop your knowledge of big data and Apache Hadoop on ...
import org.apache.http.entity.InputStreamEntity; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import ...
Cloud项目效果登录页面桌面页面应用页面应用页面配置运行PHP环境配置(修改php.ini) 建议环境PHP7+ 打开exif扩展 打开com_dotnet扩展 设置session.auto_start = 1 设置post_max_size = 500MMYSQL环境配置(修改....
用于D的LTSV ltsv-d是D的LTSV实现 用法 解析LTSV格式 来自LTSV 默认情况下返回一个关联数组: import ltsv;...auto record = fromLTSV(apacheLog); assert (record[ " host " ] == " 127.0.0.1
10.2.6. Quick-start Spring CLI Example 10.3. Upgrading from an Earlier Version of Spring Boot 11. Developing Your First Spring Boot Application 11.1. Creating the POM 11.2. Adding Classpath ...
用法下载并解压文件安装服务: sc.exe create NAME binPath= "C:\test\service.exe \"java -jar C:\test\application.jar\"" type= own start= auto error= ignore从“控制面板”或“计算机管理”运行服务卸载服务:...
Following this, you'll get to grips with CloudFormation, auto scaling, bootstrap AWS EC2 instances, automation and deployment with Chef, and develop your knowledge of big data and Apache Hadoop on ...
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ...
eric5 provides an interface to the QScintilla auto-completion and calltips functionality. QScintilla2 comes with API files for Python and itself. PyQt4 contains an API file as well. These are ...
// TODO Auto-generated catch block e.printStackTrace(); } } } jar包的源码 package image; /** * 图片缩小算法,方形区域抽样 */ import java.awt.image.BufferedImage; import java.io.File; import ...
import org.apache.poi.hssf.usermodel.*; import org.excel.data.DataType; import org.excel.data.DealForeign; import org.excel.data.ExcelImport; import org.excel.data.impl.StInStatusImpl; import org....
Instead, explicitly set the output handler using ob_start(). ; Using this ini directive may cause problems unless you know what script ; is doing. ; Note: You cannot use both "mb_output_handler" with...
$counter= $obj->autoadd(0,1,0);(声明只针对多线程) echo $counter; 红包第一个参数是红包总额,第二个人参数红包数量,第三个参数默认代表拼手气红包,设置为1的话为普通红包 拼手气红包 $hongb= $obj->hongbao...
13.4.1. START TRANSACTION, COMMIT和ROLLBACK语法 13.4.2. 不能回滚的语句 13.4.3. 会造成隐式提交的语句 13.4.4. SAVEPOINT和ROLLBACK TO SAVEPOINT语法 13.4.5. LOCK TABLES和UNLOCK TABLES语法 13.4.6. SET ...
// TODO Auto-generated catch block e.printStackTrace(); } } /** * 使Office2003-2007全部格式的文档(.doc|.docx|.ppt|.pptx) 转化为pdf文件 * * @param inputFilePath * 源文件路径,如:"d:/...