A-A+

Apache配置域名绑定目录

2012年09月29日 Linux, PHP 暂无评论

192.168.100.108服务器apache配置文件开启虚拟主机

启用虚拟目录配置
vi /usr/local/apache2/conf/httpd.conf
去除“#”符号
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

添加虚拟主机配置
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf

添加内容
<VirtualHost *:80>
    DocumentRoot "/var/www/html/jiazhuangxiu/zxhome/"
    ServerName zhuangxiu.jia.com
    DirectoryIndex index.php index.html
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/var/www/html/jiazhuangxiu/zxadmin/"
    ServerName zxadmin.jia.com
    DirectoryIndex index.php
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/var/www/html/jiazhuangxiu/zxshop/"
    ServerName zxshop.jia.com
    DirectoryIndex index.php
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/var/www/html/jiazhuangxiu/test/"
    ServerName test.jia.com
    DirectoryIndex index.php
</VirtualHost>

修改完毕后务必重启apache才能生效

标签:

给我留言

Copyright © 破晓Web实验室 保留所有权利.   Theme  Ality 沪ICP备14044094号

用户登录