Linux下Apache绑定多个域名
假如你使用的是linux服务器。需要把 www.lezhi.ren 解析到/var/www/liian1
首先你需要找到httpd.conf文件,如果不清楚具体位置,可使用 命令 find -name httpd.conf 查找位置,然后打开
文件,
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
这是实例代码,在这段代码最后添加如下代码
#
# ServerAdmin [email protected]
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#
————————————————————————————————————-
# for lehzi.ren
然后重启apache,在域名商那里解析域名。域名解析成功后,就可以访问啦!