web网站的搭建

[root@localhost 桌面]# mount /dev/sr0/mnt
mount: 在 /etc/fstab 中找不到 /dev/sr0/mnt
[root@localhost 桌面]# mount /dev/sr0 /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost 桌面]# vim /etc/yum
[root@localhost 桌面]# vim /etc/yum.repos.d/base.repo
[root@localhost 桌面]# yum repolist
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
base | 4.1 kB 00:00:00
(1/2): base/group_gz | 136 kB 00:00:00
(2/2): base/primary_db | 3.6 MB 00:00:00
源标识 源名称 状态
base base 4,620
repolist: 4,620
[root@localhost 桌面]# yum install httpd -y
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
正在解决依赖关系
–> 正在检查事务
—> 软件包 httpd.x86_64.0.2.4.6-40.el7 将被 安装
–> 正在处理依赖关系 httpd-tools = 2.4.6-40.el7,它被软件包 httpd-2.4.6-40.el7.x86_64 需要
–> 正在处理依赖关系 libapr-1.so.0()(64bit),它被软件包 httpd-2.4.6-40.el7.x86_64 需要
–> 正在处理依赖关系 libaprutil-1.so.0()(64bit),它被软件包 httpd-2.4.6-40.el7.x86_64 需要
–> 正在检查事务
—> 软件包 apr.x86_64.0.1.4.8-3.el7 将被 安装
—> 软件包 apr-util.x86_64.0.1.5.2-6.el7 将被 安装
—> 软件包 httpd-tools.x86_64.0.2.4.6-40.el7 将被 安装
–> 解决依赖关系完成

依赖关系解决

==========================================================================================
Package 架构 版本 源 大小

正在安装:
httpd x86_64 2.4.6-40.el7 base 1.2 M
为依赖而安装:
apr x86_64 1.4.8-3.el7 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k
httpd-tools x86_64 2.4.6-40.el7 base 82 k

事务概要

安装 1 软件包 (+3 依赖软件包)

总下载量:1.4 M
安装大小:4.3 M
Downloading packages:

总计 19 MB/s | 1.4 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : apr-1.4.8-3.el7.x86_64 1/4
正在安装 : apr-util-1.5.2-6.el7.x86_64 2/4
正在安装 : httpd-tools-2.4.6-40.el7.x86_64 3/4
正在安装 : httpd-2.4.6-40.el7.x86_64 4/4
base/productid | 1.6 kB 00:00:00
验证中 : httpd-tools-2.4.6-40.el7.x86_64 1/4
验证中 : apr-1.4.8-3.el7.x86_64 2/4
验证中 : apr-util-1.5.2-6.el7.x86_64 3/4
验证中 : httpd-2.4.6-40.el7.x86_64 4/4

已安装:
httpd.x86_64 0:2.4.6-40.el7

作为依赖被安装:
apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7
httpd-tools.x86_64 0:2.4.6-40.el7

完毕!
[root@localhost 桌面]# pstree
systemd─┬─ModemManager───2*[{ModemManager}]
├─NetworkManager───2*[{NetworkManager}]
├─abrt-watch-log
├─abrtd
├─accounts-daemon───2*[{accounts-daemon}]
├─alsactl
├─at-spi-bus-laun─┬─dbus-daemon───{dbus-daemon}
│ └─3*[{at-spi-bus-laun}]
├─at-spi2-registr───{at-spi2-registr}
├─atd
├─auditd─┬─audispd─┬─sedispatch
│ │ └─{audispd}
│ └─{auditd}
├─avahi-daemon───avahi-daemon
├─bluetoothd
├─caribou───2*[{caribou}]
├─chronyd
├─colord───2*[{colord}]
├─crond
├─cupsd
├─2*[dbus-daemon───{dbus-daemon}]
├─dbus-launch
├─dconf-service───2*[{dconf-service}]
├─dnsmasq───dnsmasq
├─evolution-calen───5*[{evolution-calen}]
├─evolution-sourc───3*[{evolution-sourc}]
├─firewalld───{firewalld}
├─gconfd-2
├─gdm─┬─Xorg
│ ├─gdm-session-wor─┬─gnome-session─┬─abrt-applet───{abrt-applet}
│ │ │ ├─gnome-settings-───4*[{gnome-settings-}]
│ │ │ ├─gnome-shell─┬─ibus-daemon─┬─ibus-dconf─+++
│ │ │ │ │ ├─ibus-engine+
│ │ │ │ │ └─2*[{ibus-da+
│ │ │ │ └─6*[{gnome-shell}]
│ │ │ ├─gnome-software───3*[{gnome-software}]
│ │ │ ├─nautilus───3*[{nautilus}]
│ │ │ ├─rhsm-icon───{rhsm-icon}
│ │ │ ├─seapplet
│ │ │ ├─ssh-agent
│ │ │ ├─tracker-extract───13*[{tracker-extract}+
│ │ │ ├─tracker-miner-a───2*[{tracker-miner-a}]
│ │ │ ├─tracker-miner-f───3*[{tracker-miner-f}]
│ │ │ ├─tracker-miner-u───2*[{tracker-miner-u}]
│ │ │ └─3*[{gnome-session}]
│ │ └─2*[{gdm-session-wor}]
│ └─3*[{gdm}]
├─gnome-keyring-d───4*[{gnome-keyring-d}]
├─gnome-shell-cal───4*[{gnome-shell-cal}]
├─gnome-terminal-─┬─bash───pstree
│ ├─gnome-pty-helpe
│ └─3*[{gnome-terminal-}]
├─goa-daemon───3*[{goa-daemon}]
├─goa-identity-se───2*[{goa-identity-se}]
├─gsd-printer───{gsd-printer}
├─gssproxy───5*[{gssproxy}]
├─gvfs-afc-volume───2*[{gvfs-afc-volume}]
├─gvfs-goa-volume───{gvfs-goa-volume}
├─gvfs-gphoto2-vo───{gvfs-gphoto2-vo}
├─gvfs-mtp-volume───{gvfs-mtp-volume}
├─gvfs-udisks2-vo───2*[{gvfs-udisks2-vo}]
├─gvfsd───{gvfsd}
├─gvfsd-fuse───4*[{gvfsd-fuse}]
├─gvfsd-metadata───{gvfsd-metadata}
├─gvfsd-trash───2*[{gvfsd-trash}]
├─ibus-x11───2*[{ibus-x11}]
├─irqbalance
├─ksmtuned───sleep
├─libvirtd───15*[{libvirtd}]
├─lsmd
├─lvmetad
├─master─┬─pickup
│ └─qmgr
├─mission-control───2*[{mission-control}]
├─packagekitd───2*[{packagekitd}]
├─polkitd───5*[{polkitd}]
├─pulseaudio───2*[{pulseaudio}]
├─rhnsd
├─rhsmcertd
├─rngd
├─rsyslogd───2*[{rsyslogd}]
├─rtkit-daemon───2*[{rtkit-daemon}]
├─smartd
├─sshd
├─systemd-journal
├─systemd-logind
├─systemd-udevd
├─tracker-store───7*[{tracker-store}]
├─tuned───4*[{tuned}]
├─udisksd───4*[{udisksd}]
├─upowerd───2*[{upowerd}]
├─vmtoolsd───{vmtoolsd}
├─vmtoolsd
└─wpa_supplicant
[root@localhost 桌面]# man systemctl
[root@localhost 桌面]# systemctl start httpd
[root@localhost 桌面]# systemctl restart
Too few arguments.
[root@localhost 桌面]# dhclient
[root@localhost 桌面]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:48:19:f5 brd ff:ff:ff:ff:ff:ff
inet 192.168.37.128/24 brd 192.168.37.255 scope global dynamic eno16777736
valid_lft 1754sec preferred_lft 1754sec
inet6 fe80::20c:29ff:fe48:19f5/64 scope link
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
link/ether 52:54:00:88:68:dc brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 500
link/ether 52:54:00:88:68:dc brd ff:ff:ff:ff:ff:ff
[root@localhost 桌面]# systemstl stop firewalld
bash: systemstl: 未找到命令…
相似命令是: ‘systemctl’
[root@localhost 桌面]# systemctl stop firewalld
[root@localhost 桌面]# setenfoce 0
bash: setenfoce: 未找到命令…
[root@localhost 桌面]# setenforce 0
[root@localhost 桌面]# vim /var/www/html
[root@localhost 桌面]# vim /var/www/html/index.html
[root@localhost 桌面]#
Hhtp
超文本传输协议(HTTP,HyperText Transfer Protocol)是互联网上应用最为广泛的一种网络协议。所有的WWW文件都必须遵守这个标准。设计HTTP最初的目的是为了提供一种发布和接收HTML页面的方法
Web
web(World Wide Web)即全球广域网,也称为万维网,它是一种基于超文本和HTTP的、全球性的、动态交互的、跨平台的分布式图形信息系统。是建立在Internet上的一种网络服务,为浏览者在Internet上查找和浏览信息提供了图形化的、易于访问的直观界面,其中的文档及超级链接将Internet上的信息节点组织成一个互为关联的网状结构
WWW
WWW是环球信息网的缩写,(亦作“Web”、“WWW”、“‘W3’”,英文全称为“World Wide Web”),中文名字为“万维网”,"环球网"等,常简称为Web。 分为Web客户端和Web服务器程序。 WWW可以让Web客户端(常用浏览器)访问浏览Web服务器上的页面。 是一个由许多互相链接的超文本组成的系统,通过互联网访问。
http工作过程
地址解析,
如用客户端浏览器请求这个页面:http://localhost.com:8080/index.htm
(协议)://(主机名或主机地址)(:port)(目录资源路径)
从中分解出协议名、主机名、端口、对象路径等部分,对于我们的这个地址,解析得到的结果如下:
协议名:http
主机名:localhost.com
端口:8080
对象路径:/index.htm
在这一步,需要域名系统DNS解析域名localhost.com,得主机的IP地址。
2.封装HTTP请求数据包
http请求报文由请求行(请求方法,请求地址,协议版本),请求头部(添加一些附加信息,由名或者值组成),空行和请求数(可选部分)据4个部分组成。
把以上部分结合本机自己的信息,封装成一个HTTP请求数据包
3.封装成TCP包,建立TCP连接(TCP的三次握手)
在HTTP工作开始之前,客户机(Web浏览器)首先要通过网络与服务器建立连接,该连接是通过TCP来完成的,该协议与IP协议共同构建Internet,即著名的TCP/IP协议族,因此Internet又被称作是TCP/IP网络。HTTP是比TCP更高层次的应用层协议,根据规则,只有低层协议建立之后才能,才能进行更层协议的连接,因此,首先要建立TCP连接,一般TCP连接的端口号是80。这里是8080端口
4.客户机发送请求命令
建立连接后,客户机发送一个请求给服务器,请求方式的格式为:统一资源标识符(URL)、协议版本号,后边是MIME信息包括请求修饰符、客户机信息和可内容。
5.服务器响应
响应报文主要有状态行,响应头部,空行相应数据组成
服务器接到请求后,给予相应的响应信息,其格式为一个状态行,包括信息的协议版本号、一个成功或错误的代码,后边是MIME信息包括服务器信息、实体信息和可能的内容。
实体消息是服务器向浏览器发送头信息后,它会发送一个空白行来表示头信息的发送到此为结束,接着,它就以Content-Type应答头信息所描述的格式发送用户所请求的实际数据
6.服务器关闭TCP连接
一般情况下,一旦Web服务器向浏览器发送了请求数据,它就要关闭TCP连接
TCP连接在发送后将仍然保持打开状态,于是,浏览器可以继续通过相同的连接发送请求。保持连接节省了为每个请求建立新连接所需的时间,还节约了网络带宽。
Web网站的搭建
搭建环境,搭建架构,客户端网站访问格式,服务端服务搭建执行命令框架(实验已做)

猜你喜欢

转载自blog.csdn.net/qq_43761778/article/details/88424756