apache的网页安全设置

1. 限制IP访问

使用deny和allow来设定允许和不允许访问网页的IP段。

Order deny,allow:以 deny 优先处理,但没有写入规则的则默认为 allow 。常用于:拒绝所有,开放特定的条件;
Order allow,deny:以 allow 为优先处理,但没有写入规则的则默认为 deny。 常用于:开放所有,拒绝特定的条件。
如果 allow 与 deny 的规则当中有重复的,则以预设的情况 (Order 的规范) 为主。

一般情况下,这样写,用于不允许某些IP的访问:

<Directory "/var/www/html">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    allow from all
    deny from 192.168.1.0/24
    deny from .gov.tw
</Directory>

2. 设置保护网页的用户名密码访问

2.1 修改/etc/httpd/conf/httpd.conf文件

[root@linux ~]# vi /etc/httpd/conf/httpd.conf
# 确定底下这几行是存在的!
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# 在某个不受影响的地方加入这一段:
<Directory "/var/www/html/protect">
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
</Directory>

[root@linux ~]# apachectl restart  <==重新启动,不要忘记了!

2.2 在保护目录下建立.htaccess 档案

[root@linux ~]# cd /var/www/html/protect
[root@linux ~]# vi .htaccess
# 只要加入底下这几行即可
AuthName     "Protect test by .htaccess"
Authtype     Basic
AuthUserFile /var/www/apache.passwd
require user test

2.3 建立密码档案 htpasswd

Apache 默认读取的账号/密码设定数据是由 htpasswd 所建立的,这个指令的语法是这样的:

[root@linux ~]# htpasswd [-c] 密码文件文件名 用户账号
参数:
-c :建立后面的密码档案。如果该档案已经存在,则原本的数据会被删除!
     所以如果只是要新增使用者(档案已存在时),不必加上 -c 的参数!

1. 建立 apache.passwd ,账号为 test
[root@linux ~]# htpasswd -c /var/www/apache.passwd test
New password:  <==这里输入一次密码,注意,屏幕不会有任何讯息。
Re-type new password:  <==这里再输入一次
Adding password for user test

[root@linux ~]# cat /var/www/apache.passwd
test:FIquw/..iS4yo   <==您瞧瞧!已经建立一个新使用者!

2. 在已存在的 apache.passwd 内增加 test1 这个账号:
[root@linux ~]# htpasswd /var/www/apache.passwd test1

Pfam

1. simple introduction

The Pfam database is a large collection of protein families, each represented by multiple sequence alignments and hidden Markov models (HMMs).

There are two components to Pfam: Pfam-A and Pfam-B. Pfam-A entries ara high quality, manually curated families. Pfam-B families are of lower quality, but can be useful for identifying functionally conserved regions when no Pfam-A entries are found.

Pfam also generates higher-level groupings of related families, known as clans. A clan is a collection of Pfam-A entries which are related by similarity of sequence, structure of profile-HMM.

2. citation

Bateman A, Coin L, Durbin R, et al. The Pfam protein families database[J]. Nucleic acids research, 2004, 32(suppl 1): D138-D141.

The latest version of Pfam is release 27.0, which contains 14,831 manually curated protein families.

3.