在日常的網(wǎng)站發(fā)布中很多情況下都無法做到一個IP對應(yīng)一個站點,在IP4的情況下IP的資源是相對有限的。然而作為最流行的Apache自然也考慮到這種情況,那么接下來看看apache服務(wù)器怎么配置一個IP多個站點。
10年積累的做網(wǎng)站、成都做網(wǎng)站經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識你,你也不認(rèn)識我。但先制作網(wǎng)站后付款的網(wǎng)站建設(shè)流程,更有欒城免費網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。在httpd.conf中找到 "# Virtual hosts",并添加如下行
例子
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | NameVirtualHost 192.168.1.104 <VirtualHost 192.168.1.104> ServerName www.php.com ServerAdmin test@gmail.com DocumentRoot /data/www1/ DirectoryIndex index.php index.html index.htm index.shtml Errorlog /usr/local/apache2/logs/wwwError_log Loglevel warn HostNameLookups off <Directory /data/www1/> AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost 192.168.1.104> ServerName bbs.php.com ServerAdmin test@gmail.com DocumentRoot /data/www2/ DirectoryIndex index.php index.html index.htm index.shtml Errorlog /usr/local/apache2/logs/bbsError_log Loglevel warn HostNameLookups off <Directory /data/www2/> AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> |
上述的例子IP都是192.168.1.104,域名分別是www.php.com和bbs.php.com。因而可知apahce是通過ServerName來識別同一個IP下的不同站點的。
在實際應(yīng)用中你只需要將IP192.168.1.104、域名www.php.com和bbs.php.com分別改成你的IP和域名即可。
網(wǎng)站欄目:Apache服務(wù)器一個IP多個站點的配置方法示例
網(wǎng)頁網(wǎng)址:http://aaarwkj.com/article0/ssgoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、標(biāo)簽優(yōu)化、移動網(wǎng)站建設(shè)、網(wǎng)站設(shè)計、品牌網(wǎng)站建設(shè)、網(wǎng)站營銷
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)