apache的配置參數
一、DocumentRoot "/www/"
DocumentRoot定義這個服務器對外發布的超文本文檔存放的路徑,客戶程序請求的UR L就被映射爲這個目錄下的網頁文件。這個目錄下的子目錄,以及使用
符號連接指出的文件和目錄都能被瀏覽器訪問,只是要在URL上使用同樣的相對目錄名。
二、ServerName new.host.name:80
三、DirectoryIndex:添加默認首頁:
DirectoryIndex index.php index.php3 index.htm index.html
四:添加解析PHP的MIME類型:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
五、綁定多域名:
NameVirtualHost 192.168.11.11
<VirtualHost 192.168.11.11>
DocumentRoot /var/www/html/avnads
ServerName www.avnads.cn
</VirtualHost>
<VirtualHost 192.168.11.11>
DocumentRoot /var/www/html/britepic
ServerName www.britepic.org
</VirtualHost>
注意,以上www.avnads.cn和www.britepic.org最好設置爲一些互聯網上沒有的域名!
重啓httpd服務!
在客戶端設置一下host文件:
192.168.11.11 www.avnads.cn
192.168.11.11 www.britepic.org
保存後,就可以打開瀏覽器訪問www.avnads.cn和www.britepic.org了。
DocumentRoot定義這個服務器對外發布的超文本文檔存放的路徑,客戶程序請求的UR L就被映射爲這個目錄下的網頁文件。這個目錄下的子目錄,以及使用
符號連接指出的文件和目錄都能被瀏覽器訪問,只是要在URL上使用同樣的相對目錄名。
二、ServerName new.host.name:80
三、DirectoryIndex:添加默認首頁:
DirectoryIndex index.php index.php3 index.htm index.html
四:添加解析PHP的MIME類型:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
五、綁定多域名:
NameVirtualHost 192.168.11.11
<VirtualHost 192.168.11.11>
DocumentRoot /var/www/html/avnads
ServerName www.avnads.cn
</VirtualHost>
<VirtualHost 192.168.11.11>
DocumentRoot /var/www/html/britepic
ServerName www.britepic.org
</VirtualHost>
注意,以上www.avnads.cn和www.britepic.org最好設置爲一些互聯網上沒有的域名!
重啓httpd服務!
在客戶端設置一下host文件:
192.168.11.11 www.avnads.cn
192.168.11.11 www.britepic.org
保存後,就可以打開瀏覽器訪問www.avnads.cn和www.britepic.org了。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.