顯示具有 CentOS 6 標籤的文章。 顯示所有文章
顯示具有 CentOS 6 標籤的文章。 顯示所有文章

2014年7月29日 星期二

將Linux上寄給root的mail轉發到外部信件

# vim /etc/aliases

root:           root, LinuxAdm@cmchiu.com

# echo test | mail -s "test message" root

2014年7月28日 星期一

YUM rpmnew rpmsave

find /etc/ -print | egrep "rpmnew$|rpmsave$"

2014年7月25日 星期五

在CentOS 6上安裝PHP 5.4與MySQL 5.5

啟用SCL
參考文件

安裝MySQL 5.5
# yum install mysql55-mysql-server

安裝PHP 5.4
# yum install php54-php php54-php-mbstring php54-php-mysqlnd

2014年7月24日 星期四

CentOS 6 啟用 SCL Repositories

安裝
# yum install centos-release-SCL

設定Repository
# cd /etc/yum.repos.d
# vi ./CentOS-SCL.repo

# CentOS-SCL.repo
#
# The Software Collections  ( SCL ) repository contains rpms for newer
# software that can be installed alongside default versions
#
# Look at http://wiki.centos.org/AdditionalResources/Repositories/SCL
# for more details about how this repository works

[scl]
name=CentOS-$releasever - SCL
baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/SCL/$basearch/
gpgcheck=1
enabled=1

gpgkey=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-6

參考資料
可供 CentOS 使用的軟件庫
軟件選集(SCL)軟件庫

2014年7月21日 星期一

安裝Extra Packages for Enterprise Linux (EPEL)

Extra Packages for Enterprise Linux (EPEL)

Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL), Oracle Enterprise Linux(OEL).

EPEL packages are usually based on their Fedora counterparts and will never conflict with or replace packages in the base Enterprise Linux distributions. EPEL uses much of the same infrastructure as Fedora, including buildsystem, bugzilla instance, updates manager, mirror manager and more.

安裝
# yum install centos-release-scl
# rpm -ivh http://mirror01.idc.hinet.net/EPEL/6/x86_64/epel-release-6-8.noarch.rpm

設定Repository
# cd /etc/yum.repos.d
# vi ./epel.repo

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirror01.idc.hinet.net/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://mirror01.idc.hinet.net/epel/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://mirror01.idc.hinet.net/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=http://mirror01.idc.hinet.net/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://mirror01.idc.hinet.net/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=http://mirror01.idc.hinet.net/epel/RPM-GPG-KEY-EPEL-6
gpgcheck=1

設定YUM Repositories

YUM Repositories Mirror List
查詢Mirror List: http://mirrorlist.centos.org/?release=6.5&arch=x86_64&repo=os http://mirror01.idc.hinet.net/CentOS/6.5/os/x86_64/
http://ftp.tc.edu.tw/Linux/CentOS/6.5/os/x86_64/ http://ftp.stu.edu.tw/Linux/CentOS/6.5/os/x86_64/ http://ftp.stust.edu.tw/pub/Linux/CentOS/6.5/os/x86_64/ http://ftp.nsysu.edu.tw/CentOS/6.5/os/x86_64/ http://ftp.isu.edu.tw/pub/Linux/CentOS/6.5/os/x86_64/ http://ftp.twaren.net/Linux/CentOS/6.5/os/x86_64/ http://mirrors.skyshe.cn/centos/6.5/os/x86_64/ http://centos.ustc.edu.cn/centos/6.5/os/x86_64/ http://mirrors.hust.edu.cn/centos/6.5/os/x86_64/ 手動設定Repositories # cd /etc/yum.repos.d # cp ./CentOS-Base.repo ./CentOS-Base.repo.bak # 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 #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-6 #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://mirror01.idc.hinet.net/CentOS/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib baseurl=http://mirror01.idc.hinet.net/CentOS/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror01.idc.hinet.net/CentOS/RPM-GPG-KEY-CentOS-6

使用光碟或其他離線檔案安裝套件
# vi ./CentOS-Media.repo
# CentOS-Media.repo # # This repo can be used with mounted DVD media, verify the mount point for # CentOS-6. You can use this repo and yum to install items directly off the # DVD ISO that we release. # # To use this repo, put in your DVD and use it with the other repos too: # yum --enablerepo=c6-media [command] # # or for ONLY the media repo, do this: # # yum --disablerepo=\* --enablerepo=c6-media [command] [c6-media] name=CentOS-$releasever - Media baseurl=file:///media/CentOS/ file:///media/cdrom/ file:///media/cdrecorder/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6