apache配置多站點

2021-08-20 06:39:51 字數 1052 閱讀 7543

在 httpd.conf 中找到

配置成:

options followsymlinks execcgi indexes

allowoverride none #這裡是禁止所有訪問

#require all denied

一般的配置,都是在底部引入

includeoptional conf.d/*.conf

而在conf.d/vhosts.conf這個檔案裡首先要配置基本的多站點資訊,還要設定允許訪問的資料夾,如:

serveradmin [email protected]

documentroot

"/home/first/public"

servername test1.dayin1.top

serveralias

errorlog

"logs/dummy-host.localhost-error_log"

#customlog "logs/test1.dayin1.top common"

"/home/first/public">

options indexes followsymlinks

allowoverride all #這個尤其重要,就是允許/

home/first/public 這個目錄下的檔案能被訪問

require all granted

serveradmin [email protected]

documentroot

"/home/index"

servername test2.dayin1.top

errorlog

"logs/dummy-host2.localhost-error_log"

#customlog "logs/test2.dayin1.top common"

"/home">

options indexes followsymlinks

allowoverride all

require all granted

Apache多站點配置

使用本地ip 埠號,或者修改hosts檔案 網域名稱的方法來進行本地多站點web除錯。127.0.0.1 www.def.com 上邊是使用網域名稱的方法。下邊說下如何使用本地ip 埠的方法。例如本機ip為 192.168.0.10 那如何控制 80 1000 1001 1002 來訪問不同的檔案目...

apache多站點配置

首先開啟apache安裝目錄下 conf httpd.conf 檔案,找到下面兩行文字,把最前面的 號去掉,然後儲存。再找到 conf extra httpd vhosts.conf,虛擬主機配置檔案 serveradmin webmaster dummy host.example.com docu...

Apache多站點配置

完成整個站點配置需要設定三個檔案 d documents web ft cc 此處對應站點檔案的位址 possible values for the options directive are none all or any combination of indexes includes follo...