Apache添加多端口及實(shí)現(xiàn)單ip多端口映射的方法
先給大家說(shuō)下apache添加多端口的方法,具體步驟如下所示:
Apache\conf 目錄下
添加端口監(jiān)聽(tīng)
Vhost.conf簡(jiǎn)單寫(xiě)寫(xiě)
下面是有關(guān)apache實(shí)現(xiàn)單ip多端口映射的內(nèi)容
我使用一個(gè)apache服務(wù)器。在我的apache根目錄下有這么幾個(gè)網(wǎng)站,如Test、Child這兩個(gè)文件夾,也就是兩個(gè)網(wǎng)站。我想這樣,當(dāng)我訪問(wèn)http://localhost的時(shí)候就訪問(wèn)Test,當(dāng)我訪問(wèn)http://localhost:8080的時(shí)候就訪問(wèn)Child。
我們需要配置apache。講apache文件夾下的conf中的httpd.conf打開(kāi),搜索Include conf/extra/httpd-vhosts.conf,將前面的注釋去掉。再打開(kāi)conf/extra/httpd-vhosts.conf文件,清除里面的內(nèi)容,這樣寫(xiě)道:
NameVirtualHost *:8080 <VirtualHost *:8080> ServerName localhost ServerAlias localhosts DocumentRoot D:/development/www/Child </VirtualHost> NameVirtualHost *:80 <VirtualHost *:80> ServerName localhost ServerAlias localhost DocumentRoot D:/development/www/Test </VirtualHost>
重啟apache服務(wù)器就ok了。
相關(guān)文章
Linux平臺(tái)Segmentation fault(段錯(cuò)誤)調(diào)試過(guò)程
這篇文章主要介紹了Linux平臺(tái)Segmentation fault(段錯(cuò)誤)調(diào)試過(guò)程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-09-09詳解fedora 開(kāi)啟 apache 并 開(kāi)啟目錄瀏覽模式
這篇文章主要介紹了fedora 開(kāi)啟 apache 并 開(kāi)啟目錄瀏覽模式的相關(guān)資料,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2018-07-07