天行健,君子以自强不息;地势坤,君子以厚德载物
当前位置:网站首页 > Linux运维 > 正文

用rpm在centos7.6上安装http服务

作者:jinxijing发布时间:2019-10-04分类:Linux运维浏览:267评论:0


导读:用rpm在centos7.6上安装http服务[root@http~]#mount/dev/cdrom/mnt#挂载光盘mount:/dev/sr0iswrite-...

用rpm在centos7.6上安装http服务

[root@http ~]# mount /dev/cdrom /mnt #挂载光盘

mount: /dev/sr0 is write-protected, mounting read-only

[root@http ~]# cd /mnt

[root@http mnt]# ls httpd-*

ls: cannot access httpd-*: No such file or directory

[root@http mnt]# cd Packages/

[root@http Packages]# ls httpd-*

httpd-2.4.6-88.el7.x86_64.rpm        httpd-manual-2.4.6-88.el7.noarch.rpm

httpd-devel-2.4.6-88.el7.x86_64.rpm  httpd-tools-2.4.6-88.el7.x86_64.rpm

[root@http Packages]# rpm httpd-2.4.6-88.el7.x86_64.rpm

RPM version 4.11.3

Copyright (C) 1998-2002 - Red Hat, Inc.

This program may be freely redistributed under the terms of the GNU GPL

 

Usage: rpm [-aKfgpqVcdLilsiv?] [-a|--all] [-f|--file] [-g|--group] [-p|--package] [--pkgid] [--hdrid]

       [--triggeredby] [--whatrequires] [--whatprovides] [--nomanifest] [-c|--configfiles] [-d|--docfiles]

       [-L|--licensefiles] [--dump] [-l|--list] [--queryformat=QUERYFORMAT] [-s|--state] [--nofiledigest]

       [--nofiles] [--nodeps] [--noscript] [--allfiles] [--allmatches] [--badreloc]

       [-e|--erase <package>+] [--excludedocs] [--excludepath=<path>] [--force]

       [-F|--freshen <packagefile>+] [-h|--hash] [--ignorearch] [--ignoreos] [--ignoresize] [-i|--install]

       [--justdb] [--nodeps] [--nofiledigest] [--nocontexts] [--noorder] [--noscripts] [--notriggers]

       [--nocollections] [--oldpackage] [--percent] [--prefix=<dir>] [--relocate=<old>=<new>]

       [--replacefiles] [--replacepkgs] [--test] [-U|--upgrade <packagefile>+] [--reinstall=<packagefile>+]

       [-D|--define 'MACRO EXPR'] [--undefine=MACRO] [-E|--eval 'EXPR'] [--macros=<FILE:...>] [--noplugins]

       [--nodigest] [--nosignature] [--rcfile=<FILE:...>] [-r|--root ROOT] [--dbpath=DIRECTORY]

       [--querytags] [--showrc] [--quiet] [-v|--verbose] [--version] [-?|--help] [--usage] [--scripts]

       [--setperms] [--setugids] [--conflicts] [--obsoletes] [--provides] [--requires] [--info]

       [--changelog] [--xml] [--triggers] [--last] [--dupes] [--filesbypkg] [--fileclass] [--filecolor]

       [--fscontext] [--fileprovide] [--filerequire] [--filecaps]

[root@http Packages]# rpm -ivh httpd-2.4.6-88.el7.x86_64.rpm

warning: httpd-2.4.6-88.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

error: Failed dependencies:

       /etc/mime.types is needed by httpd-2.4.6-88.el7.x86_64

       httpd-tools = 2.4.6-88.el7 is needed by httpd-2.4.6-88.el7.x86_64

       libapr-1.so.0()(64bit) is needed by httpd-2.4.6-88.el7.x86_64   #https://www.rpmfind.net上查找所在包

       libaprutil-1.so.0()(64bit) is needed by httpd-2.4.6-88.el7.x86_64  #https://www.rpmfind.net上查找所在包

[root@http Packages]# rpm -ivh httpd-tools-2.4.6-88.el7.x86_64.rpm

warning: httpd-tools-2.4.6-88.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

error: Failed dependencies:

       libapr-1.so.0()(64bit) is needed by httpd-tools-2.4.6-88.el7.x86_64

       libaprutil-1.so.0()(64bit) is needed by httpd-tools-2.4.6-88.el7.x86_64

[root@http Packages]# ls apr-*

apr-1.4.8-3.el7_4.1.i686.rpm        apr-devel-1.4.8-3.el7_4.1.x86_64.rpm  apr-util-devel-1.5.2-6.el7.i686.rpm

apr-1.4.8-3.el7_4.1.x86_64.rpm      apr-util-1.5.2-6.el7.i686.rpm         apr-util-devel-1.5.2-6.el7.x86_64.rpm

apr-devel-1.4.8-3.el7_4.1.i686.rpm  apr-util-1.5.2-6.el7.x86_64.rpm

[root@http Packages]# rpm -ivh apr-util-1.5.2-6.el7.x86_64.rpm

warning: apr-util-1.5.2-6.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

error: Failed dependencies:

       libapr-1.so.0()(64bit) is needed by apr-util-1.5.2-6.el7.x86_64

[root@http Packages]# rpm -ivh apr-1.4.8-3.el7_4.1.

apr-1.4.8-3.el7_4.1.i686.rpm    apr-1.4.8-3.el7_4.1.x86_64.rpm  

[root@http Packages]# rpm -ivh apr-1.4.8-3.el7_4.1.

apr-1.4.8-3.el7_4.1.i686.rpm    apr-1.4.8-3.el7_4.1.x86_64.rpm  

[root@http Packages]# rpm -ivh apr-1.4.8-3.el7_4.1.x86_64.rpm

warning: apr-1.4.8-3.el7_4.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

  1:apr-1.4.8-3.el7_4.1              ################################# [100%]

[root@http Packages]# rpm -ivh apr-util-1.5.2-6.el7.x86_64.rpm

warning: apr-util-1.5.2-6.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

  1:apr-util-1.5.2-6.el7             ################################# [100%]

[root@http Packages]# rpm -ivh httpd-tools-2.4.6-88.el7.x86_64.rpm

warning: httpd-tools-2.4.6-88.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

  1:httpd-tools-2.4.6-88.el7         ################################# [100%]

[root@http Packages]# yum search mime.types

Loaded plugins: product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Warning: No matches found for: mime.types

No matches found

[root@http Packages]# yum search mime.types

Loaded plugins: product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Warning: No matches found for: mime.types

No matches found

[root@http Packages]# ls mailcap*

mailcap-2.1.41-2.el7.noarch.rpm

[root@http Packages]# ls mailcap*

mailcap-2.1.41-2.el7.noarch.rpm

[root@http Packages]# rpm -ivh mailcap-2.1.41-2.el7.noarch.rpm

warning: mailcap-2.1.41-2.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

  1:mailcap-2.1.41-2.el7             ################################# [100%]

[root@http Packages]# rpm -ivh httpd-2.4.6-88.el7.x86_64.rpm

warning: httpd-2.4.6-88.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

  1:httpd-2.4.6-88.el7               ################################# [100%]

[root@http Packages]# rpm -q httpd  #安装完成

httpd-2.4.6-88.el7.x86_64

[root@http Packages]# getenforce

Enforcing

[root@http Packages]# vim

-bash: vim: command not found

[root@http Packages]# yum install vim

Loaded plugins: product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

There are no enabled repos.

Run "yum repolist all" to see the repos you have.

To enable Red Hat Subscription Management repositories:

    subscription-manager repos --enable <repo>

To enable custom repositories:

    yum-config-manager --enable <repo>

[root@http Packages]# vi /etc/selinux/comfig

[root@http Packages]# vi /etc/selinux/config

[root@http Packages]# systemctl stop httpd

[root@http Packages]# systemctl start httpd

[root@http Packages]# systemctl status httpd

● httpd.service - The Apache HTTP Server

  Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)

  Active: active (running) since Fri 2019-10-04 01:16:45 CST; 5s ago

    Docs: man:httpd(8)

          man:apachectl(8)

Main PID: 34611 (httpd)

  Status: "Processing requests..."

  CGroup: /system.slice/httpd.service

          ├─34611 /usr/sbin/httpd -DFOREGROUND

          ├─34612 /usr/sbin/httpd -DFOREGROUND

          ├─34613 /usr/sbin/httpd -DFOREGROUND

          ├─34614 /usr/sbin/httpd -DFOREGROUND

          ├─34615 /usr/sbin/httpd -DFOREGROUND

          └─34616 /usr/sbin/httpd -DFOREGROUND

 

Oct 04 01:16:45 http systemd[1]: Starting The Apache HTTP Server...

Oct 04 01:16:45 http httpd[34611]: AH00558: httpd: Could not reliably determine the server's fully quali...ssage

Oct 04 01:16:45 http systemd[1]: Started The Apache HTTP Server.

Hint: Some lines were ellipsized, use -l to show in full.

[root@http Packages]# systemctl status firewalld

● firewalld.service - firewalld - dynamic firewall daemon

  Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

  Active: active (running) since Thu 2019-10-03 23:57:33 CST; 1h 19min ago

    Docs: man:firewalld(1)

Main PID: 8669 (firewalld)

  CGroup: /system.slice/firewalld.service

          └─8669 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

 

Oct 03 23:57:33 http systemd[1]: Starting firewalld - dynamic firewall daemon...

Oct 03 23:57:33 http systemd[1]: Started firewalld - dynamic firewall daemon.

[root@http Packages]# systemctl stop firewalld

[root@http Packages]# systemctl disbale firewalld

Unknown operation 'disbale'.

[root@http Packages]# systemctl disable firewalld

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

至此,rpm安装http服务完成。

我们用浏览器访问验证一下。

标签:rpmcentos7.6httpd


Linux运维排行
动态地球
支付宝领红包

            Windows Server 2016      Windows Server 2019 交流圈
友情链接
持是利
坚就胜