天天看點

linux下對Apache 伺服器權限設定指令文法

http://www.usa-idc.com/kb/262.html

//對Apache 伺服器根的通路不生成目錄清單,同時指定錯誤輸出頁面 <LocationMatch "^/$>     Options -Indexes     ErrorDocument 403 /error/noindex.html </LocationMatch>   //不允許每使用者的伺服器配置 <IfModule mod_userdir.c>     UserDir disable </IfModule> //當通路伺服器時,依次查找頁面index.html、index.html.var DirectoryIndex index.html index.html.var   //指定保護目錄配置檔案的名稱 AccessFileName .htaccess   //拒絕通路以.ht 開頭的檔案,即保證.htaccess 不被通路 <Files ~ "^/.ht">     Order allow,deny     Deny from all 第 7 章    配置 Apache伺服器                                   www.huachu.cn   209 </Files>   //指定負責處理 MIME 對應格式的配置檔案的存放位置 TypesConfig /etc/mime.types //指定預設的MIME 檔案類型為純文字或HTML 檔案 DefaultType text/plain   //當mod_mime_magic.c 子產品被加載時,指定 Magic 資訊碼配置檔案的存放位置 <IfModule mod_mime_magic.c>     MIMEMagicFile conf/magic </IfModule>   //隻記錄連接配接Apache 伺服器的IP 位址,而不記錄主機名 HostnameLookups Off //指定錯誤日志存放位置 ErrorLog logs/error_log //指定記錄的錯誤資訊的詳細等級為 warn 級别 LogLevel warn //定義四種記錄日志的格式 LogFormat "%h %l %u %t /"%r/" %>s %b /"%{Referer}i/" /"%{User-Agent}i/"" combined LogFormat "%h %l %u %t /"%r/" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent //指定通路日志的記錄格式為combined(混合型),并指定通路日志存放位置 CustomLog logs/access_log combined //設定 Apache 自己産生的頁面中使用 Apache 伺服器版本的簽名 ServerSignature On

繼續閱讀