12Vim application example in System configuration

Source: Internet
Author: User
Tags gpg

Vim Application Example 1 in the system configuration. Configure host name in order to facilitate our local area network to find a specific host, the latter to distinguish between the host, in addition to the IP address, but also to configure a host name for the host, the host name can be accessed through this similar to the name of the domain names to each other.

In Linxu systems, the host names are mostly stored in the/etc/hostname file.

//使用vim修改/etc/hostname中的内容[[email protected] ~]# vim /etc/hostname[[email protected] ~]# cat /etc/hostnamerockman.com[[email protected] ~]# hostnamerockman.com
2. Configure network card information The first step: first switch to the/etc/sysconfig/network-scripts directory (the configuration file that holds the NIC). The second step: using the VIM editor to modify the network card file Ifcfg-ens33, because each device hardware and architecture is not the same, all need to use the ifconfig command to confirm the default name of their network card, and then make the corresponding changes.
YPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=1a497aa0-f2c5-449d-96ed-e15df4ddf8b3DEVICE=ens33ONBOOT=yes
Step Three: Restart the Network service and test the network connectivity.
[[email protected] network-scripts]# systemctl restart network[[email protected] network-scripts]# ping baidu.comPING baidu.com (123.125.115.110) 56(84) bytes of data.64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=1 ttl=128 time=5.48 ms64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=2 ttl=128 time=5.47 ms64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=3 ttl=128 time=6.71 ms64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=4 ttl=128 time=5.42 ms^C--- baidu.com ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3005ms
3. Configuring the Yum Software warehouse yum (Yellow dog Updater, Modified) software warehouse is designed to further simplify the difficulty of RPM (Red Hat Package Manager) management software and the technology that automatically analyzes the required packages and their relationships.

You can think of Yum as a huge software repository with almost all of the tools you use, and just say the package name you need, and the system will do everything for you.

The first step: enter into the/ETC/YUM.REPOS.D directory (the directory should contain the configuration file for the Yum repository).
[[email protected] network-scripts]# cd /etc/yum.repos.d/[[email protected] yum.repos.d]# lsCentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo    CentOS-Vault.repoCentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo
Step two: Use the VIM editor to create a new profile named Rhel7.repo (the file name is optional, but the suffix must be. Repo), configure the parameters individually and save the exit. (Only one. Repo file is opened in this example)
[[email protected] yum.repos.d]# vi CentOS-Media.repo[c7-media]name=CentOS-$releasever - Mediabaseurl=file:///media/CentOS/        file:///media/cdrom/        file:///media/cdrecorder/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Step three: Mount the disc by the path of the configuration parameter and write the disc mount information to the/etc/fstab file.
[[email protected] yum.repos.d]# mkdir -p /media/cdrom[[email protected] yum.repos.d]# mount /dev/cdrom /media/cdrommount: /dev/sr0 is write-protected, mounting read-only[[email protected] yum.repos.d]# vim /etc/fstab/dev/cdrom /media/cdrom iso9660 defaults 0 0
Fourth step: Use the "Yum install httpd-y" command to check if the Yum repositories are available.
[[email protected] network-scripts]# yum install httpd -yLoaded plugins: fastestmirrorbase                                                     | 3.6 kB     00:00extras                                                   | 3.4 kB     00:00updates                                                  | 3.4 kB     00:00(1/2): extras/7/x86_64/primary_db                          | 149 kB   00:00(2/2): updates/7/x86_64/primary_db                         | 2.0 MB   00:01Loading mirror speeds from cached hostfile(省略部分输出信息)Complete!

12Vim application example in System configuration

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.