1.下载
2.安装
- gunzip -c httpd-2.2.17.tar.gz | tar -xvf -
- 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
修改以下内容
- DocumentRoot "/export/home/mdcoa"
-
#<Directory "/usr/local/apache2/htdocs">
-
<Directory "/export/home/mdcoa">
-
-
#
-
# PidFile: The file in which the server should record its process
-
# identification number when it starts.
-
#
-
PidFile /var/run/apache2/httpd.pid
-
ErrorLog /var/apache2/logs/error_log
-
CustomLog /var/apache2/logs/access_log common
4.修改启动脚本
vi /lib/svc/method/http-apache2
- #!/sbin/sh
-
#
-
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
-
# Use is subject to license terms.
-
#
-
# ident "@(#)http-apache2 1.2 04/11/11 SMI"
-
#
-
-
. /lib/svc/share/smf_include.sh
-
-
APACHE_HOME=/usr/local/apache2
-
CONF_FILE=/etc/apache2/httpd.conf
-
PIDFILE=/var/run/apache2/httpd.pid # PIDFILE要与httpd.conf中一样
-
-
[ ! -f ${CONF_FILE} ] && exit $SMF_EXIT_ERR_CONFIG
-
-
case "$1" in
-
start)
-
/bin/rm -f ${PIDFILE}
-
/bin/mkdir -p /var/run/apache2
-
ssl=`svcprop -p httpd/ssl svc:/network/http:apache2`
-
if [ "$ssl" = false ]; then
-
cmd="start"
-
else
-
cmd="startssl"
-
fi
-
;;
-
refresh)
-
cmd="graceful"
-
;;
-
stop)
-
cmd="stop"
-
;;
-
*)
-
echo "Usage: $0 {start|stop|refresh}"
-
exit 1
-
;;
-
esac
-
-
exec ${APACHE_HOME}/bin/apachectl $cmd 2>&1
5.启动apache
阅读(1431) | 评论(0) | 转发(0) |