Linux Package installation 2--based on the Red Hat series RPM command installation and Apache simple build Httpserver

Source: Internet
Author: User

RPM Command Management

The RPM package is a binary installation package based on the Red Hat series. The common Red Hat series include Red Hat Enterprise Linux,centos, Linux distributions such as Fedora

First introduce the rpm Package naming method:

httpd-2.2.15-39.el6.centos.i686.rpm

Before introducing the rpm command for Linux , let's explain two concepts:

Package full Name: Similar to the full naming method described above httpd-2.2.15-39.el6.centos.i686.rpm

Package Name:httpd

1.rpm Install, upgrade, uninstall

RPM Installation

RPM-IVH Package Full name

-I install installation
-V Verbose more information
-H Hash Progress

--nodeps No dependency detection (NO)

RPM Upgrade
RPM-UVH Package Full name

-U (upgrade)

RPM Offload
RPM-E Package Name
-E (erase)

Note: This option is not typically used for non-detection of dependencies, and if dependencies are not detected during package installation, the package will be incomplete or even failed to install

RPM upgrade installs packages that need to be upgraded


2.rpm Query

Query whether the package is installed
Rpm-q (query) package name
Rpm-qa querying all installed packages

Query Package Details

The package information is written when the package is created, so the information for the installed package and the information for the installation package can be queried
RPM-QI Package Name query to install package details
Absolute path query for RPM-QIP package full name details of the package not installed

Query the installation location of files in a package
Each file installation location is the default (determined when building the file), so the installed package and the files are not installed can be queried, manually specify the installation location will cause management inconvenience
RPM-QL Package Name query where installed package files are installed
RPM-QLP the absolute path of the full name of the package does not install where the package files will be installed


Query which rpm package The system files belong to
RPM-QF System file name (files that must be installed through the package )


Querying the dependencies of a package
RPM-QR Package Name query for installed package dependent files
Absolute path query for the full name of the RPM-QRP package does not have a dependent file installed


Note: Query package information can only be queried through the rpm command,yum query is not complete

Here's a brief description of what the file relies on:

Since the so-called package installation refers to the need for package BWhen installing package a , it is said that package a depends on package b

Common forms of dependency:

A) tree-dependent a->b->c

B) ring-dependent a->b->c->a

C) Library Dependencies

Tree-dependent Install package a, install package C, install package b, and finally install package a

Ring dependent, while installing package ABC

Library dependencies: The so-called library dependency is that one of the libraries in the package is dependent on the other package, the key is to find the package where the library is located, can be queried by Www.rpmfind.net

Below is a brief introduction to the installation of rpm packages by installing Apache under Linux :

First, query whether the httpd package is installed


Installing the httpd Package


This is more complete, you may find that there is no dependency, it is because I have already installed a httpd, all the dependencies have been resolved, the following installs the package with dependencies



Go to www.rpmfind.net find




Install the library files in the same package and then step-by-step installation.


3.rpm Command Management - checksum file extraction
rpm-v Package Name
The current state is compared to the original installation state

The command will not respond if no change has occurred

If there is a change, there will be a message

The details of the 8 information in the verification content are as follows:

US file size is changed

UM file type or file permission (rwx) is changed

U5 file MD5 checksum is changed (can be viewed as whether the contents of the file

Change

In the UD device, whether the code changes from

UL file path changed

Whether the owner of the U-u file has changed

whether the genus Group of the U G file has changed

u T whether the modification time of the file changed

4. file extraction in RPM package (mainly used for mis-operation, file repair)
If a system file is deleted by mistake, you can query which installation package the system files are in, one way is to reinstall the package overrides directly, and the other way is to extract the deleted files from the package to the current directory, and copy them to the original directory.
such as accidental deletion /bin/ls , you ls command is not available.

At this point , you can query the package where/bin/ls is located, extract it from the appropriate package, and then place it in the appropriate location.



Now that you have installed Apache, simply build a httpsever

First Open httpd



HTTPD open successfully, add HTML file to Apache's default publishing directory

Disable the firewall

Iptables-f

Then restart httpd

/ETC/INIT.D/HTTPD restart

You can then enter 192.168.110.2 in the same network segment's browser to access the index.html.



Linux Package installation 2--based on the Red Hat series RPM command installation and Apache simple build Httpserver

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.