认识apache
认识apache
1.http协议
http协议,全称HyperText Transfer Protocol,中文名称超文本传输协议,是互联网应用最为广泛的一种网络协议,所有的www都必须遵守这个标准,设计http最初的目的为了提供一种发布和接收HTML(一种页面标记语言)
2.web服务器介绍
万维网又称web(world wide web,www),是在internet上以超文本为基础形成的信息网,用户可以通过浏览器可以访问web服务器上面的信息资源
3.web工作原理
web系统是客户端/服务端的C/S架构,所以有服务器端端和客户端程序两个部分,常用的服务器端软件有Apache,IIS,nginx等,常见的客户端浏览器有IE,Mozilla等,用户在浏览器地址栏中输入资源定位地址(URL)来访问web页面
web页面是以超文本标记语言(HTML)进行编写,它是文本不在是传统的书页方式文本,而是可以在浏览器上面从一个页面跳转到另一个页面,使用HTML语言编制的web除了文本意外还可以嵌入视频,音乐,图象等
4.一次完整的Http请求处理过程
(1) 建立或处理连接请求; (2) 接收请求; (3) 解析请求,处理请求; (4) 加载用户请求的资源; (5) 构建响应报文; (6) 发送响应报文; (7) 记录访问于日志中;
5.访问错误码
1xx:
2xx: 成功响应
3xx: 重定向响应
4xx: 客户端错误
5xx: 服务端错误
6.安装apache

httpd:安装主程序包
httpd-devel:安装开发模块用的(一般都不用)
7.查看相关信息

8.httpd.conf 主配置文件
root@Cassandra conf]# egrep -v "(^$|.*#)" httpd.conf ServerRoot "/etc/httpd" #配置文件的路径 Listen 80 #监听的端口
Include conf.modules.d/*.conf #加载模块文件 User apache #用户 Group apache #用户组 ServerAdmin root@localhost #管理的员的邮箱 <Directory /> AllowOverride none #AllowOverride控制的指令可能包含在.htaccess文件中 Require all denied #下面的指令控制谁能从这台服务器上获取东西 </Directory> DocumentRoot "/var/www/html" #站点目录 <Directory "/var/www"> AllowOverride None Require all granted </Directory> <Directory "/var/www/html"> Options Indexes FollowSymLinks #Options Indexes 目录浏览 FollowSymLinks用连接浏览
AllowOverride None Require all granted/denied #最大区别在这里apache2.2和2.4最大区别在这里 </Directory> <IfModule dir_module> #开启的模块 DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error_log" LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module> ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" </IfModule> <Directory "/var/www/cgi-bin"> AllowOverride None Options None Require all granted </Directory> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 ##支持的语言,默认编码
<IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> EnableSendfile on IncludeOptional conf.d/*.conf #conf.d里面的conf文件也属有效配置文件
7.启动apahce

、
ptions Indexes 目录浏览
浙公网安备 33010602011771号