身份验证
AllowOverride all
.htaccess (说明文件) (站点主目录里面)
.htpasswd(账号库)
[root@junjie_www html]# cat .htaccess
authuserfile /var/www/html/.htpasswd
authtype basic
authname "please input your name and password"
require valid-user
[root@junjie_www html]# htpasswd -c .htpasswd qq (首次使用需要-c选项)
[root@junjie_www html]# htpasswd .htpasswd qq1(第二次使用需要-c选项)
客户端测试:出现如下验证信息:(需要输入正确的用户名与密码)

来源控制
【 Order allow,deny
Allow from all】
【Order allow,deny
Allow from 192.168.2.0/24
deny from 192.168.2.1】
【Order deny,allow
Allow from 192.168.2.0/24
deny from 192.168.2.1】
349 <IfModule mod_userdir.c>
355 UserDir disable #用户的目录安全性
362 #UserDir public_html ##打开此行,创建个人主页,取消注释
364 </IfModule>
/var/log/httpd / #日志目录
/home/$USER/public_html/ #都要有可读权限
370 #<Directory /home/*/public_html> #个人目录的安全性
371 # AllowOverride FileInfo AuthConfig Limit #一些限制
372 # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoE xec #一些可用参数
373 # <Limit GET POST OPTIONS>
374 # Order allow,deny
375 # Allow from all
376 # </Limit>
377 # <LimitExcept GET POST OPTIONS>
378 # Order deny,allow
379 # Deny from all
380 # </LimitExcept>
381 #</Directory>
391 DirectoryIndex index.html index.html.var #支持的目录文件
398 AccessFileName .htaccess #用于用户验证的信息
424 DefaultType text/plain
444 HostnameLookups Off
472 ErrorLog logs/error_log
479 LogLevel warn
485 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Ag ent}i\"" combined
486 LogFormat "%h %l %u %t \"%r\" %>s %b" common
487 LogFormat "%{Referer}i -> %U" referer
488 LogFormat "%{User-agent}i" agent
514 CustomLog logs/access_log combined
739 LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW //语言显示的优先级
755 AddDefaultCharset UTF-8 //西欧文字集,若显示中文建议关闭
845 Alias /error/ "/var/www/error/" #错误显示文件
937 #<Proxy *> #apache的代理功能
938 # Order deny,allow
939 # Deny from all
940 # Allow from .example.com
941 #</Proxy>
963 ### Section 3: Virtual Hosts4 # #第三部分配置(虚拟主机)
993 #<VirtualHost *:80>
994 # ServerAdmin webmaster@dummy-host.example.com
995 # DocumentRoot /www/docs/dummy-host.example.com
996 # ServerName dummy-host.example.com
997 # ErrorLog logs/dummy-host.example.com-error_log
998 # CustomLog logs/dummy-host.example.com-access_log common
999 #</VirtualHost>
虚拟主机:
1. 物理目录
2. 虚拟目录
3. 基于ip地址的虚拟主机
4. 基于端口的虚拟主机
5. 基于主机头的虚拟主机
