apache绑定多个域名

apache 2.4配置文件 /etc/httpd/conf/httpd.conf

搜了下说要配置NameVirtualHost ,其实根本没必要,建议看下官方文档http://httpd.apache.org/docs/2.4/en/vhosts/name-based.html

我要配置两个域名,分别为btsha.com,piger.cc,直接添加VirtualHost节点信息即可

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
<VirtualHost *:80>
    # This first-listed virtual host is also the default for *:80
    ServerName www.btsha.com
    ServerAlias btsha.com 
    DocumentRoot "/var/www/html"
</VirtualHost>

<VirtualHost *:80>
    ServerName www.piger.cc
    ServerAlias piger.cc
    DocumentRoot "/var/www/h2"
</VirtualHost>

 

转载于:https://www.cnblogs.com/pigercc/p/6485580.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值