WEB服务器软件:
httpd
lighttpd
thttpd
nginx
应用程序服务器:
IIS
Webspere
Weblogic
Fusion middleware
tomcat, resin
HTTP/1.1定义8种动作表明URI指定资源不同操作方式:
OPTIONS, HEAD, GET, POST, PUT, DELETE, TRACE, CONNECT
3xx 错误跳转:
www.a.com/index.html-->www.b.net/index.html
MIME: Multipurpose Internet Mail Extension
LDAP: 轻量级目录访问协议
httpd
a patchy server --> apache
配置文件:/etc/httpd/conf/httpd.conf
目录文件:/var/www/html
CGI,mod_perl
Options execcgi,indexes
DirectoryIndex index.jsp index.html index.html.var
测试主配置文件:
service -t
service httpd configtest
ACL:
<Directory "/var/www/html">
order allow,deny
</Directory>
/var/www/html
a b c index.html
.htaccess 单目录认证在相应目录下创建文件
htpasswd
-c create
-m md5
用户认证方式访问:
vim /etc/httpd/conf/httpd.conf
AllowOverride Authconfig
AuthName "Give me some money..."
AuthType basic
AuthUserFile /etc/httpd/.htpasswd
require user user_name user_name
htpasswd -cm /etc/httpd/.htpasswd user_name
htpasswd -m /etc/httpd/.htpasswd user_name 第二次不加-c
虚拟主机:
一个web服务器,同时提供多个网站服务
基于IP
基于端口
基于主机名
把中心主机取消或做一个虚拟主机
DocumentRoot 注释掉
配置虚拟主机
<VirtualHost IP:port>
DocumentRoot "/www/a.com"
ServerName www.a.com
ServerAdmin
Errorlog /var/log/httpd/a.com-err
CustomLog /var/log/httpd/a.com-access combined
<directory "/www/a.com">
Optioms Indexes
AllowOverride None
Order allow,deny
Allow from all
</VirtualHost>
https不支持基于主机名的虚拟主机,ssl