Sabtu, 06 Juni 2015

CENTOS 7 DATACODING

Login interface
Last login interface, as shown below, this initialization process after installation ends.

a9d3fd1f4134970aea94fd0996cad1c8a7865d35

63d9f2d3572c11dfe41e5205602762d0f603c2cd

The basic configuration of the four.

1.The network configuration

(1)NetworkThe configuration file to describe

8b82b9014a90f60355ef75613a12b31bb051edbd

(2)StaticIP, hostname, hosts
#ls /etc/sysconfig/network-scripts/ifcfg-en*
#vi /etc/sysconfig/network-scripts/ifcfg-en //The last row add the following documents
IPADDR0=10.0.2.15
PREFIX0=24
GATEWAY0=10.0.2.2
DNS1=168.126.63.1
DNS2=168.126.63.2
:wq! #Save and exit
#service network restart

#vi /etc/hostname
www #Change localhost.localdomain to WWW
:wq! #Save and exit

#vi /etc/hosts
127.0.0.1 localhost www #Change localhost.localdomain to WWW
:wq! #Save and exit

(3)The network command
ifdown eth0    //Closed network
ifconfig eth0 down   //Closed network
ifup eth0    //Open network
ifconfig eth0 up    //Open network
service network start  //Start the network service
service network stop //Stop the network service
service network restart //Service network restart
service network status //View network service status

2.Software source configuration

(1)CentOSThe mirror site

Complete CentOS software library is very big. CentOS software package is located in the CentOS directory tree mirror site, by FTP or HTTP to access them. Check the CentOS image of the state: http://mirror-status.centos.org/

Mirror site first level directory is the version number, such as 4, 5, 6, 7 etc.. Any CentOS mirror site version 7 directory has the following directory.

960a304e251f95ca089a7b90ca177f3e670952ad
(2)CentOSWarehouse

Warehouse (repository) is a ready list, or a web site, include software packages and index file. Yum can be in the warehouse automatically positioned and to obtain the correct RPM software package. So, you don't have to manually search for and install new applications and upgrade patch. To use a command, you can have all the software update system, can also according to the specified target search to find the installation of new software.

The mirror server for each version of the CentOS are respectively provided some warehouse. CentOS 7 software management tool for Yum has been pre configured to use the following 5 warehouse.
7acb0a46f21fbe090d102a3268600c338744ad4e

(3)IntroductionyumSource

Yum reposdir (/etc/yum.repos.d) using a series of.Repo file directory lists available software mirroring the site address packet warehouse. Surrounded by the following two files case.

CentOS-Base.repo: For setting up a remote warehouse.
CentOS-Media.repo: Used to set the local warehouse.

In the.Repo file, the configuration syntax is segmented, each segment of configuration of a software repository, the configuration syntax is as follows:

[repositoryid]
name=Some name for this repository
baseurl=url://server1/path/to/repository/
url://server2/path/to/repository/
url://server3/path/to/repository/
mirrorlist=url://path/to/mirrorlist/repository/
enabled=0/1
gpgcheck=0/1
gpgkey=A URL pointing to the ASCII-armoured GPG key file for the repository

The configuration syntax description:
377adab44aed2e73ba946f0a8401a18b87d6fa93
In addition, you should also pay attention to the following points:
1, The file is a comment lines beginning with "#".
2, If mirrorlist is specified, the system will be from a CentOS mirror site select your nearest warehouse.
3, Not all domestic mirror are in the list of CentOS mirror site, so we can directly use baseurl directly to specify your nearest warehouse.
4, Baseurl you can specify more than one URL, the system will check your list of warehouse, so that you can use another server in a server down time.
5, In order to speed up the update, in order to ensure the update server and line under the condition of good, a URL can be specified in baseurl.

(4)yumLocal source

In order to use the installation CD as the update source, you can modify the CentOS-Media.repo file.

The following is the default configuration example:
[c6-media]
name=CentOS-$releaserver - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Tips:
1, In order to use the c6-media warehouse, you need to CentOS-Base.repo file in base warehouse with enabled=0 set to not available.
2, If the local disk space has enough space, you can also will install CD copy to a directory in the local disk.

(5)The defaultyumSoftware source

In order to use the network as the update source, you can modify the CentOS-Base.repo file. The following is the default configuration example:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

(6)The origin of University of Science & Technology China

#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup //Backup
#wget -O CentOS-Base.repo -P /etc/yum.repos.d/
#yum clean all
#yum makecache
#yum update

(7)yumCommand

Tidak ada komentar:

Posting Komentar