Chinaunix首页 | 论坛 | 博客
  • 博客访问: 412329
  • 博文数量: 77
  • 博客积分: 2303
  • 博客等级: 大尉
  • 技术积分: 808
  • 用 户 组: 普通用户
  • 注册时间: 2004-11-30 09:15
文章存档

2015年(1)

2013年(3)

2012年(2)

2011年(46)

2009年(4)

2008年(2)

2005年(12)

2004年(7)

我的朋友

分类: 系统运维

2011-02-25 14:31:37

1.下载


2.安装
  1. gunzip -c httpd-2.2.17.tar.gz | tar -xvf -

  2. CC=cc;export CC
    crle -u -l /usr/ucblib
    ./configure --prefix=/usr/local/apache2  --sysconfdir=/etc/apache2 --enable-so --enable-rewrite --enable-shared=max
    make
    make install
3.配置apache
vi /etc/apache2/httpd.conf
修改以下内容
  1. DocumentRoot "/export/home/mdcoa"
  2. #<Directory "/usr/local/apache2/htdocs">
  3. <Directory "/export/home/mdcoa">

  4. #
  5. # PidFile: The file in which the server should record its process
  6. # identification number when it starts.
  7. #
  8. PidFile /var/run/apache2/httpd.pid
  9. ErrorLog /var/apache2/logs/error_log
  10. CustomLog /var/apache2/logs/access_log common
4.修改启动脚本
vi /lib/svc/method/http-apache2

  1. #!/sbin/sh
  2. #
  3. # Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  4. # Use is subject to license terms.
  5. #
  6. # ident "@(#)http-apache2 1.2 04/11/11 SMI"
  7. #

  8. . /lib/svc/share/smf_include.sh

  9. APACHE_HOME=/usr/local/apache2
  10. CONF_FILE=/etc/apache2/httpd.conf
  11. PIDFILE=/var/run/apache2/httpd.pid # PIDFILE要与httpd.conf中一样

  12. [ ! -f ${CONF_FILE} ] && exit $SMF_EXIT_ERR_CONFIG

  13. case "$1" in
  14. start)
  15.         /bin/rm -f ${PIDFILE}
  16.         /bin/mkdir -p /var/run/apache2
  17.         ssl=`svcprop -p httpd/ssl svc:/network/http:apache2`
  18.         if [ "$ssl" = false ]; then
  19.                 cmd="start"
  20.         else
  21.                 cmd="startssl"
  22.         fi
  23.         ;;
  24. refresh)
  25.         cmd="graceful"
  26.         ;;
  27. stop)
  28.         cmd="stop"
  29.         ;;
  30. *)
  31.         echo "Usage: $0 {start|stop|refresh}"
  32.         exit 1
  33.         ;;
  34. esac

  35. exec ${APACHE_HOME}/bin/apachectl $cmd 2>&1
5.启动apache
  1. svcadm enable apache2

阅读(1381) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~