国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Apache > 正文

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

2024-08-27 18:25:53
字體:
來源:轉載
供稿:網友
(1)Apache服務器的設置

 

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

  更改默認應用程序類型定義如下: 
 
  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,內容如下: 

  [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  分別創建不同的允許訪問/pub下文件服務的外部用戶名和口令。 

  (2)在防火墻上配置反向代理技術. 
 
  在/etc/httpd/conf/httpd.conf中加入 NameVirtualHost xxx.xxx.xxx.xxx
  # xxx.xxx.xxx.xxx ----->是防火墻外部在互聯網上永久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服務器的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服務器的IP地址。

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

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

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宜州市| 宝兴县| 汉沽区| 同江市| 鄂伦春自治旗| 永济市| 育儿| 香河县| 铁力市| 东乡族自治县| 灵宝市| 于田县| 青阳县| 沿河| 平果县| 昌宁县| 隆林| 昭通市| 佛冈县| 舟曲县| 江达县| 平定县| 花垣县| 孟津县| 彰化市| 若尔盖县| 寿光市| 闽侯县| 乐亭县| 大丰市| 浦江县| 本溪市| 琼结县| 乌拉特中旗| 临安市| 公安县| 喀喇| 桐城市| 横峰县| 湖口县| 邵阳县|