xampp虛擬主機(jī)如何配置-創(chuàng)新互聯(lián)

創(chuàng)新互聯(lián)www.cdcxhl.cn八線動態(tài)BGP香港云服務(wù)器提供商,新人活動買多久送多久,劃算不套路!

創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比峨山縣網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式峨山縣網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋峨山縣地區(qū)。費(fèi)用合理售后完善,十載實(shí)體公司更值得信賴。

xampp虛擬主機(jī)如何配置?相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

XAMPP有時候你需要一些頂級域名訪問方式來訪問你本地的項(xiàng)目也就是虛擬主機(jī)配置,這時候就需要配置虛擬主機(jī),給你的目錄綁定一個域名,實(shí)現(xiàn)多域名綁定訪問。

一、修改httpd.conf

文件目錄 xampp => apache =>conf => httpd.conf

1.在文件內(nèi)搜索 關(guān)鍵字“httpd-vhosts.conf”,找到如下字段

# Virtual hosts
Include conf/extra/httpd-vhosts.conf//確保此段開頭沒有#

2.在文件內(nèi)搜索關(guān)鍵字“AllowOverride All”,找到如下字段

<Directory "D:/xampp/cgi-bin">
AllowOverride All
Options None
Require all granted
</Directory>

//修改為
<Directory "D:/xampp/cgi-bin">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

3.搜索字段“DocumentRoot”,如下

DocumentRoot "D:/xampp/htdocs"//確保此處路徑是你要訪問的項(xiàng)目的根路徑

ps:可以配置特定的根路徑,比如: DocumentRoot "D:/www"

二、修改httpd-vhosts.conf

文件目錄 xampp => apache =>conf => extra => httpd-vhosts.conf

文件最后面可看到如下

##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
##DocumentRoot "D:/xampp/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>

1.用ip訪問

<VirtualHost 127.0.0.5:80>//設(shè)置訪問的ip
##ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:/www"//你的項(xiàng)目文件目錄
ServerName testname.dev//此項(xiàng)目的名稱
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

2.用ServerName訪問

<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:/www"//你的項(xiàng)目文件目錄
ServerName testname.dev//此項(xiàng)目的名稱,通過此名稱來訪問項(xiàng)目,還需配置hosts文件
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

3.配置hosts文件

文件目錄 C:\Windows\System32\drivers\etc\hosts
在文件中加入
127.0.0.1 testname.dev

看完上述內(nèi)容,你們掌握xampp虛擬主機(jī)如何配置的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,感謝各位的閱讀!

文章題目:xampp虛擬主機(jī)如何配置-創(chuàng)新互聯(lián)
新聞來源:http://muchs.cn/article4/pchoe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、微信小程序網(wǎng)站設(shè)計(jì)公司、面包屑導(dǎo)航、小程序開發(fā)網(wǎng)站排名

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)