欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

安全配置和維護Apache WEB Server(4)_Windows教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!
(1)Apache服務(wù)器的設(shè)置

 

  apache服務(wù)器采用默認(rèn)配置。主目錄為/home/httpd/html,主機域名為Phoenix.XXXX.com,且別名到www.XXXX.com中,并且設(shè)置srm.conf加一行別名定義如下: 
  Alias/pub/home/ftp/pub/ 

  更改默認(rèn)應(yīng)用程序類型定義如下: 
 
  DefaultType application/octet-stream 

  最后在/etc/httpd/conf/access.conf中增加一項定義 

  Options Indexes 
  AllowOverride AuthConfig 
  order allow,deny 
  allow from all 

  注:Options Indexes允許在找不到index.html文件的情況下允許列出目錄/文件列表。AllowOverride AuthConfig允許做基本的用戶名和口令驗證。這樣的話,需要在/home/ftp/pub目錄下放入.htaccess,內(nèi)容如下: 

  [root@shopu pub]# more .htaccess 
  AuthName Branch Office Public Software Download Area 
  AuthType Basic 
  AuthUserFile /etc/.usrpasswd 
  require valid-user 

  用# htpasswd -c /etc/.usrpasswd user1  分別創(chuàng)建不同的允許訪問/pub下文件服務(wù)的外部用戶名和口令。 

  (2)在防火墻上配置反向代理技術(shù). 
 
  在/etc/httpd/conf/httpd.conf中加入 NameVirtualHost xxx.xxx.xxx.xxx
  # xxx.xxx.xxx.xxx ----->是防火墻外部在互聯(lián)網(wǎng)上永久IP地址 
  servername www.XXXX.com 
  errorlog /var/log/httpd/error_log 
  transferlog /var/log/httpd/access_log 
  rewriteengine on 
  proxyrequests off 
  usecanonicalname off 
  rewriterule ^/(.*)$ http://xxx.xxx.xx.x/$1 Apache服務(wù)器的IP地址。

  servername http://download.XXXX.com/pub/
  errorlog /var/log/httpd/download/error_log 
  transferlog /var/log/httpd/download/access_log 
  rewriteengine on 
  proxyrequests off 
  usecanonicalname off 
  rewriterule^/(.*)$http://xxx.xxx.xx.x/$1 同上Apache服務(wù)器的IP地址。

  設(shè)置防火墻上的DNS,讓download.XXXX.com和www.XXXX.com都指向防火墻的外部網(wǎng)地址xxx.xxx.xxx.xxx。用http://www.XXXX.com訪問主頁,用http://download.XXXX.com/pub/訪問公共文件的下載區(qū)。

  注:還需要在apache服務(wù)器主機上建立目錄/var/log/httpd/download/,否則會出錯。另外,也可以設(shè)置防火墻主機上的/home/httpd/html/index.html的屬性為750來阻止訪問,這是防外部用戶能訪問到防火墻上的Apache服務(wù)器的http://www.XXXX.com中。

  總結(jié):Apache Server是一個非常優(yōu)秀,非常棒的服務(wù)器,只要你正確配置和維護好Apache服務(wù)器,你就會感受到Apache Server 所帶來的好處。

來源:網(wǎng)絡(luò)搜集//所屬分類:Windows教程/更新時間:2012-06-18
相關(guān)Windows教程