Centos7 httpd、createrepo安装

1、安装httpd

yum install -y httpd
[root@cdh03 ~]# yum install -y httpd
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: centosh9.centos.org
正在解决依赖关系
--> 正在检查事务
---> 软件包 httpd.x86_64.0.2.4.6-93.el7.centos 将被 安装
--> 正在处理依赖关系 httpd-tools = 2.4.6-93.el7.centos,它被软件包 httpd-2.4.6-93.el7.centos.x86_64 需要
--> 正在处理依赖关系 /etc/mime.types,它被软件包 httpd-2.4.6-93.el7.centos.x86_64 需要
--> 正在检查事务
---> 软件包 httpd-tools.x86_64.0.2.4.6-93.el7.centos 将被 安装
---> 软件包 mailcap.noarch.0.2.1.41-2.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=======================================================================================================================
 Package                      架构                    版本                                 源                     大小
=======================================================================================================================
正在安装:
 httpd                        x86_64                  2.4.6-93.el7.centos                  base                  2.7 M
为依赖而安装:
 httpd-tools                  x86_64                  2.4.6-93.el7.centos                  base                   92 k
 mailcap                      noarch                  2.1.41-2.el7                         base                   31 k

事务概要
=======================================================================================================================
安装  1 软件包 (+2 依赖软件包)

总下载量:2.8 M
安装大小:9.6 M
Downloading packages:
(1/3): httpd-tools-2.4.6-93.el7.centos.x86_64.rpm                                               |  92 kB  00:00:03     
(2/3): mailcap-2.1.41-2.el7.noarch.rpm                                                          |  31 kB  00:00:03     
(3/3): httpd-2.4.6-93.el7.centos.x86_64.rpm                                                     | 2.7 MB  00:00:06     
-----------------------------------------------------------------------------------------------------------------------
总计                                                                                   432 kB/s | 2.8 MB  00:00:06     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : mailcap-2.1.41-2.el7.noarch                                                                        1/3 
  正在安装    : httpd-tools-2.4.6-93.el7.centos.x86_64                                                             2/3 
  正在安装    : httpd-2.4.6-93.el7.centos.x86_64                                                                   3/3 
  验证中      : httpd-tools-2.4.6-93.el7.centos.x86_64                                                             1/3 
  验证中      : mailcap-2.1.41-2.el7.noarch                                                                        2/3 
  验证中      : httpd-2.4.6-93.el7.centos.x86_64                                                                   3/3 

已安装:
  httpd.x86_64 0:2.4.6-93.el7.centos                                                                                   

作为依赖被安装:
  httpd-tools.x86_64 0:2.4.6-93.el7.centos                        mailcap.noarch 0:2.1.41-2.el7                       

完毕!

2、启用htttpd

service httpd start
[root@cdh03 ~]# service httpd start
Redirecting to /bin/systemctl start httpd.service
[root@cdh03 ~]#

3、打开IP地址验证,出现以下界面及配置成功

http://192.168.43.103

 

 4、 设置httpd服务开机自启

systemctl enable httpd.service
[root@cdh03 html]# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@cdh03 html]# 

 5、安装createrepo

[root@cdh03 mysql80]# yum -y install  createrepo
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: centosc6.centos.org
正在解决依赖关系
--> 正在检查事务
---> 软件包 createrepo.noarch.0.0.9.9-28.el7 将被 安装
--> 正在处理依赖关系 python-deltarpm,它被软件包 createrepo-0.9.9-28.el7.noarch 需要
--> 正在处理依赖关系 deltarpm,它被软件包 createrepo-0.9.9-28.el7.noarch 需要
--> 正在检查事务
---> 软件包 deltarpm.x86_64.0.3.6-3.el7 将被 安装
---> 软件包 python-deltarpm.x86_64.0.3.6-3.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=======================================================================================================================
 Package                          架构                    版本                             源                     大小
=======================================================================================================================
正在安装:
 createrepo                       noarch                  0.9.9-28.el7                     base                   94 k
为依赖而安装:
 deltarpm                         x86_64                  3.6-3.el7                        base                   82 k
 python-deltarpm                  x86_64                  3.6-3.el7                        base                   31 k

事务概要
=======================================================================================================================
安装  1 软件包 (+2 依赖软件包)

总下载量:207 k
安装大小:558 k
Downloading packages:
(1/3): deltarpm-3.6-3.el7.x86_64.rpm                                                            |  82 kB  00:00:00     
(2/3): python-deltarpm-3.6-3.el7.x86_64.rpm                                                     |  31 kB  00:00:00     
(3/3): createrepo-0.9.9-28.el7.noarch.rpm                                                       |  94 kB  00:00:00     
-----------------------------------------------------------------------------------------------------------------------
总计                                                                                   226 kB/s | 207 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
** 发现 2 个已存在的 RPM 数据库问题, 'yum check' 输出如下:
2:postfix-2.10.1-9.el7.x86_64 有缺少的需求 libmysqlclient.so.18()(64bit)
2:postfix-2.10.1-9.el7.x86_64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit)
  正在安装    : deltarpm-3.6-3.el7.x86_64                                                                          1/3 
  正在安装    : python-deltarpm-3.6-3.el7.x86_64                                                                   2/3 
  正在安装    : createrepo-0.9.9-28.el7.noarch                                                                     3/3 
  验证中      : createrepo-0.9.9-28.el7.noarch                                                                     1/3 
  验证中      : deltarpm-3.6-3.el7.x86_64                                                                          2/3 
  验证中      : python-deltarpm-3.6-3.el7.x86_64                                                                   3/3 

已安装:
  createrepo.noarch 0:0.9.9-28.el7                                                                                     

作为依赖被安装:
  deltarpm.x86_64 0:3.6-3.el7                            python-deltarpm.x86_64 0:3.6-3.el7                           

完毕!

 创建一个repo

[root@cdh02 yum.repos.d]# pwd
/etc/yum.repos.d
[root@cdh02 yum.repos.d]# cat cloudera-repo.repo 
[cloudera-repo]
name=cloudera-repo
baseurl=http://192.168.43.103/cm6/
enabled=1
gpgcheck=0

刷新

[root@cdh02 yum.repos.d]# yum clean all && yum makecache
已加载插件:fastestmirror
正在清理软件源: base cloudera-repo cloudera-repo-cdh extras updates
已加载插件:fastestmirror
Determining fastest mirrors
 * base: mirrors.nju.edu.cn
 * extras: mirrors.nju.edu.cn
 * updates: mirrors.nju.edu.cn
base                                                                                            | 3.6 kB  00:00:00     
cloudera-repo                                                                                   | 2.9 kB  00:00:00     
cloudera-repo-cdh                                                                               | 2.9 kB  00:00:00     
extras                                                                                          | 2.9 kB  00:00:00     
updates                                                                                         | 2.9 kB  00:00:00     
(1/16): cloudera-repo/filelists_db                                                              | 102 kB  00:00:00     
(2/16): cloudera-repo/primary_db                                                                | 6.6 kB  00:00:00     
(3/16): cloudera-repo/other_db                                                                  |  864 B  00:00:00     
(4/16): cloudera-repo-cdh/filelists_db                                                          |  586 B  00:00:00     
(5/16): cloudera-repo-cdh/primary_db                                                            | 1.1 kB  00:00:00     
(6/16): cloudera-repo-cdh/other_db                                                              |  575 B  00:00:00     
(7/16): base/7/x86_64/group_gz                                                                  | 153 kB  00:00:03     
(8/16): extras/7/x86_64/filelists_db                                                            | 217 kB  00:00:03     
(9/16): extras/7/x86_64/other_db                                                                | 124 kB  00:00:00     
(10/16): base/7/x86_64/primary_db                                                               | 6.1 MB  00:00:05     
(11/16): updates/7/x86_64/primary_db                                                            | 3.8 MB  00:00:01     
(12/16): updates/7/x86_64/filelists_db                                                          | 2.1 MB  00:00:03     
(13/16): updates/7/x86_64/other_db                                                              | 314 kB  00:00:00     
(14/16): extras/7/x86_64/primary_db                                                             | 206 kB  00:00:04     
(15/16): base/7/x86_64/other_db                                                                 | 2.6 MB  00:00:10     
(16/16): base/7/x86_64/filelists_db                                                             | 7.1 MB  00:00:12     
元数据缓存已建立
[root@cdh02 yum.repos.d]# 

 

 

 

posted @ 2020-08-07 22:24  桥头堡洗脚城  阅读(2605)  评论(0编辑  收藏  举报