Cannot retrieve metalink for repository: epel. Please verify its
path and try again
一、先删除httpd和php
[root@centos6 ~]# yum remove httpd* php*
二、添加yum源
# yum install yum-priorities -y
# rpm -Uvh
http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-7.noarch.rpm
--32bit
默认yum源中没有这个包,特意安装epel第三方yum源
[root@lb plugins]# rpm
-Uvh
http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
---64bit
Retrieving
http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.BM4bHz: Header V3 RSA/SHA256 Signature,
key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
[root@lb plugins]# yum install
nginx --报错,修改epel.repo ](将baseurl启用,mirrorlist注释):
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for
repository: epel. Please verify its path and try
again
在执行安装的时候就悲剧了,yum clean all
也试过,无济于事儿,网络上搜索于是得到了解决[留意紫罗兰颜色部分](将baseurl启用,mirrorlist注释):[root@lb ~]# vi
/etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch -
Debug
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch -
Source
baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
三、安装nginx
[root@centos6 yum.repos.d]# yum install nginx
四、开启REMI,编辑 /etc/yum.repos.d/remi.repo
修改 enable=1
五、安装nginx mysql php
yum -y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator
linux可能会提示没有libmcrypt.so, 解决办法如下:
rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
yum clean all
yum makecache
yum installlibmcrypt
六、安装
设置nginx、php-fpm开机启动:
# chkconfig nginx on
# chkconfig php-fpm on
最后重启nginx
# /etc/init.d/nginx restart # /etc/init.d/php-fpm restart