天天看點

網站運維:windows、Linux設定Apache的虛拟主機實作本地網址通路……………………window…………………………1、配置host2、配置……………………Linux…………………………

……………………window…………………………

環境:xampp7.3.5

1、配置host

在windows中,有一個檔案:C:\Windows\System32\drivers\etc\host

添加

127.0.0.1       host.hahaha.com
           
網站運維:windows、Linux設定Apache的虛拟主機實作本地網址通路……………………window…………………………1、配置host2、配置……………………Linux…………………………

2、配置

在D:\xampp\apache\conf\extra\httpd-vhosts.conf

<VirtualHost 127.0.0.1:80>
    ServerAdmin [email protected]
    DocumentRoot "D:/xampp/htdocs/"
    ServerName host.hahaha.com
	
</VirtualHost>
           

……………………Linux…………………………

(未測試)

1、配置hosts檔案

在ubuntu裡面(一般linux都如此),則是在/etc下查找hosts檔案,這個就是相當于那個host檔案一樣的存在。如果沒有的話,就自己建立一個。

2、配置vhosts.conf檔案