重启 apache 服务器,测试
CentOS 环境下:
让 httpd 监听 8080 端口:
直接修改 /etc/httpd/conf/httpd.conf 配置文件,在 Listen 80 后面添加两行:
| # created by zhongjin on 2016-12-21 冬至 NameVirtualHost *:8080 Listen 8080 |
在 /etc/httpd/vhost-conf.d 下面添加 www-jb51-net-8080.conf
直接复制 www-jb51-net.conf 文件,改名为 www-jb51-net-8080.conf,并修改为:
| <VirtualHost *:8080> #Created by zhongjin on 2016-12-21 冬至 Serveradmin 1054840542@qq.com ServerName www.jb51.net DocumentRoot /home/www/jb51_admin <Directory "/home/www/jb51_admin"> Options FollowSymLinks AllowOverride All #Require all denied Require all granted </Directory> </VirtualHost> |
注意修改的地方!
创建目录 /home/www/jb51_admin,添加文件 index.php,输出 “hello,welcome to jb51background management”。
重启 apache 服务器,测试
后话:
多站点的配置还有另外一种配置,就是通过不同的IP进行多站点的配置,由于我没有进行实验(前面的内容都是LZ 亲身体会过),所以这里就不给出方法了。









