������褰�

涓���RPM��绠$��宸ュ��

河渠���疏浚�瑁�����绾у���歌浇RPM潘�浠�

涓���Linux搴��ㄧ�搴��雾�

����婧�浠g��缂�璇�疏浚�瑁�

涓���RPM��绠$��宸ュ��

RPM Pachage Manager��Red Hat���告���虎�琚�浼�澶�Linux��琛��������ㄣ��寤虹��缁�涓����版��搴���浠讹�璇�缁�璁板�潘�浠跺��疏浚�瑁����歌浇绛�����淇℃��锛��藉����ㄥ����潘�浠跺��岛�璧��崇郴��RPM潘�浠跺��涓����藉���煎�濡�涓�锛�
Linux疏浚�瑁���绠$��绋�搴�绮捐��

1���ヨ�㈠凡瀹�瑁���RPM潘�浠朵俊��

�ヨ�㈠凡瀹�瑁���RPM潘�浠跺��璇�娉��煎�濡�涓�锛�
Linux疏浚�瑁���绠$��绋�搴�绮捐��

搴��ㄤ妇渚�锛�

[root@centos01 ~]# rpm -qa  <!--�ヨ�㈡����宸插��瑁���rpm潘�浠朵俊��-->
python2-pyasn1-modules-0.1.9-7.el7.noarch
mesa-libEGL-17.0.1-6.20170307.el7.x86_64
xcb-util-0.4.0-2.el7.x86_64
python-pyblock-0.53-6.el7.x86_64
sysstat-10.1.5-12.el7.x86_64
sos-3.4-6.el7.centos.noarch
xorg-x11-server-Xorg-1.19.3-11.el7.x86_64
libiscsi-1.9.0-7.el7.x86_64
sssd-ldap-1.15.2-50.el7.x86_64
postfix-2.10.1-6.el7.x86_64
��������<!--姝ゅ����ラ�ㄥ����疏浚�-->
[root@centos01 ~]# rpm -q bash    <!--�ヨ�㈠凡瀹�瑁���bash潘�浠跺��-->
bash-4.2.46-28.el7.x86_64
[root@centos01 ~]# rpm -qi bash    <!--�ヨ��bash潘�浠跺����璇�缁�淇℃��-->
Name        : bash
Version     : 4.2.46
Release     : 28.el7
Architecture: x86_64
Install Date: 2019骞�10��23�� ����涓� 22��29��35绉�
Group       : System Environment/Shells
Size        : 3663637
License     : GPLv3+
Signature   : RSA/SHA256, 2017骞�08��10�� ������ 23��03��40绉�, Key ID 24c6a8a7f4a80eb5
Source RPM  : bash-4.2.46-28.el7.src.rpm
Build Date  : 2017骞�08��03�� ������ 05��13��21绉�
Build Host  : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://www.gnu.org/software/bash
Summary     : The GNU Bourne Again shell
Description :
The GNU Bourne Again shell (Bash) is a shell or command language
interpreter that is compatible with the Bourne shell (sh). Bash
incorporates useful features from the Korn shell (ksh) and the C shell
(csh). Most sh scripts can be run by bash without modification.
[root@centos01 ~]# rpm -qa | grep bash
bash-4.2.46-28.el7.x86_64
bash-completion-2.1-6.el7.noarch
[root@centos01 ~]# rpm -ql openssh <!--�ョ��openssh�ㄧ郴缁�涓�疏浚�瑁���������褰�-->
/etc/ssh
/etc/ssh/moduli
/usr/bin/ssh-keygen
/usr/libexec/openssh
/usr/libexec/openssh/ctr-cavstest
/usr/libexec/openssh/ssh-keysign
/usr/share/doc/openssh-7.4p1
/usr/share/doc/openssh-7.4p1/CREDITS
��������<!--姝ゅ����ラ�ㄥ����疏浚�-->

2���ヨ�㈡��浠舵����褰�灞�河渠���涓�RPM潘�浠�

璇�娉��煎�濡�涓�锛�
Linux疏浚�瑁���绠$��绋�搴�绮捐��

搴��ㄤ妇渚�锛�

[root@centos01 ~]# rpm -qf /usr/bin/vim   <!--�ヨ��vim���卞��涓�潘�浠跺��疏浚�瑁���-->
vim-enhanced-7.4.160-2.el7.x86_64
[root@centos01 ~]# rpm -qf /usr/libexec/openssh/  <!--�ョ����缃���浠舵����涓�绋�搴�浣跨��-->
openssh-7.4p1-11.el7.x86_64

3���ヨ�㈡��疏浚�瑁���RPM����浠�

�ヨ�㈡��疏浚�瑁���RPM潘�浠跺��璇�娉��煎�濡�涓�锛�
Linux疏浚�瑁���绠$��绋�搴�绮捐��

搴��ㄤ妇渚�锛�

[root@centos01 ~]# rpm -qpi /mnt/Packages/httpd-2.4.6
-67.el7.centos.x86_64.rpm    
            <!--�ョ��httpd��rpm��璇�缁�淇℃��-->
Name        : httpd
Version     : 2.4.6
Release     : 67.el7.centos
Architecture: x86_64
Install Date: (not installed)
Group       : System Environment/Daemons
Size        : 9823661
License     : ASL 2.0
Signature   : RSA/SHA256, 2017骞�08��11�� ����河渠� 00��40��32绉�, Key ID 24c6a8a7f4a80eb5
Source RPM  : httpd-2.4.6-67.el7.centos.src.rpm
Build Date  : 2017骞�08��04�� ����河渠� 11��21��07绉�
Build Host  : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://httpd.apache.org/
Summary     : Apache HTTP Server
Description :
The Apache HTTP Server is a powerful, efficient, and extensible
web server.
[root@centos01 ~]# rpm -qpl /mnt/Packages/httpd-2.4.6
-67.el7.centos.x86_64.rpm    
          <!--�ョ��httpd��rpm��疏浚�瑁���������褰�-->
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.d/README
/etc/httpd/conf.d/autoindex.conf
/etc/httpd/conf.d/userdir.conf
/etc/httpd/conf.d/welcome.conf
/etc/httpd/conf.modules.d
/etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-dav.conf
/etc/httpd/conf.modules.d/00-lua.conf
/etc/httpd/conf.modules.d/00-mpm.conf
/etc/httpd/conf.modules.d/00-proxy.conf
/etc/httpd/conf.modules.d/00-systemd.conf
/etc/httpd/conf.modules.d/01-cgi.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/magic
/etc/httpd/logs
/etc/httpd/modules
/etc/httpd/run
��������   <!--姝ゅ����ラ�ㄥ����疏浚�-->
[root@centos01 ~]# rpm -qpc /mnt/Packages/httpd-2.4.6
-67.el7.centos.x86_64.rpm    
                <!--�ョ��httpd疏浚�瑁�������缃���浠�-->
/etc/httpd/conf.d/autoindex.conf
/etc/httpd/conf.d/userdir.conf
/etc/httpd/conf.d/welcome.conf
/etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-dav.conf
/etc/httpd/conf.modules.d/00-lua.conf
/etc/httpd/conf.modules.d/00-mpm.conf
/etc/httpd/conf.modules.d/00-proxy.conf
/etc/httpd/conf.modules.d/00-systemd.conf
/etc/httpd/conf.modules.d/01-cgi.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/magic
/etc/logrotate.d/httpd
/etc/sysconfig/htcacheclean
/etc/sysconfig/httpd

河渠���疏浚�瑁�����绾у���歌浇RPM潘�浠�

疏浚�瑁�����绾у���歌浇RPM潘�浠剁��璇�娉��煎���甯哥�ㄩ��椤瑰�涓�锛�
Linux疏浚�瑁���绠$��绋�搴�绮捐��

1��疏浚�瑁�RPM潘�浠�

[root@centos01 ~]# rpm -ivh /mnt/Packages/ntsysv-1.7.4
-1.el7.x86_64.rpm    <!--疏浚�瑁�ntsysv绋�搴�-->
璀���锛�/mnt/Packages/ntsysv-1.7.4-1.el7.x86_64.rpm: 澶�V3 RSA/SHA256 Signature, 瀵��� ID f4a80eb5: NOKEY
��澶�涓�...                          ################################# [100%]
    潘�浠跺�� ntsysv-1.7.4-1.el7.x86_64 宸茬�疏浚�瑁�

缁�广大惧����--force����椤规��寮哄�跺��瑁�����疏浚���rpm潘�浠跺����

2����绾�RPM潘�浠�

[root@centos01 ~]# rpm -U /mnt/Packages/ntsysv-1.7.4-1.el7.x86_64.rpm
璀���锛�/mnt/Packages/ntsysv-1.7.4-1.el7.x86_64.rpm: 澶�V3 RSA/SHA256 Signature, 瀵��� ID f4a80eb5: NOKEY
    潘�浠跺�� ntsysv-1.7.4-1.el7.x86_64 宸茬�疏浚�瑁�

3���歌浇RPM潘�浠�

�歌浇rpm潘�浠跺����璇�娉��煎���杈��╅��椤瑰�涓�锛�
Linux疏浚�瑁���绠$��绋�搴�绮捐��

搴��ㄤ妇渚�锛�

[root@centos01 ~]# rpm -e ntsysv    <!--�歌浇ntsysv绋�搴�-->
[root@centos01 ~]# rpm -ivh /mnt/Packages/system-config
-kickstart-2.9.6-1.el7.noarch.rpm --nodeps   
              <!--缁�����--nodeps����椤瑰拷�ヤ�璧��崇郴-->
璀���锛�/mnt/Packages/system-config-kickstart-2.9.6-1.el7.noarch.rpm: 澶�V3 RSA/SHA256 Signature, 瀵��� ID f4a80eb5: NOKEY
��澶�涓�...                          ################################# [100%]
姝e�ㄥ��绾�/疏浚�瑁�...
   1:system-config-kickstart-2.9.6-1.e################################# [100%]

4��缁存��RPM�版��搴�

[root@centos01 ~]# rpm --initdb
<!--����-->
[root@centos01 ~]# rpm --rebuilddb

5��瀵煎�ラ��璇�����

[root@centos01 ~]# cd /mnt/
[root@centos01 mnt]# ls
CentOS_BuildTag  EULA  images    LiveOS    repodata              RPM-GPG-KEY-CentOS-Testing-7
EFI              GPL   isolinux  Packages  RPM-GPG-KEY-CentOS-7  TRANS.TBL
[root@centos01 mnt]# rpm --import ./RPM-GPG-KEY-CentOS-7          <!--瀵煎�ラ��璇�����-->

[root@centos01 ~]# rpm -ivh /mnt/Packages/dhcp-4.2.5
-58.el7.centos.x86_64.rpm    
              <!--��娆″��瑁�rpm��涓����剧ず瀵���-->
��澶�涓�...                          ################################# [100%]
姝e�ㄥ��绾�/疏浚�瑁�...
   1:dhcp-12:4.2.5-58.el7.centos      ################################# [100%]

6��瑙e�宠蒋浠跺��岛�璧��崇郴

Linux疏浚�瑁���绠$��绋�搴�绮捐��

涓���Linux搴��ㄧ�搴��雾�

1��搴��ㄧ�搴�涓�绯荤��戒护���崇郴

1锛���浠朵�缃�

  • 绯荤��戒护锛�涓�����/bin��/sbin��褰�涓�锛���涓�Shell���ㄦ��浠ゃ��

  • 搴��ㄧ�搴�锛���甯稿��/usr/bin��/usr/sbin��褰�涓���
  • 2锛�涓昏��ㄩ��

  • 绯荤��戒护锛�疏浚���瀵圭郴缁����烘��绠$��宸ヤ�锛�岛�濡�IP��缃�宸ュ�枫��

  • 搴��ㄧ�搴�锛�疏浚����稿�圭��绔����朵�杈��╀换�★�岛�濡�缃�椤垫�瑙��ㄣ��
  • 3锛����ㄧ��澧�

  • 绯荤��戒护锛�涓������ㄥ��绗���浣�����涓�杩�琛���

  • 搴��ㄧ�搴�锛��规��疏浚�����瑕�锛���河渠�绋�搴����ㄥ�惧舰����涓�杩�琛���
  • 4锛�杩�琛��煎�

  • 绯荤��戒护锛�涓��������戒护瀛����戒护��椤瑰���戒护���般��

  • 搴��ㄧ�搴�锛���甯告病���哄�����ц��煎���
  • 2���稿��搴��ㄧ�搴�����褰�缁���

    Linux疏浚�瑁���绠$��绋�搴�绮捐��

    3��甯歌���潘�浠跺��广大�瑁�绫诲��

    Linux疏浚�瑁���绠$��绋�搴�绮捐��

    ����婧�浠g��缂�璇�疏浚�瑁�

    1��婧�浠g��缂�璇�姒�杩�

    1锛�浣跨�ㄦ�浠g��疏浚�瑁�潘�浠剁��浼���

    �山����扮演��潘�浠剁����锛����朵慨澶�bug锛��规���ㄦ�烽��瑕�锛��垫椿瀹��惰蒋浠跺���姐��

    2锛�搴��ㄦ�浠g��缂�璇�疏浚�瑁��哄��涓句�

    疏浚�瑁�杈��扮演������搴��ㄧ�搴��朵娇��锛�褰���疏浚�瑁���绋�搴���娉�婊¤冻��瑕��朵娇��锛���瑕�涓哄��ㄧ�搴�娣诲���扮演�����芥�朵娇�ㄧ��绛���

    2��缂�璇�疏浚�瑁�婧�浠g����

    1锛�Tarball��

    .tar.gz��.tar.bz2�煎�灞�澶���潘�浠剁�������锛�http://sourceforge.net

    2锛�疏浚��存�ф�¢��

    璁$��MD5�¢����锛�骞朵�疏浚��规��岛����肩�告��杈�锛��ゆ������涓��淬��濡�涓�锛�

    [root@centos01 ~]# md5sum /mnt/Packages/tomcat-7.0.76-2.el7.noarch.rpm
    3c901508f0651c5c3207f999fbf395ed  /mnt/Packages/tomcat-7.0.76-2.el7.noarch.rpm

    3锛�纭�璁ゆ�浠g��缂�璇���澧�

    ��瑕�疏浚�瑁�����C/C++绋�搴�璇�瑷���缂�璇���锛�濡�涓���绀猴�

    [root@centos01 ~]# rpm -qa | grep gcc  <!--�ョ������疏浚�瑁�gcc��gcc-c++-->
    libgcc-4.8.5-16.el7.x86_64
    gcc-c++-4.8.5-16.el7.x86_64
    gcc-4.8.5-16.el7.x86_64
    gcc-gfortran-4.8.5-16.el7.x86_64
    [root@centos01 ~]# rpm -qa | grep make   <!--�ョ������疏浚�瑁�make-->
    make-3.82-23.el7.x86_64
    automake-1.13.4-3.el7.noarch

    4��缂�璇�疏浚�瑁�杩�绋�

    Linux疏浚�瑁���绠$��绋�搴�绮捐��

    5��缂�璇�疏浚�瑁�姝ラ��

    1锛�tar瑙e��

    ��甯告���仪式�涔����у�潘�浠跺�����惧��/usr/src/��褰�锛�瑙e������婧�浠g����浠朵�缃�/usr/src/潘�浠跺��-������/��搴��ㄤ妇渚�锛�

    [root@centos01 ~]# tar zxvf /mnt/httpd-2.2.17.tar.gz -C /usr/src/

    2锛�./configure��缃�

    浣跨�ㄦ�����褰�涓���configure����锛��ц���./configure --help�����ョ��甯��╋��稿������缃���椤癸�--prefix=潘�浠跺��瑁���褰���搴��ㄤ妇渚�锛�

    [root@centos01 ~]# cd /usr/src/httpd-2.2.17/
    [root@centos01 httpd-2.2.17]# ./configure --prefix=/usr/local/httpd

    涓���疏浚�浠讳���缃���椤癸������ㄩ�璁ゅ�笺��

    3锛�缂�璇�

    [root@centos01 httpd-2.2.17]# make 

    4锛�疏浚�瑁�

    [root@centos01 httpd-2.2.17]#make install

    娉ㄦ��锛�缂�璇���疏浚�瑁���浠ヤ�璧锋�ц�锛�涓��寸���&&�冲��涓�娆℃�ф�ц�涓ゆ�″�戒护��

    5锛�浼���绋�搴���褰�

    [root@centos01 ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin/

    6锛���寤虹郴缁����★�娣诲���ц�����

    [root@centos01 ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
    [root@centos01 ~]# chmod +x /etc/init.d/httpd

    7锛�淇��圭郴缁�����

    [root@centos01 ~]# vim /etc/init.d/httpd 
    #!/bin/sh
    #chkconfig:35 80 20
    ............<!--姝ゅ����ラ�ㄥ����疏浚�-->

    8锛�娣诲��涓虹郴缁����★�璁剧疆寮��鸿���ㄥ����

    [root@centos01 ~]# chkconfig --add httpd
    [root@centos01 ~]# chkconfig --level 35 httpd on

    9锛�����apache����

    [root@centos01 ~]# systemctl start httpd

    10锛�����apache���$��绔��e��

    [root@centos01 ~]# netstat -anptu | grep 80
    tcp6       0      0 :::80                   :::*                    LISTEN      53115/httpd         

    ���������������� �����虫�ょ���锛���璋㈤��璇� ����������������