xampp虛擬主機(jī)如何配置?相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。
成都創(chuàng)新互聯(lián)公司主要為客戶提供服務(wù)項(xiàng)目涵蓋了網(wǎng)頁視覺設(shè)計(jì)、VI標(biāo)志設(shè)計(jì)、全網(wǎng)整合營銷推廣、網(wǎng)站程序開發(fā)、HTML5響應(yīng)式重慶網(wǎng)站建設(shè)公司、手機(jī)網(wǎng)站開發(fā)、微商城、網(wǎng)站托管及成都網(wǎng)站維護(hù)公司、WEB系統(tǒng)開發(fā)、域名注冊、國內(nèi)外服務(wù)器租用、視頻、平面設(shè)計(jì)、SEO優(yōu)化排名。設(shè)計(jì)、前端、后端三個(gè)建站步驟的完善服務(wù)體系。一人跟蹤測試的建站服務(wù)標(biāo)準(zhǔn)。已經(jīng)為生料攪拌車行業(yè)客戶提供了網(wǎng)站營銷服務(wù)。
XAMPP有時(shí)候你需要一些頂級域名訪問方式來訪問你本地的項(xiàng)目也就是虛擬主機(jī)配置,這時(shí)候就需要配置虛擬主機(jī),給你的目錄綁定一個(gè)域名,實(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)行業(yè)資訊頻道,感謝各位的閱讀!
標(biāo)題名稱:xampp虛擬主機(jī)如何配置
網(wǎng)站路徑:http://chinadenli.net/article48/jiichp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、網(wǎng)站制作、、做網(wǎng)站、商城網(wǎng)站、網(wǎng)站維護(hù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)