一个IP绑定多个域名(虚拟主机)设置方法
生活随笔
收集整理的這篇文章主要介紹了
一个IP绑定多个域名(虚拟主机)设置方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.事先建立兩個域名站點
分別建立web1和web2站點,分別建立主頁面web1.html和web2.html;
2.在httpd.conf文件中啟用httpd-vhosts.conf
去掉#,即
#Virtual hosts (虛擬主機) Include conf/extra/httpd-vhosts.conf3.設置http-vhosts.conf文件(路徑:X:/ApacheX.X/conf/extra/http-vhosts.conf)
添加以下內容:
#配置虛擬主機 <VirtualHost *:80>DocumentRoot "d:/web1"ServerName www.ayee1.com#配置歡迎首頁面DirectoryIndex web1.html index.html index.htm index.php<Directory />Options FollowSymLinks#不許別人修改網站頁面AllowOverride None#設置訪問權限Order allow,denyAllow from all</Directory> </VirtualHost>#配置虛擬主機 <VirtualHost *:80>DocumentRoot "d:/web2"ServerName www.ayee2.com#配置歡迎首頁面DirectoryIndex web2.html index.html index.htm index.php<Directory />Options FollowSymLinks#不許別人修改網站頁面AllowOverride None#設置訪問權限Order allow,denyAllow from all</Directory> </VirtualHost>4.在hosts文件中添加我們的ip和主機映射關系(路徑:c:/windows/system32/drivers/etc/hosts)
在 127.0.0.1 ?localhost下添加如下地址
127.0.0.1 www.ayee1.com 127.0.0.1 www.ayee2.com配置完成。
現在就可以在同一個ip下訪問兩個域名(www.ayee1.com和www.ayee2.com)站點了。
轉載于:https://www.cnblogs.com/ayee/p/3968988.html
總結
以上是生活随笔為你收集整理的一个IP绑定多个域名(虚拟主机)设置方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 「重点」稻田蟹怎么清洗干净
- 下一篇: 关于监控常见问题以及解决办法 网络监控常