使用remi源更新redhat企业级linux6.0中的PHP+MySQL版本

使用remi源更新redhat企业级linux6.0中的PHP+MySQL版本(这篇文章也发在了我的个人博客:http://blog.opendigest.org/show-751-1.html

注意:本文介绍的方法也适用于redhat enterprises linux6 / centos5 /fedora,只需要适当变通一下安装的软件包就可以了。

为何用remi源更新rhel中内置的PHP+MySQL版本?自带的PHP+MySQL版本一般都比当前最新的稳定版低,想使用最新的稳定版本需要手动便宜安装,耗时不用说了,还要解决令人头疼的一系列的软件的依赖关系,作为系统管理员希望找到便捷的升级PHP+MySQL版本的方法。remi源针对Fedora和rhel、CentOS的更新源。remi解决了相关软件的依赖关系,而且不会跟Fedora和rhel、CentOS原来的软件包冲突。remi使用yum自动从网络上下载需要更新的软件包进行更新。下面是详细的配置过程。

remi官方网站:http://rpms.famillecollet.com/

本文参考网址:http://blog.famillecollet.com/pages/Config-en

1.下载和安装必须的rpm包

wget http://download.fedora.redhat.com/pub/epel/beta/6/i386/epel-release-6-5.noarch.rpm     (注意remi需要使用EPEL,所以要安装epel的rpm包)
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

epel安装的文件列表如下:

/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/epel.repo
/usr/share/doc/epel-release-6
/usr/share/doc/epel-release-6/GPL

remi安装的文件列表:

/etc/pki/rpm-gpg/RPM-GPG-KEY-remi   (数字签名文件)
/etc/yum.repos.d/remi.repo                   (repo配置文件)

使用这两个rpm包就是为了方便repo的配置的。如果要手动下载这几个repo配置文件也可以(参考上面的http://blog.famillecollet.com/pages/Config-en

2.使用yum更新或者安装需要的软件包

#yum --enablerepo=remi update php
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia. Please verify its path and try again

出现上述的错误,需要编辑文件:/etc/yum.repo.d/packagekit-media.repo,在最后添加“enabled=0”,禁用此repo配置。或者直接将其删除即可。

#yum --enablerepo=remi update mysql

注意写本文时remi还没有php的更新包,所以更新php时会提示没有包需要更新。只有测试包。如果想所以remi的测试包升级php(不推荐):

#yum --enablerepo=remi-test update php

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在 CentOS 7 上安装 Zabbix 6.0、Nginx、MySQL 8、PHP 7.4 的步骤: 1. 安装 EPEL 和 Remi : ``` yum install -y epel-release rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm ``` 2. 安装 Nginx: ``` yum install -y nginx systemctl start nginx systemctl enable nginx ``` 3. 安装 PHP 7.4: ``` yum install -y php74-php-fpm php74-php-mysqlnd php74-php-xmlrpc php74-php-gd php74-php-intl php74-php-mbstring php74-php-soap php74-php-xml php74-php-json php74-php-zip systemctl start php74-php-fpm systemctl enable php74-php-fpm ``` 4. 安装 MySQL 8: ``` rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm yum install -y mysql-community-server systemctl start mysqld systemctl enable mysqld ``` 5. 配置 MySQL: ``` mysql_secure_installation ``` 6. 创建 Zabbix 数据库: ``` mysql -u root -p CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost'; FLUSH PRIVILEGES; EXIT; ``` 7. 导入 Zabbix 数据库: ``` cd /usr/share/doc/zabbix-server-mysql-6.0.0/ zcat create.sql.gz | mysql -u zabbix -p zabbix ``` 8. 安装 Zabbix Server 和 Agent: ``` yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent ``` 9. 配置 Zabbix: ``` vi /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=password ``` 10. 启动 Zabbix Server 和 Agent: ``` systemctl start zabbix-server zabbix-agent systemctl enable zabbix-server zabbix-agent ``` 11. 配置 Nginx: ``` vi /etc/nginx/conf.d/zabbix.conf server { listen 80; server_name localhost; root /usr/share/zabbix; location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass unix:/run/php74-php-fpm/zabbix.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } ``` 12. 重启 Nginx: ``` systemctl restart nginx ``` 13. 打开浏览器,输入服务器 IP 地址,进入 Zabbix Web 界面,按照提示进行 Zabbix 配置即可。 注意:以上步骤仅供参考,具体操作根据实际情况进行调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值