`
wind9984
  • 浏览: 46783 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

apache auto start

阅读更多

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.zip

    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

    APACHE 2.2.9+TOMCAT6.0.18配置负载均衡

    sc config %SERVICE_NAME% start= auto 就OK了,以后开机后tomcat服务就自动启动了 注册服务: 首先,在开始->运行中敲cmd,进入MS-DOS界面 cd 到tomcat的bin目录下 运行命令service install TomcatA 就可以把tomcat...

    redis6.0.7z

    reids6.x win10版本完美编译,创建环境变量,稳定使用....sc create Tomcat binPath= F:/apache-tomcat/bin/startup.bat start= auto 将Tomcat服务删除: sc delete Tomcat 注意:等号和值之间应该有一个空格

    struts-2.3.8+spring-3.2.1+mybatis-3.2.2架构

    九月 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 ...

    ActiveMQ_Demo

    session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE); } catch (JMSException e) { e.printStackTrace(); } } public void getMessage(String disname){ try { Queue queue = ...

    Mastering AWS Development(PACKT,2015)

    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 ...

    简单的rss阅读器

    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-web:网页桌面应用..

    Cloud项目效果登录页面桌面页面应用页面应用页面配置运行PHP环境配置(修改php.ini) 建议环境PHP7+ 打开exif扩展 打开com_dotnet扩展 设置session.auto_start = 1 设置post_max_size = 500MMYSQL环境配置(修改....

    ltsv-d:D的LTSV实现

    用于D的LTSV ltsv-d是D的LTSV实现 用法 解析LTSV格式 来自LTSV 默认情况下返回一个关联数组: import ltsv;...auto record = fromLTSV(apacheLog); assert (record[ " host " ] == " 127.0.0.1

    spring-boot-reference.pdf

    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 ...

    simple-service-wrapper:简单的 Windows Java 服务包装器

    用法下载并解压文件安装服务: sc.exe create NAME binPath= "C:\test\service.exe \"java -jar C:\test\application.jar\"" type= own start= auto error= ignore从“控制面板”或“计算机管理”运行服务卸载服务:...

    Mastering.AWS.Development.1782173633

    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 ...

    testActiveMQ.rar

    * 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-5.3.1

    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 ...

    java缩略图

    // TODO Auto-generated catch block e.printStackTrace(); } } } jar包的源码 package image; /** * 图片缩小算法,方形区域抽样 */ import java.awt.image.BufferedImage; import java.io.File; import ...

    Excel POI读取封装(文件+示范代码)

    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....

    php.ini-development

    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...

    高性能服务框架ZYS.zip

    $counter= $obj->autoadd(0,1,0);(声明只针对多线程) echo $counter; 红包第一个参数是红包总额,第二个人参数红包数量,第三个参数默认代表拼手气红包,设置为1的话为普通红包 拼手气红包 $hongb= $obj->hongbao...

    mysql官方中文参考手册

    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 ...

    word,ppt转pdf

    // TODO Auto-generated catch block e.printStackTrace(); } } /** * 使Office2003-2007全部格式的文档(.doc|.docx|.ppt|.pptx) 转化为pdf文件 * * @param inputFilePath * 源文件路径,如:"d:/...

Global site tag (gtag.js) - Google Analytics