Linux下安装多个apache,linux多个apache


完整安装一个apache到/usr/server/apache

复制/usr/server/apache到/usr/server/apache1

修改/usr/server/apache/conf/httpd.conf 监听192.168.1.100

修改/usr/server/apache1/conf/httpd.conf 监听192.168.1.101 ServerRoot 为/usr/server/apache1

vi /usr/server/apache1/bin/apachectl
将里面所有的路径为apache的修改为apache1

vi /usr/server/apache1/bin/envvars
将里面所有的路径为apache的修改为apache1

vi /usr/server/apache1/bin/envvars-std
将里面所有的路径为apache的修改为apache1

创建系统启动文件
vi /usr/server/apache1/bin/apache.sysvinit
==============================================================================
#!/bin/sh
#
# This is a sample /etc/init.d file for apache
#
# chkconfig: 2345 80 30
# description: apache1 - WWW server
#
#
#

prefix=/usr/server/apache1
exec_prefix=/usr/server/apache1
bindir=${exec_prefix}/bin
sbindir=${exec_prefix}/sbin

case "$1" in
start)
    echo -n "Starting apache1 WWW server:"
    /usr/server/apache1/bin/apachectl -f /usr/server/apache1/conf/httpd.conf -k start
    echo -n ""
    ;;
stop)
echo -n "Stopping apache1 WWW server:"
    /usr/server/apache1/bin/apachectl -f /usr/server/apache1/conf/httpd.conf -k stop
    echo -n ""
    ;;
restart)
    $0 stop
    $0 start
;;
esac
exit 0
==============================================================================

cp /usr/server/apache1/bin/apache.sysvinit /etc/rc.d/init.d/httpd1
chmod 755 /etc/rc.d/init.d/httpd1
chkconfig --add httpd1

测试
/etc/init.d/httpd1 start
netstat -ant |grep LISTEN
/etc/init.d/httpd1 stop

相关内容

    暂无相关文章