service httpd restart   出现 httpd:unrecognized service 错误

vi /etc/rc.d/rc.local #在/etc/rc.d/rc.local中增加启动apache的命令

添加:
/usr/local/apache2/bin/apachectl start
或者

#将apache注册为系统服务

# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

#chmod 700 /etc/rc.d/init.d/httpd

#vi /etc/rc.d/init.d/httpd
   在第三行后增加
   #Comments to support chkconfig on RedHat Linux

#chkconfig: 2345 90 90

#description:http server

注意:没有这几行,在使用chkconfig时会提示你:service httpd does not support chkconfig。

chkconfig --add httpd
chkconfig --level 2345 httpd on

最新文章

  1. nginx配置ssl证书的方法
  2. JavaScript中Promises/A+规范的实现
  3. 无限级ddsmoothmenu菜单实例
  4. springboot与shiro配置
  5. Uva 11248 网络扩容
  6. Windows Azure Virtual Machine (30) 修改Azure VM 的Subnet
  7. 27 GroupSock概述(一)——live555源码阅读(四)网络
  8. JSP三大指令
  9. 1503 - A PRIMARY KEY must include all columns in the table's partitioning function
  10. 【tarjan】BZOJ 1051:受欢迎的牛
  11. 简化PHP开发的10个工具
  12. JPA详解
  13. Java菜鸟学习笔记--数组篇(三):二维数组
  14. YY前端笔试总结
  15. Androidndk开发打包时我们应该如何注意平台的兼容(x86,arm,arm-v7a)
  16. 三星note4,微信公众号开发,页面闪退
  17. Java语言的9个主要特性
  18. JAVA二维数组的复制
  19. myBatis源码学习之SqlSession
  20. echarts-饼状图默认选中高亮

热门文章

  1. atitit.恒朋无纸化彩票系统数据接入通信协议
  2. [转]AngularJS ui-router (嵌套路由)
  3. java中的锁池和等待池
  4. Android studio sha1
  5. 扫目录过狗过waf方法
  6. UCI机器学习库和一些相关算法(转载)
  7. 什么是KBEngine
  8. Vim -> 移动光标
  9. 重写(Override)
  10. Unity3D入门其实很简单