Appach服务器怎么让IP绑定多个域名
云計算
本篇內容介紹了“Appach服務器怎么讓IP綁定多個域名”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
1.開發好自己的網站放到D盤下
例如:D:/new.html
2.打開appcah服務器的httpd.conf文件
例如我的文件保存在:D:\\EmpireServer\\php\\apache2.2\\conf中
(1)找到DocumentRoot
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#注銷掉DocumentRoot
#DocumentRoot "D:/EmpireServer/web"
#
# Each directory to which Apache has access can be configured with respect
(2)找到虛擬機配置
# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf
# Virtual hosts啟用虛擬主機配置
Include conf/extra/httpd-vhosts.conf
3.打開httpd-vhosts.conf文件(位置在conf/extra/httpd-vhosts.conf)
#你的項目位置
DocumentRoot "D:/"
#你想取的域名(注意這里會和下面的hosts文件中名字相同)
ServerName www.myself.com
#你的在瀏覽器中輸入域名首先要打開的文件
DirectoryIndex new.html
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
4.配置hosts文件(文件位置:C:\\Windows\\System32\\drivers\\etc\\)
文件最后加上 :127.0.0.1 域名
5.在瀏覽器中輸入:域名 即可訪問D盤下的new.html文件了。
“Appach服務器怎么讓IP綁定多個域名”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
總結
以上是生活随笔為你收集整理的Appach服务器怎么让IP绑定多个域名的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux如何删除日志
- 下一篇: 怎么部署一个Hello World Se