windwos 下 apache 配置多站點

2021-08-07 14:45:14 字數 1466 閱讀 7456

apache版本:httpd-2.4.27-x64-vc14

然後正常安裝

1.host檔案裡面配置

127.0.0.1 www.aaa.com

127.0.0.1 www.bbb.com

127.0.0.1 www.ccc.com

2.修改配置檔案 httpd.conf

documentroot "$/htdocs"

# # possible values for the options directive are "none", "all",

# or any combination of:

# indexes includes followsymlinks symlinksifownermatch execcgi multiviews

## note that "multiviews" must be named *explicitly* --- "options all"

# doesn't give it to you.

## the options directive is both complicated and important. please see

# # for more information.

#options indexes followsymlinks

## allowoverride controls what directives may be placed in .htaccess files.

# it can be "all", "none", or any combination of the keywords:

# options fileinfo authconfig limit

#allowoverride none

## controls who can get stuff from this server.

#require all granted

修改為

servername www.aaa.com:80

documentroot "h:/apacheweb"

options indexes followsymlinks

allowoverride none

require all granted

documentroot "h:/apacheweb"

options indexes followsymlinks

allowoverride none

require all granted

我這裡檔案存放的路徑就用了乙個h:/apacheweb 大家可根據自己情況設定不同的專案所在路徑,目錄下存放乙個index.html靜態頁

3.重啟apache服務

4 訪問 www.aaa.com 和 www.bbb.com 即可

Windwos 下配置多個Apache服務站點

更改第乙個站點的根目錄 在檔案apache2.2 conf httpd.conf中查詢 documentroot 屬性,將後面的路徑改為你的主站點的路徑,如 d www web1 為第二個apache服務建立配置檔案 複製並重命名httpd.conf為web2.conf 舉個例子而已,也可以叫my....

windows下apache虛擬主機的配置

雖然linux和windows配置檔案所在的目錄不同,但是配置檔案是基本相同的,本文以windows為例。一.基於網域名稱的虛擬主機的配置 1.記事本開啟hosts檔案,該檔案在 c windows system32 drivers etc這個資料夾下,在檔案內容的末尾寫入如下內容 127.0.0....

windows下apache虛擬主機的配置

一.基於網域名稱的虛擬主機的配置 1.記事本開啟hosts檔案,該檔案在 c windows system32 drivers etc這個資料夾下,在檔案內容的末尾寫入如下內容 127.0.0.1 不可改 www.fangchan.com 自定義 loadmodule vhost alias mod...