一台服务器部署多个Apache服务器

### Apache配置

## 从/etc/httpd 复制一个目录,然后如下删除run logs 链接;如:/etc/httpd1

``` bash

cd

rm -rf logs

rm -rf run

mkdir logs

mkdir run

```

## 复制/var/www

``` bash

cp -rp /var/www /var/www1/

```

## 修改复制后的httpd.conf文件:

1. ServerRoot

ServerRoot "/etc/httpd1"

2. 增加

ScoreBoardFile /etc/httpd1/run/httpd.scoreboard

PidFile /etc/httpd1/run/httpd.pid

3. Listen

Listen 81

4. /var/www修改

把/var/www 全部都修改为 /var/www1

### 启动&关闭

ApacheServ1:

httpd -d /etc/httpd -f /etc/httpd/conf/httpd.conf -k start

httpd -d /etc/httpd -f /etc/httpd/conf/httpd.conf -k stop

ApacheServ2:

httpd -d /etc/httpd1 -f /etc/httpd1/conf/httpd.conf -k start

httpd -d /etc/httpd1 -f /etc/httpd1/conf/httpd.conf -k start

你可能感兴趣的:(一台服务器部署多个Apache服务器)