windows下apache配置站點

2022-03-18 05:57:51 字數 2454 閱讀 5358

通過hosts網域名稱對映

#配置 www.moban.com 虛擬主機

#繫結網域名稱

servername www.moban.com

#**根目錄

documentroot "d:\www\moban"

#**預設首頁檔案

directoryindex index.html index.php

#**目錄訪問許可權

options indexes followsymlinks

#允許**空間目錄的分布式配置檔案.htaccess

#對虛擬主機的許可權進行覆蓋

allowoverride all

order deny,allow

allow from all

namevirtualhost *:80

80>servername www.test.com.cn

documentroot

"d:\xampp\htdocs\www\api\public

"directoryindex index.html index.php

namevirtualhost *:80

80>servername www.

666.com

documentroot

"d:\xampp\htdocs\666

"directoryindex index.html index.php

namevirtualhost *:80

80>servername www.

888.com

documentroot

"d:\xampp\htdocs\888

"directoryindex index.html index.php

通過ip

//可能會導致apache啟動過慢

documentroot "d:\www\test_ip"directoryindex index.html index.php

options indexes followsymlinks

allowoverride all

order deny,allow

allow from all

#require all granted

通過相同ip不同埠配置

documentroot "d:\www\test_ip"directoryindex index.html index.php

options indexes followsymlinks

allowoverride all

order deny,allow

allow from all

#require all granted

documentroot "d:\www\moban"directoryindex index.html index.php

options indexes followsymlinks

allowoverride all

order deny,allow

allow from all

#require all granted

預設是沒有開啟其他埠的

如果出現拒絕訪問則需要改httpd.conf檔案

documentroot  "d:\phpstudy\www"

options +indexes +followsymlinks +execcgi

allowoverride all

order allow,deny

allow from all

require

all granted

也有可能是vhost.conf中

options followsymlinks execcgi    //

將 options +indexes +followsymlinks +execcgi //

改為

phpstudy 中

options -indexes -followsymlinks +execcgi  //將

options +indexes +followsymlinks +execcgi  //改為

#

apache載入php模組

phpinidir "c:\wamp\php"

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...

windows下的virtualbox配置串列埠

windows下的virtualbox配置串列埠 因為需要讀取嵌入式裝置串列埠的資料,在virtualbox中啟動想讀物理機的串列埠com1,老是失敗。最後找了下別人講的,有幾個注意的地方,整理放下面。1.先保證usb裝置是啟用的 不知道是不是確定必須要,但我是這樣做的 2.在 設定 系統 擴充套件...