1)ServerRoot參數(shù) 該參數(shù)用于指定Apache軟件安裝的目錄
2)Listen參數(shù) 用于指定Apache所監(jiān)聽的端口,默認情況下Apache的監(jiān)聽端口為80.在服務(wù)器有多個IP地址的情況下,Listen參數(shù)還可以用于設(shè)置監(jiān)聽的Ip地址
3)User和Group參數(shù) 用于指定Apache進程的執(zhí)行者和執(zhí)行者所屬的用戶組,如果要用UIG或者GID,必須在ID前面加上#號
4)ServerAdmin參數(shù) 該參數(shù)用于指定Web管理員的郵箱地址,這個地址會出現(xiàn)在系統(tǒng)連接出錯的時候,以便訪問者能夠及時通知WEB管理員。
5)DocumentRoot參數(shù) 該參數(shù)用于指定Web服務(wù)器上的文檔存放的位置,在未配置任何虛擬主機或虛擬目錄的情況下,用戶通過http訪問WEB服務(wù)器,所有的輸出資料文件均存放在這里。
6)ErrorLog 用于指定記錄,Apache運行過程中所產(chǎn)生的錯誤信息的日志文件位置,方便系統(tǒng)管理員發(fā)現(xiàn)和觖決故障
5、符號鏈接和虛擬目錄
1)虛擬目錄是一種將根目錄以外的內(nèi)容加入到站點中的辦法。設(shè)置方法如下
#使用Alias參數(shù)設(shè)置虛擬目錄和實際目錄的對應(yīng)關(guān)系
Alias /lopn /var/www/lopn
#使用Directory段設(shè)置/var/www//lopn目錄的訪問權(quán)限
……………………………………
?
此時,重啟服務(wù)器,使用 域名或IP/lopn即可訪問
2)符號鏈接:其時符號鏈接所實現(xiàn)的功能和虛擬目錄是完全一樣的,只不過是實現(xiàn)機制不同而已!
還如上例:使用符號鏈接不需要修改配置文件,只需要在 根目錄下創(chuàng)建一個連接 使用如下指令
#ln -s /var/www/lopn lopn
此時即可通過 域名或IP/lopn即可訪問訪問到/var/www/lopn 下的內(nèi)容
6、個人空間
擁有帳號的本地帳號可以利用Apache發(fā)布自己的東西,假設(shè)有一用戶lopn,則其發(fā)布地址為http://主機/~lopn
下面我們開始配置
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disabled root /禁止root用戶發(fā)布
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
#UserDir public_html /去掉注釋符開啟功能,表示個人用戶目錄下的public_html 內(nèi)容發(fā)布
?
接下來要對目錄的權(quán)限進行設(shè)置,如下,apache提供默認設(shè)置,去掉#號即可,如下所示
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow,deny
Allow from all
?
Order deny,allow
Deny from all
?
?
#
這樣就配置好了個人空間。不過設(shè)置的時候注意權(quán)限的設(shè)置
評論