´î½¨CentOSÔÚÏßyumÔ´¾µÏñ·þÎñÆ÷
ʱ¼ä:2014-09-05 01:06 À´Ô´:osyunwei.com ×÷Õß:osyunwei.com
˵Ã÷£º
²Ù×÷ϵͳ£ºCentOS 6.x
IPµØÖ·£º192.168.21.188
ʵÏÖÄ¿µÄ£ºÍ¬²½CentOS¾µÏñÕ¾µãµÄÄÚÈݵ½´Ë·þÎñÆ÷£¬²¢ÇÒͨ¹ýÅäÖÃhttp·þÎñÆ÷£¬Äܹ»ÏòÍâÌṩyum·þÎñ
×¼±¸Æª£º
Ò»¡¢°²×°http·þÎñÆ÷
ÕâÀïʹÓÃNginx·þÎñÆ÷Ìṩhttp·þÎñ
¹ØÓÚNginx·þÎñÆ÷´î½¨£¬²Î¿¼£ºCentOS°²×°ÅäÖÃLNMP·þÎñÆ÷£¨Nginx+PHP+MySQL£©
http://www.osyunwei.com/archives/5910.html
¶þ¡¢ÏµÍ³Ô¼¶¨
NginxÕ¾µã¸ùĿ¼:/usr/local/nginx/html
·þÎñÆ÷Ö´Ðнű¾Îļþ´æ·ÅĿ¼:/home/crontab
Èý¡¢¿ªÊ¼NginxĿ¼ä¯ÀÀ¹¦ÄÜ
vi /usr/local/nginx/conf/nginx.conf #±à¼ÅäÖÃÎļþ£¬ÔÚhttp {ÏÂÃæÌí¼ÓÒÔÏÂÄÚÈÝ£º
autoindex on; #¿ªÆônginxĿ¼ä¯ÀÀ¹¦ÄÜ
autoindex_exact_size off; #Îļþ´óС´ÓKB¿ªÊ¼ÏÔʾ
autoindex_localtime on; #ÏÔʾÎļþÐÞ¸Äʱ¼äΪ·þÎñÆ÷±¾µØʱ¼ä
:wq! #±£´æ£¬Í˳ö
service nginx reload #ÖØмÓÔØÅäÖÃ
²Î¿¼£ºNginx¿ªÆôĿ¼ä¯ÀÀ¹¦ÄÜ
http://www.osyunwei.com/archives/5051.html
ϵͳÔËά www.osyunwei.com ÎÂÜ°ÌáÐÑ£ºqihang01Ô´´ÄÚÈÝ©°æȨËùÓÐ,תÔØÇë×¢Ã÷³ö´¦¼°ÔÎÄÁ´
°²×°Æª£º
Ò»¡¢´´½¨¾µÏñÎļþ´æ·ÅĿ¼
mkdir -p /usr/local/nginx/html/centos #CentOS¹Ù·½±ê×¼Ô´
mkdir -p /usr/local/nginx/html/repoforge #µÚÈý·½rpmforgeÔ´
mkdir -p /usr/local/nginx/html/epel #µÚÈý·½epelÔ´
˵Ã÷£ºÕâÀï´´½¨Èý¸öÎļþ¼Ð£¬·Ö±ð´æ·ÅCentOS¹Ù·½±ê×¼Ô´¡¢µÚÈý·½µÄrpmforgeÔ´ºÍepelÔ´
¶þ¡¢È·¶¨ÒÔÉÏÈý¸öyumÔ´ÉÏÓÎÔ´µÄͬ²½¾µÏñµØÖ·
1¡¢CentOS¹Ù·½±ê×¼Ô´£ºrsync://mirrors.ustc.edu.cn/centos/
2¡¢rpmforgeÔ´£ºrsync://mirrors.ispros.com.bd/repoforge/
3¡¢epelÔ´£ºrsync://mirrors.ustc.edu.cn/epel/
±¸×¢£ºÉÏÓÎyumÔ´±ØÐëÒªÖ§³ÖrsyncÐÒ飬·ñÔò²»ÄÜʹÓÃrsync½øÐÐͬ²½¡£
²Î¿¼£º
CentOS¹Ù·½±ê×¼Ô´£º
rsync://mirrors.kernel.org/centos
rpmforgeÔ´£º
http://apt.sw.be/
rsync://ftp-stud.fht-esslingen.de/dag
epelÔ´£º
http://mirrors.fedoraproject.org/publiclist/EPEL/
rsync://mirrors.kernel.org/fedora-epel
Èý¡¢´´½¨ÒÔÉÏÈý¸öyumԴͬ²½½Å±¾£¬²¢ÇÒÉ趨½Å±¾×Ô¶¯Ö´ÐÐ
mkdir -p /home/crontab #´´½¨Ä¿Â¼
vi /home/crontab/yum_rsync.sh #Ìí¼ÓÒÔÏ´úÂë
#!/bin/sh
/usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/centos/ --exclude-from=/usr/local/nginx/html/exclude_centos.list /usr/local/nginx/html/centos/
/usr/bin/rsync -avrt rsync://mirrors.ispros.com.bd/repoforge/ --exclude-from=/usr/local/nginx/html/exclude_repoforge.list /usr/local/nginx/html/repoforge/
/usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/epel/ --exclude-from=/usr/local/nginx/html/exclude_epel.list /usr/local/nginx/html/epel/
:wq! #±£´æÍ˳ö
chmod +x /home/crontab/yum_rsync.sh #Ìí¼Ó½Å±¾Ö´ÐÐȨÏÞ
±¸×¢£ºÔËÐд˽ű¾Ç°£¬ÏÈÒª´´½¨ºÃͬ²½Ä¿Â¼¼°²»ÐèҪͬ²½µÄĿ¼ÁбíÎļþ
cd /usr/local/nginx/html/ #½øÈëĿ¼
touch exclude_centos.list #´´½¨Îļþ
touch exclude_repoforge.list #´´½¨Îļþ
touch exclude_epel.list #´´½¨Îļþ
°Ñ²»ÐèҪͬ²½µÄĿ¼дµ½ÉÏÃæ¶ÔÓ¦µÄÎļþÖУ¬Ã¿ÐÐÒ»¸öĿ¼
ÀýÈ磺
vi exclude_epel.list
4/
4AS/
4ES/
4WS/
:wq! #±£´æÍ˳ö
ËÄ¡¢Ìí¼Ó½Å±¾¶¨Ê±Ö´ÐÐÈÎÎñ
vi /etc/crontab #ÔÚ×îºóÒ»ÐÐÌí¼ÓÒÔÏ´úÂë
0 1 * * * root /home/crontab/yum_rsync.sh #ÉèÖÃÿÌìÁ賿1µãÕû¿ªÊ¼Ö´Ðнű¾
:wq! #±£´æÍ˳ö
service crond restart #ÖØÆô
²âÊÔƪ£º
Ò»¡¢°²×°rsyncͬ²½Èí¼þ
yum install rsync xinetd #°²×°
vi /etc/xinetd.d/rsync #±à¼ÅäÖÃÎļþ£¬ÉèÖÿª»úÆô¶¯rsync
disable = no #ÐÞ¸ÄΪ
/etc/init.d/xinetd start #Æô¶¯£¨CentOSÖÐÊÇÒÔxinetd À´¹ÜÀíRsync·þÎñµÄ£©
:wq! #±£´æÍ˳ö
¶þ¡¢Ö´ÐÐͬ²½½Å±¾
sh /home/crontab/yum_rsync.sh
×¢Ò⣺µÈ´ý½Å±¾Ö´ÐÐÍê±Ï£¬Ê×´Îͬ²½£¬ºÄ·ÑµÄʱ¼ä±È½Ï³¤£¡
Èý¡¢¸ù¾Ý²»Í¬°æ±¾´´½¨Èý¸öyumÔ´µÄrepoÅäÖÃÎļþ
cd /etc/yum.repos.d/ #½øÈëĿ¼
mv /etc/yum.repos.d/CentOS-Base.repo CentOS-Base.repo-bak
1¡¢CentOS¹Ù·½±ê×¼Ô´£º
CentOS 5.xϵÁУº
vi /etc/yum.repos.d/CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë
# 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 - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/addons/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5
:wq! #±£´æÍ˳ö
#########################
CentOS 6.xϵÁУº
vi /etc/yum.repos.d/CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë
# 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 - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
:wq! #±£´æÍ˳ö
#########################
CentOS 7.xϵÁУº
vi /etc/yum.repos.d/CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë
# 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://192.168.21.188/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://192.168.21.188/centos/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://192.168.21.188/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://192.168.21.188/centos/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://192.168.21.188/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://192.168.21.188/centos/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://192.168.21.188/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7
:wq! #±£´æÍ˳ö
#########################
»òÕ߲ο¼£ºhttps://lug.ustc.edu.cn/wiki/mirrors/help/centos
°ÑÀïÃæµÄhttp://mirrors.ustc.edu.cn/Ì滻Ϊhttp://192.168.21.188/
2¡¢rpmforgeÔ´£º
CentOS 5.xϵÁУº
vi /etc/yum.repos.d/rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/rpmforge
enabled = 1
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/extras
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/testing
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
:wq! #±£´æÍ˳ö
#########################
ϵͳÔËά www.osyunwei.com ÎÂÜ°ÌáÐÑ£ºqihang01Ô´´ÄÚÈÝ©°æȨËùÓÐ,תÔØÇë×¢Ã÷³ö´¦¼°ÔÎÄÁ´
CentOS 6.xϵÁУº
vi /etc/yum.repos.d/rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/rpmforge
enabled = 1
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/extras
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/testing
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
:wq! #±£´æÍ˳ö
#########################
CentOS 7.xϵÁУº
vi /etc/yum.repos.d/rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/rpmforge
enabled = 1
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/extras
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/testing
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
:wq! #±£´æÍ˳ö
#########################
3¡¢epelÔ´£º
CentOS 5.xϵÁУº
vi /etc/yum.repos.d/epel.repo #Ìí¼ÓÒÔÏ´úÂë
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
baseurl=http://192.168.21.188/epel/5/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
baseurl=http://192.168.21.188/epel/5/$basearch/debug
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 5 - $basearch - Source
baseurl=http://192.168.21.188/epel/5/SRPMS
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5
gpgcheck=1
:wq! #±£´æÍ˳ö
#########################
CentOS 6.xϵÁУº
vi /etc/yum.repos.d/epel.repo #Ìí¼ÓÒÔÏ´úÂë
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://192.168.21.188/epel/6/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://192.168.21.188/epel/6/$basearch/debug
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://192.168.21.188/epel/6/SRPMS
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1
:wq! #±£´æÍ˳ö
#########################
CentOS 7.xϵÁУº
vi /etc/yum.repos.d/epel.repo #Ìí¼ÓÒÔÏ´úÂë
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://192.168.21.188/epel/beta/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://192.168.21.188/epel/beta/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://192.168.21.188/epel/beta/7/SRPMS
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7
gpgcheck=1
:wq! #±£´æÍ˳ö
#########################
ËÄ¡¢²âÊÔyumÔ´ÊÇ·ñÅäÖÃÕýÈ·
1¡¢µ±Ç°ÏµÍ³°æ±¾ÎªCentOS 6.x£¬ÒÔ´ËΪÀý
cd /etc/yum.repos.d/
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
vi CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë
# 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 - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - huanqiu.com
baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6
:wq! #±£´æÍ˳ö
#########################
vi rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/rpmforge
enabled = 1
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/extras
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/testing
enabled = 0
protect = 0
gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge
gpgcheck = 1
:wq! #±£´æÍ˳ö
#########################
vi epel.repo #Ìí¼ÓÒÔÏ´úÂë
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://192.168.21.188/epel/6/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://192.168.21.188/epel/6/$basearch/debug
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://192.168.21.188/epel/6/SRPMS
failovermethod=priority
enabled=0
gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1
:wq! #±£´æÍ˳ö
#########################
ϵͳÔËά www.osyunwei.com ÎÂÜ°ÌáÐÑ£ºqihang01Ô´´ÄÚÈÝ©°æȨËùÓÐ,תÔØÇë×¢Ã÷³ö´¦¼°ÔÎÄÁ´
yum clean all #Çå³ýµ±Ç°yum»º´æ
yum makecache #»º´æyumÔ´ÖеÄÈí¼þ°üÐÅÏ¢
yum repolist #ÁгöyumÔ´ÖпÉÓõÄÈí¼þ°ü
2¡¢Ê¹ÓÃyumÃüÁî°²×°Èí¼þ
yum install php #²âÊÔCentOS¹Ù·½±ê×¼Ô´
yum install htop #²âÊÔrpmforgeÔ´
yum install nginx #²âÊÔepelÔ´
ÖÁ´Ë£¬´î½¨CentOSÔÚÏßyumÔ´¾µÏñ·þÎñÆ÷Íê³É£¡
(ÔðÈα༣ºIT)
˵Ã÷£º ²Ù×÷ϵͳ£ºCentOS 6.x IPµØÖ·£º192.168.21.188 ʵÏÖÄ¿µÄ£ºÍ¬²½CentOS¾µÏñÕ¾µãµÄÄÚÈݵ½´Ë·þÎñÆ÷£¬²¢ÇÒͨ¹ýÅäÖÃhttp·þÎñÆ÷£¬Äܹ»ÏòÍâÌṩyum·þÎñ ×¼±¸Æª£º Ò»¡¢°²×°http·þÎñÆ÷ ÕâÀïʹÓÃNginx·þÎñÆ÷Ìṩhttp·þÎñ ¹ØÓÚNginx·þÎñÆ÷´î½¨£¬²Î¿¼£ºCentOS°²×°ÅäÖÃLNMP·þÎñÆ÷£¨Nginx+PHP+MySQL£© http://www.osyunwei.com/archives/5910.html ¶þ¡¢ÏµÍ³Ô¼¶¨ NginxÕ¾µã¸ùĿ¼:/usr/local/nginx/html ·þÎñÆ÷Ö´Ðнű¾Îļþ´æ·ÅĿ¼:/home/crontab Èý¡¢¿ªÊ¼NginxĿ¼ä¯ÀÀ¹¦ÄÜ vi /usr/local/nginx/conf/nginx.conf #±à¼ÅäÖÃÎļþ£¬ÔÚhttp {ÏÂÃæÌí¼ÓÒÔÏÂÄÚÈÝ£º autoindex on; #¿ªÆônginxĿ¼ä¯ÀÀ¹¦ÄÜ autoindex_exact_size off; #Îļþ´óС´ÓKB¿ªÊ¼ÏÔʾ autoindex_localtime on; #ÏÔʾÎļþÐÞ¸Äʱ¼äΪ·þÎñÆ÷±¾µØʱ¼ä :wq! #±£´æ£¬Í˳ö service nginx reload #ÖØмÓÔØÅäÖà ²Î¿¼£ºNginx¿ªÆôĿ¼ä¯ÀÀ¹¦ÄÜ http://www.osyunwei.com/archives/5051.html
ϵͳÔËά www.osyunwei.com ÎÂÜ°ÌáÐÑ£ºqihang01Ô´´ÄÚÈÝ©°æȨËùÓÐ,תÔØÇë×¢Ã÷³ö´¦¼°ÔÎÄÁ´ °²×°Æª£º Ò»¡¢´´½¨¾µÏñÎļþ´æ·ÅĿ¼ mkdir -p /usr/local/nginx/html/centos #CentOS¹Ù·½±ê×¼Ô´ mkdir -p /usr/local/nginx/html/repoforge #µÚÈý·½rpmforgeÔ´ mkdir -p /usr/local/nginx/html/epel #µÚÈý·½epelÔ´ ˵Ã÷£ºÕâÀï´´½¨Èý¸öÎļþ¼Ð£¬·Ö±ð´æ·ÅCentOS¹Ù·½±ê×¼Ô´¡¢µÚÈý·½µÄrpmforgeÔ´ºÍepelÔ´ ¶þ¡¢È·¶¨ÒÔÉÏÈý¸öyumÔ´ÉÏÓÎÔ´µÄͬ²½¾µÏñµØÖ· 1¡¢CentOS¹Ù·½±ê×¼Ô´£ºrsync://mirrors.ustc.edu.cn/centos/ 2¡¢rpmforgeÔ´£ºrsync://mirrors.ispros.com.bd/repoforge/ 3¡¢epelÔ´£ºrsync://mirrors.ustc.edu.cn/epel/ ±¸×¢£ºÉÏÓÎyumÔ´±ØÐëÒªÖ§³ÖrsyncÐÒ飬·ñÔò²»ÄÜʹÓÃrsync½øÐÐͬ²½¡£ ²Î¿¼£º CentOS¹Ù·½±ê×¼Ô´£º rsync://mirrors.kernel.org/centos rpmforgeÔ´£º http://apt.sw.be/ rsync://ftp-stud.fht-esslingen.de/dag epelÔ´£º http://mirrors.fedoraproject.org/publiclist/EPEL/ rsync://mirrors.kernel.org/fedora-epel Èý¡¢´´½¨ÒÔÉÏÈý¸öyumԴͬ²½½Å±¾£¬²¢ÇÒÉ趨½Å±¾×Ô¶¯Ö´ÐÐ mkdir -p /home/crontab #´´½¨Ä¿Â¼ vi /home/crontab/yum_rsync.sh #Ìí¼ÓÒÔÏ´úÂë #!/bin/sh /usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/centos/ --exclude-from=/usr/local/nginx/html/exclude_centos.list /usr/local/nginx/html/centos/ /usr/bin/rsync -avrt rsync://mirrors.ispros.com.bd/repoforge/ --exclude-from=/usr/local/nginx/html/exclude_repoforge.list /usr/local/nginx/html/repoforge/ /usr/bin/rsync -avrt rsync://mirrors.ustc.edu.cn/epel/ --exclude-from=/usr/local/nginx/html/exclude_epel.list /usr/local/nginx/html/epel/ :wq! #±£´æÍ˳ö chmod +x /home/crontab/yum_rsync.sh #Ìí¼Ó½Å±¾Ö´ÐÐȨÏÞ ±¸×¢£ºÔËÐд˽ű¾Ç°£¬ÏÈÒª´´½¨ºÃͬ²½Ä¿Â¼¼°²»ÐèҪͬ²½µÄĿ¼ÁбíÎļþ cd /usr/local/nginx/html/ #½øÈëĿ¼ touch exclude_centos.list #´´½¨Îļþ touch exclude_repoforge.list #´´½¨Îļþ touch exclude_epel.list #´´½¨Îļþ °Ñ²»ÐèҪͬ²½µÄĿ¼дµ½ÉÏÃæ¶ÔÓ¦µÄÎļþÖУ¬Ã¿ÐÐÒ»¸öĿ¼ ÀýÈ磺 vi exclude_epel.list 4/ 4AS/ 4ES/ 4WS/ :wq! #±£´æÍ˳ö ËÄ¡¢Ìí¼Ó½Å±¾¶¨Ê±Ö´ÐÐÈÎÎñ vi /etc/crontab #ÔÚ×îºóÒ»ÐÐÌí¼ÓÒÔÏ´úÂë 0 1 * * * root /home/crontab/yum_rsync.sh #ÉèÖÃÿÌìÁ賿1µãÕû¿ªÊ¼Ö´Ðнű¾ :wq! #±£´æÍ˳ö service crond restart #ÖØÆô ²âÊÔƪ£º Ò»¡¢°²×°rsyncͬ²½Èí¼þ yum install rsync xinetd #°²×° vi /etc/xinetd.d/rsync #±à¼ÅäÖÃÎļþ£¬ÉèÖÿª»úÆô¶¯rsync disable = no #ÐÞ¸ÄΪ /etc/init.d/xinetd start #Æô¶¯£¨CentOSÖÐÊÇÒÔxinetd À´¹ÜÀíRsync·þÎñµÄ£© :wq! #±£´æÍ˳ö ¶þ¡¢Ö´ÐÐͬ²½½Å±¾ sh /home/crontab/yum_rsync.sh ×¢Ò⣺µÈ´ý½Å±¾Ö´ÐÐÍê±Ï£¬Ê×´Îͬ²½£¬ºÄ·ÑµÄʱ¼ä±È½Ï³¤£¡ Èý¡¢¸ù¾Ý²»Í¬°æ±¾´´½¨Èý¸öyumÔ´µÄrepoÅäÖÃÎļþ cd /etc/yum.repos.d/ #½øÈëĿ¼ mv /etc/yum.repos.d/CentOS-Base.repo CentOS-Base.repo-bak 1¡¢CentOS¹Ù·½±ê×¼Ô´£º CentOS 5.xϵÁУº vi /etc/yum.repos.d/CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë # 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 - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5 #released updates [updates] name=CentOS-$releasever - Updates - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released [addons] name=CentOS-$releasever - Addons - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/addons/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-5 :wq! #±£´æÍ˳ö ######################### CentOS 6.xϵÁУº vi /etc/yum.repos.d/CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë # 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 - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 :wq! #±£´æÍ˳ö ######################### CentOS 7.xϵÁУº vi /etc/yum.repos.d/CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë # 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://192.168.21.188/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://192.168.21.188/centos/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://192.168.21.188/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://192.168.21.188/centos/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://192.168.21.188/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://192.168.21.188/centos/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://192.168.21.188/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-7 :wq! #±£´æÍ˳ö ######################### »òÕ߲ο¼£ºhttps://lug.ustc.edu.cn/wiki/mirrors/help/centos °ÑÀïÃæµÄhttp://mirrors.ustc.edu.cn/Ì滻Ϊhttp://192.168.21.188/ 2¡¢rpmforgeÔ´£º CentOS 5.xϵÁУº vi /etc/yum.repos.d/rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë [rpmforge] name = RHEL $releasever - RPMforge.net - dag baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/rpmforge enabled = 1 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-extras] name = RHEL $releasever - RPMforge.net - extras baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/extras enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-testing] name = RHEL $releasever - RPMforge.net - testing baseurl = http://192.168.21.188/repoforge/redhat/el5/en/$basearch/testing enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 :wq! #±£´æÍ˳ö ######################### ϵͳÔËά www.osyunwei.com ÎÂÜ°ÌáÐÑ£ºqihang01Ô´´ÄÚÈÝ©°æȨËùÓÐ,תÔØÇë×¢Ã÷³ö´¦¼°ÔÎÄÁ´ CentOS 6.xϵÁУº vi /etc/yum.repos.d/rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë [rpmforge] name = RHEL $releasever - RPMforge.net - dag baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/rpmforge enabled = 1 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-extras] name = RHEL $releasever - RPMforge.net - extras baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/extras enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-testing] name = RHEL $releasever - RPMforge.net - testing baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/testing enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 :wq! #±£´æÍ˳ö ######################### CentOS 7.xϵÁУº vi /etc/yum.repos.d/rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë [rpmforge] name = RHEL $releasever - RPMforge.net - dag baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/rpmforge enabled = 1 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-extras] name = RHEL $releasever - RPMforge.net - extras baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/extras enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-testing] name = RHEL $releasever - RPMforge.net - testing baseurl = http://192.168.21.188/repoforge/redhat/el7/en/$basearch/testing enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 :wq! #±£´æÍ˳ö ######################### 3¡¢epelÔ´£º CentOS 5.xϵÁУº vi /etc/yum.repos.d/epel.repo #Ìí¼ÓÒÔÏ´úÂë [epel] name=Extra Packages for Enterprise Linux 5 - $basearch baseurl=http://192.168.21.188/epel/5/$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5 [epel-debuginfo] name=Extra Packages for Enterprise Linux 5 - $basearch - Debug baseurl=http://192.168.21.188/epel/5/$basearch/debug failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 5 - $basearch - Source baseurl=http://192.168.21.188/epel/5/SRPMS failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-5 gpgcheck=1 :wq! #±£´æÍ˳ö ######################### CentOS 6.xϵÁУº vi /etc/yum.repos.d/epel.repo #Ìí¼ÓÒÔÏ´úÂë [epel] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=http://192.168.21.188/epel/6/$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6 [epel-debuginfo] name=Extra Packages for Enterprise Linux 6 - $basearch - Debug baseurl=http://192.168.21.188/epel/6/$basearch/debug failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 6 - $basearch - Source baseurl=http://192.168.21.188/epel/6/SRPMS failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6 gpgcheck=1 :wq! #±£´æÍ˳ö ######################### CentOS 7.xϵÁУº vi /etc/yum.repos.d/epel.repo #Ìí¼ÓÒÔÏ´úÂë [epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=http://192.168.21.188/epel/beta/7/$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug baseurl=http://192.168.21.188/epel/beta/7/$basearch/debug failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source baseurl=http://192.168.21.188/epel/beta/7/SRPMS failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-7 gpgcheck=1 :wq! #±£´æÍ˳ö ######################### ËÄ¡¢²âÊÔyumÔ´ÊÇ·ñÅäÖÃÕýÈ· 1¡¢µ±Ç°ÏµÍ³°æ±¾ÎªCentOS 6.x£¬ÒÔ´ËΪÀý cd /etc/yum.repos.d/ mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup vi CentOS-Base.repo #Ìí¼ÓÒÔÏ´úÂë # 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 - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - huanqiu.com baseurl=http://192.168.21.188/centos/$releasever/contrib/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://192.168.21.188/centos/RPM-GPG-KEY-CentOS-6 :wq! #±£´æÍ˳ö ######################### vi rpmforge.repo #Ìí¼ÓÒÔÏ´úÂë [rpmforge] name = RHEL $releasever - RPMforge.net - dag baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/rpmforge enabled = 1 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-extras] name = RHEL $releasever - RPMforge.net - extras baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/extras enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 [rpmforge-testing] name = RHEL $releasever - RPMforge.net - testing baseurl = http://192.168.21.188/repoforge/redhat/el6/en/$basearch/testing enabled = 0 protect = 0 gpgkey=http://192.168.21.188/repoforge/RPM-GPG-KEY-rpmforge gpgcheck = 1 :wq! #±£´æÍ˳ö ######################### vi epel.repo #Ìí¼ÓÒÔÏ´úÂë [epel] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=http://192.168.21.188/epel/6/$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6 [epel-debuginfo] name=Extra Packages for Enterprise Linux 6 - $basearch - Debug baseurl=http://192.168.21.188/epel/6/$basearch/debug failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 6 - $basearch - Source baseurl=http://192.168.21.188/epel/6/SRPMS failovermethod=priority enabled=0 gpgkey =http://192.168.21.188/epel/RPM-GPG-KEY-EPEL-6 gpgcheck=1 :wq! #±£´æÍ˳ö ######################### ϵͳÔËά www.osyunwei.com ÎÂÜ°ÌáÐÑ£ºqihang01Ô´´ÄÚÈÝ©°æȨËùÓÐ,תÔØÇë×¢Ã÷³ö´¦¼°ÔÎÄÁ´
yum clean all #Çå³ýµ±Ç°yum»º´æ yum makecache #»º´æyumÔ´ÖеÄÈí¼þ°üÐÅÏ¢
yum repolist #ÁгöyumÔ´ÖпÉÓõÄÈí¼þ°ü 2¡¢Ê¹ÓÃyumÃüÁî°²×°Èí¼þ
yum install php #²âÊÔCentOS¹Ù·½±ê×¼Ô´
yum install htop #²âÊÔrpmforgeÔ´
yum install nginx #²âÊÔepelÔ´ ÖÁ´Ë£¬´î½¨CentOSÔÚÏßyumÔ´¾µÏñ·þÎñÆ÷Íê³É£¡ (ÔðÈα༣ºIT) |