黑客防线,在攻与防的对立统一中寻求突破!2001年创刊的黑客技术专业刊物!

设为首页
收藏本站
联系我们
网站导航

黑客文章 - 工具使用 - 浏览 - Linux快速构建apache web服务器

Linux快速构建apache web服务器

黑客 发布日期:2008-5-17 1:57:14 共有 364 人次浏览
我们通过下面的步骤来快速的搭建一个web服务器。

1、 下载源码文件httpd-2.2.0.tar.gz 到linux服务器的某个目录。
2、 解压文件 # tar zxvf httpd-2.2.0.tar.gz .
3、 配置 # ./configure –refix=/usr/local/apache //指定安装目录,以后要删除安装就只需删
#!/bin/bash
#description:http server
#chkconfig: 235 98 98
case "$1" in
start)
  echo "Starting Apache daemon..."
  /usr/local/apache2/bin/apachectl -k start
  ;;

stop)
  echo "Stopping Apache daemon..."
  /usr/local/apache2/bin/apachectl -k stop
  ;;

restart)
  echo "Restarting Apache daemon..."
  /usr/local/apache2/bin/apachectl -k restart
  ;;

status)
  statusproc /usr/local/apache2/bin/httpd
  ;;
  
*)
  echo "Usage: $0 {start|stop|restart|status}"
  exit 1
  ;;
Esac

注意:#description:http server 这一行必须加上,否则在执行命令 # chkconfig –add httpd 时会出现“service apache does not support chkconfig”的错误报告。#chkconfig: 2345 98 98 表示在执行命令 # chkconfig –add httpd 时会在目录 /etc/rc2.d/ 、/etc/rc3.d/ /etc/rc5.d 分别生成文件 S98httpd和 K98httpd。这个数字可以是别的。

6、   执行命令 # chkconfig –add httpd ,进入目录/etc/rc3.d/检查是否生成文件 S98httpd及K98httpd.
7、   启动服务 # service httpd start .
所属分类: 工具使用     网摘收藏: Google 雅虎 百度 POCO 365key 和讯 天极