`
jubincn
  • 浏览: 231973 次
  • 性别: Icon_minigender_1
  • 来自: 宁波
文章分类
社区版块
存档分类
最新评论

Apache自动启动及添加为Linux的服务 转自:http://www.51testing.com/?27242/action_viewspace_itemid_78916.html

 
阅读更多

转自:http://www.51testing.com/?27242/action_viewspace_itemid_78916.html,根据Apache2的版本,略有修改


说明:
Apache安装路径为:/usr/local/apache2
Linux的启动级别为5,版本为Linux AS4

Apache安装完后,发现Apache无法自动启动,查看/etc/rc.d/rc5.d/下,应该没有S打头,httpd结尾的链接文件。

1、将apachectl文件拷贝到/etc/rc.d/init.d 中,然后在/etc/rc.d/rc5.d/下加入链接即可。
命令如下:
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd //如果有其他的版本的Apache存在,也可以直接覆盖掉。
ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc5.d/S85httpd //建立链接(85的意义后面介绍)
此时Apache就可以自动启动了。

2、运行chkconfig --list,发现没有linux服务列表中httpd,通过chkconfig --add httpd来添加,但是提示:httpd服务不支持 chkconfig。需要编辑/etc/rc.d/init.d/httpd,添加以下注释信息:
  # chkconfig: 345 85 15
  # descrīption: Apache
第一行3个数字参数意义分别为:哪些Linux级别需要启动httpd(3,4,5);启动序号(85);关闭序号(15)。

保存后执行:chkconfig --add httpd,成功添加。

在rc3.d、rc4.d、rc5.d路径中会出现S85httpd的链接文件,其他运行级别路径中会出现K61httpd的链接文件。

3、运行chkconfig --list | grep httpd,http在其中。


重启后,查看已启动的服务:

chkconfig --list | grep httpd,可以发现httpd

在RedHat或CentOS中,可以运行ntsysv来设置自启动服务


分享到:
评论

相关推荐

    tomcat7 http://tomcat.apache.org/download-70.cgi

    http://tomcat.apache.org/download-70.cgi http://tomcat.apache.org/download-70.cgi

    InsightSphinxExamples-5.0.0.zip

    $ ./Utilities/SetupForDevelopment.sh .. _Breathe: https://github.com/michaeljones/breathe .. _build instructions in the documentation: https://itk.org/ITKExamples/Documentation/Build/index.html .. _...

    apache_drill_tutorial.pdf

    https://www.tutorialspoint.com/apache_drill/apache_drill_pdf_version.htm https://www.tutorialspoint.com/apache_drill/apache_drill_pdf_version.htm ...

    webservice启动没有问题,通过自动生成的客户端报错

    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder. java:169) at org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseri alizationContextImpl.java:1015) at ...

    org.apache.jasper.JasperException: Template /template/ajax/text.ftl not found

    org.apache.jasper.JasperException: Template /template/ajax/text.ftl not found异常解决包

    apache部署文件

    apache下载This is a binary package ...License : http://www.apache.org/licenses/LICENSE-2.0.txt built by : G. Knauf <fuankg@apache.org> Requirements : LIBC 8.0 (2004/09/22 or later), available at: ...

    Maven问题:Downloading from central: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-a

    今天在使用IDEA创建Maven的webapp时遇见这样一个不叫问题的问题: Downloading from central: ...解决方式:在项目的pom.xml中添加如下一段代码: centra

    apache server 实用全书.ISO

    Apache Server Unleashed ______________________________________________ This CD-ROM contains most of the programs the author mentions that you need to get started with Apache Server. CD-ROM ...

    apache mod_log_rotate

    此apache mod_log_rotate 是win32下vc9版的apache 日志文件管理工具。 使用: 复制mod_log_rotate.so到 Apache2/modules 确保你的系统安装了 Visual C++ 2008 Redistributable (可从这里下载:) ...

    Apache自动启动及添加为Linux的服务 ZT

    httpd自动启动shell文件,比上面拷贝的要强那么一点点,有提示啊 博文链接:https://fengzhang.iteye.com/blog/200844

    Linux服务器配置与管理:Apache服务器安装配置.pptx

    【知识目标】 掌握: Apache 服务器配置方法 【能力目标】 会安装配置Apache 服务 【思政目标】 培养学生职业素养和工匠精神。 Apache相关软件包 (1) httpd-2.4.6-45.el7.x86_64.rpm ...http://www.apache.org

    plexus相关jar包

    Failure to transfer org.codehaus.plexus:plexus-archiver:pom:1.0 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update ...

    jeecms9.2源代码文件

    Tomcat7 下载地址:https://tomcat.apache.org/download-70.cgi MySQL 5.0.22 下载地址:http://dev.mysql.com/downloads/mysql/5.0.html#win32 环境安装可以从以下网址查看安装图文指南 Jdk图文安装指南 : ...

    配置阿帕奇1.PHP4.23在WindowsXP下的IIS和Apache2两种服务器上的安装实例 http://www.phpe.net/articles/260.shtml

    2.在D:\apache2\Apache2\conf下的httpd.conf中,注释符号为#,但不能在一条未注释语句的后面添加注释内容,否则出错,如: httpd.conf中的第173行LoadModule php5_module modules/php5apache2.dll后就不可,否则提示...

    jsp2.0 应用教程 光盘

    JSTL: http://www.apache.org/dist/jakarta/taglibs/standard/ XML: http://www.apache.org/dist/xml/xalan-j/ JavaMail: http://java.sun.com/products/javamail Struts: http://struts.apache.org/download.cgi...

    中标麒麟离线搭建svn教程.rar

    所需文件包和教程目录完全一致 subversion-1.8.18.tar.gz 下载地址:http://subversion.apache.org ...zlib-1.2.11.tar.gz 下载地址:http://linux.softpedia.com/get/Programming/Libraries/zlib-159.shtml

    struts-2.5.13-docs

    The Apache Software Foundation (http://www.apache.org/). Dojo (http://dojotoolkit.org/). domTT (http://www.mojavelinux.com/projects/domtooltip/). The binary distributions includes the following third...

    struts-2.1.8.1-src.zip

    The Apache Software Foundation (http://www.apache.org/). Dojo (http://dojotoolkit.org/). domTT (http://www.mojavelinux.com/projects/domtooltip/). The binary distributions includes the following third...

    文章:http://t.csdn.cn/E1dn8 所需要的文件打包

    文章:http://t.csdn.cn/E1dn8 所需要的文件打包 其中包含了:apache-tomcat-7.0.93+eclipse-jee-luna-SR2-win32-x86_64+jdk-8u171-windows-x64+Navicat_Premium_11.0.8+phpstudy_x64_8.1.1.3

    struts2-core-2.3.15.3.jar

    The Apache Software Foundation (http://www.apache.org/). Dojo (http://dojotoolkit.org/). domTT (http://www.mojavelinux.com/projects/domtooltip/). The binary distributions includes the following third...

Global site tag (gtag.js) - Google Analytics