• HTTP基础概念讲解


    HTTP基础概念讲解

    作者:Danbo 时间:2016-03-17

    1.1、http协议头部:curl -I www.meituan.com

    1.2、静态和动态

    静态网页:纯HTML格式的网页,后台没有数据库,不含程序和不可交互的页面。

    静态网页每个网页都有一个固定的URL,且URL中不包含"?";

    每个静态网页的内容都是保存在网站服务器上的,也就是说每个网页都是一个独立的文件;

    程序在客户浏览器解析,服务端由于不进行解析,因此可以接受更多的并发访问。

    动态网页:网页URL后缀不是以.htm、xml等结尾的,而是以asp、aspx、php、jsp等,并且在URL中常会见到"?"。

    动态网页实际上并不是独立存在于服务器上的网页文件,只有当用户请求时服务器才返回一个完整的网页;

    动态网页中的"?"一般用来传递参数的,对搜索引擎存在一定的问题,而搜索引擎一般不可能从一个网站的数据库中访问全部网页;

    动态网页是在服务端解析。如先利用php引擎解析出客户端能够识别的html代码。

    有关千万级PV/IP 规划高性能高并发网站架构,参考连接:

    http://oldboy.blog.51cto.com/2561410/736710

    Apache基础

    apache是开源的web服务软件,是a patchy server的读音。

    1、首先卸载系统自带的httpd:

    for name in `rpm -qa httpd*` ; do rpm -e --nodeps $name ; done

    然后检查是否卸载干净:rpm -qa | grep httpd*

    2、安装apache,下载源码包。

    我们直接输入apache/bin/apachectl 命令可以查看所有可接的参数,当执行apachectl实际上又是在调用httpd这个脚本。

    [root@centos-linux bin]# ./apachectl 
    Usage: /usr/local/apache2/bin/httpd [-D name] [-d directory] [-f file]
                                        [-C "directive"] [-c "directive"]
                                        [-k start|restart|graceful|graceful-stop|stop]
                                        [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]
    Options:
      -D name            : define a name for use in <IfDefine name> directives
      -d directory       : specify an alternate initial ServerRoot
      -f file            : specify an alternate ServerConfigFile
      -C "directive"     : process directive before reading config files
      -c "directive"     : process directive after reading config files
      -e level           : show startup errors of level (see LogLevel)
      -E file            : log startup errors to file
      -v                 : show version number
      -V                 : show compile settings
      -h                 : list available command line options (this page)
      -l                 : list compiled in modules
      -L                 : list available configuration directives
      -t -D DUMP_VHOSTS  : show parsed settings (currently only vhost settings)
      -S                 : a synonym for -t -D DUMP_VHOSTS
      -t -D DUMP_MODULES : show all loaded modules 
      -M                 : a synonym for -t -D DUMP_MODULES
      -t                 : run syntax check for config files
      -T                 : start without DocumentRoot(s) check

    启动httpd:/application/apache/bin/apachectl start

    然后查看端口:netstat -lnt

    然后利用lsof查看80端口是否被httpd服务占用:lsof -i tcp:80

    查看进程:ps -ef | grep http

    此时浏览器输入ip地址:出现It works!代表安装成功:

    如果没出现上述结果,我们的排查顺序:

    1.查看防火墙是否关闭:setenforce 0 #临时关闭。永久关闭:chkconfig iptables off

    2.查看80端口是否存在:netstat -lnt | grep 80

    3.查看httpd进程是否存在:ps -ef | grep http

    4.在服务器本地wget 10.211.55.5

    5.查看apache的错误日志:tail -100 /application/apache/logs/error_log

    **********

  • 相关阅读:
    spring中@Lookup的作用
    spring中的观察者模式
    spring事务源码解析
    spring中@Configuration注解的作用
    HTML5和CSS3
    TCP/IP协议
    Android项目的settings.gradle和build.gradle
    AndroidManifest.xml 最全详解
    Android实现网络监听
    Android数据存取
  • 原文地址:https://www.cnblogs.com/danbo/p/5287769.html
Copyright © 2020-2023  润新知