2010年11月8日 星期一

限制網頁連線範圍 ???????????

範例

mkdir /var/www/html/test1
vi /etc/httpd/conf/httpd.conf
在檔案最後面新增下面區段
<Directory /var/www/html/test1>
Deny from all
Allow from 192.168.1.0/255.255.255.0
Options Indexes FollowSymLinks
</Directory>
/etc/rc.d/init.d/httpd restart
測試:w3m http://IP/test1/
--------------------------------------------------------------------------
實例
#############################################################
#######openwebmail在設定檔最後面加上這一行
ScriptAlias /mail "/var/www/cgi-bin/openwebmail/openwebmail.pl"
##############################################################
## Directives to allow use of AWStats as a CGI
##
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"
##
## This is to permit URL access to scripts/files in AWStats director     y.
##
<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
######sfs3 data#################################################
Alias /upfiles/ "/var/www/html/sfs3/data/"
<Directory "/var/www/html/sfs3/data">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
</Directory>
######life type old new##########################################
<Directory "/var/www/html/blog">
  AllowOverride All
  Options None
  Order allow,deny
  Allow from all
  deny from env=ban
</Directory>
######
######## cyl62 blog
<Directory "/var/www/html/life">
  Options Multiviews
  AllowOverride All
  Order allow,deny
  Allow from all
  deny from env=ban
</Directory>
##################################################################
####### moodle 4images gallery2##############################
<Directory "/var/www/html/moodle">
  AllowOverride All
  Options None
  Order allow,deny
  deny from env=ban
  Allow from all
</Directory>
#
<Directory "/var/www/html/4images">
  AllowOverride All
  Options None
  Order allow,deny
  deny from env=ban
  Allow from all
</Directory>
#
<Directory "/var/www/html/gallery2">
  AllowOverride All
  Options None
  Order allow,deny
  deny from env=ban
  Allow from all
</Directory>
######軟體百視達2005 2007 content 模板######################
<Directory "/home/teacher/e-learning/public_html">
  AllowOverride All
  Options None
  Order deny,allow
  deny from env=ban
  Deny from all
  Allow from 163.17.209.0/24
</Directory>
#
<Directory "/home/teacher/e-learning7/public_html">
  AllowOverride All
  Options None
  Order deny,allow
  deny from env=ban
  Deny from all
  Allow from 163.17.209.0/24
</Directory>
#
<Directory "/home/content/public_html">
  AllowOverride All
  Options None
  Order deny,allow
  deny from env=ban
  Deny from all
  Allow from 163.17.209.0/24
</Directory>
####################################################################

沒有留言:

張貼留言