[root@node ~]# yum -y install httpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-97.el7.centos.5 will be installed
--> Processing Dependency: httpd-tools =2.4.6-97.el7.centos.5 for package: httpd-2.4.6-97.el7.centos.5.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-97.el7.centos.5.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit)for package: httpd-2.4.6-97.el7.centos.5.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit)for package: httpd-2.4.6-97.el7.centos.5.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-97.el7.centos.5 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================
Installing:
httpd x86_64 2.4.6-97.el7.centos.5 updates 2.7 M
Installing for dependencies:
apr x86_64 1.4.8-7.el7 base 104 k
apr-util x86_64 1.5.2-6.el7 base 92 k
httpd-tools x86_64 2.4.6-97.el7.centos.5 updates 94 k
mailcap noarch 2.1.41-2.el7 base 31 k
Transaction Summary
===================================================================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 3.0 M
Installed size: 10 M
Downloading packages:
(1/5): apr-1.4.8-7.el7.x86_64.rpm |104 kB 00:00:00
(2/5): mailcap-2.1.41-2.el7.noarch.rpm |31 kB 00:00:00
(3/5): httpd-2.4.6-97.el7.centos.5.x86_64.rpm |2.7 MB 00:00:00
(4/5): apr-util-1.5.2-6.el7.x86_64.rpm |92 kB 00:00:02
(5/5): httpd-tools-2.4.6-97.el7.centos.5.x86_64.rpm |94 kB 00:00:02
---------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.1 MB/s |3.0 MB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-7.el7.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-97.el7.centos.5.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-97.el7.centos.5.x86_64 5/5
Verifying : apr-1.4.8-7.el7.x86_64 1/5
Verifying : mailcap-2.1.41-2.el7.noarch 2/5
Verifying : httpd-tools-2.4.6-97.el7.centos.5.x86_64 3/5
Verifying : apr-util-1.5.2-6.el7.x86_64 4/5
Verifying : httpd-2.4.6-97.el7.centos.5.x86_64 5/5
Installed:
httpd.x86_64 0:2.4.6-97.el7.centos.5
Dependency Installed:
apr.x86_64 0:1.4.8-7.el7 apr-util.x86_64 0:1.5.2-6.el7 httpd-tools.x86_64 0:2.4.6-97.el7.centos.5 mailcap.noarch 0:2.1.41-2.el7
Complete!
2.启动httpd服务
[root@node ~]# systemctl enable --now httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@node conf.d]# ip addr add 192.168.3.164/24 dev ens33 [root@node conf.d]# ip add |grep ens332: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
inet 192.168.3.166/24 brd 192.168.3.255 scope global noprefixroute dynamic ens33
inet 192.168.3.164/24 scope global secondary ens33