配置和维护Apache WEB Server 安全性

豆豆网   技术应用频道   2007年03月11日  【字号: 收藏本文

本文详细介绍配置和维护Apache WEB Server 安全性

  用# htpasswd -c /etc/.usrpasswd user1  分别创建不同的允许访问/pub下文件服务的外部用户名和口令。 

  (2)在防火墙上配置反向代理技术. 

  在/etc/httpd/conf/httpd.conf  中加入 NameVirtualHost xxx.xxx.xxx.xxx 

  # xxx.xxx.xxx.xxx ----->是防火墙外部在互联网上永久IP地址

  servername www.your.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.your.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.your.com和www.your.com都指向防火墙的外部网地址xxx.xxx.xxx.xxx。用http://www.your.com访问主页,用http://download.your.com/pub/访问公共文件的下载区。

  注:还需要在apache服务器主机上建立目录/var/log/httpd/download/,否则会出错。另外,也可以设置防火墙主机上的/home/httpd/html/index.html的属性为750来阻止访问,这是防外部用户能访问到防火墙上的Apache服务器的http://www.your.com中。 

  总结:Apache Server是一个非常优秀,非常棒的服务器,只要你正确配置和维护好Apache服务器

责编:豆豆技术应用

正在加载评论...