中国站长下载-为中国站长提供最好最全的建站资源! 首 页发布资源有事留言繁體中文
设为首页
加入收藏
联系我们
 
您当前的位置:中国站长下载 -> 文章中心 -> 服务器区 -> Windows -> 文章内容  虚拟主机 域名注册 退出登录 用户管理
栏目导航
· Web · Ftp
· Mail · Dns
· Windows · Linux
· 代理服务器 · 其他相关
热门文章
· sndvol32 - sndvol3...
· [组图] FLASH:《大话李白》...
· 个人网站到底能赚多...
· [图文] Rundll.exe是病毒吗...
· [组图] Flash:制作MV
· 价值12万元的网站SE...
· 网站创业者,你需要...
· 一个成功的网站设计...
· [图文] FLASH:韩国导航条解...
· 中国网站的赚钱模式...
相关文章
· [组图] Dreamweaver4使用技...
· Dreamweaver4探谜系...
· Dreamweaver4探谜系...
· 用Dreamweaver4添加...
· [组图] 巧用Dreamweaver4文...
· 服务器安全配置实践...
· Win2000+IIS 5.0安全...
· Win2000+IIS 5.0安全...
· Win2000+IIS 5.0安全...
· Win2000+IIS 5.0安全...
安全配置和维护Apache WEB Server(4)
作者:佚名  来源:天极网  发布时间:2004-7-24 7:03:00  发布人:chinazhan

 减小字体 增大字体

(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 所带来的好处。


 
[] [返回上一页] [打 印] [收 藏]
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
中国站长下载
中国站长下载

本页只接受PR>=4 IT类站点连接,申请连接,谢谢您们的支持!希望我们的下载站能够真正帮到中国的站长们!
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图
Copyright © 2005-2006 ChinaZhan.Net. All Rights Reserved .