centos7.9安装php7.4.30+nginx+apache+mysql

安装php7.4.30
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

rpm -Uvh epel-release-latest-7.noarch.rpm
rpm -Uvh remi-release-7.rpm

yum install yum-utils
yum-config-manager --enable remi-php74

yum -y install php74 php-cli php-common \
    php-devel php-gd php-json php-mbstring \
    php-mysqlnd php-pdo php-pear \
    php-pecl-zip php-process php-xml php-ldap

# php -v
PHP 7.4.30 (cli) (built: Jun  7 2022 08:38:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
安装nginx
]# yum -y install nginx

启动nginx
]# systemctl start nginx
安装httpd
]# yum -y install httpd
启动
]# httpd
安装mysql5.7
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-1.el7.x86_64.rpm-bundle.tar

]# tar -xvf mysql-5.7.38-1.el7.x86_64.rpm-bundle.tar

安装服务
]# rpm -ivh mysql-community-common-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-libs-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-client-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-server-5.7.38-1.el7.x86_64.rpm
]# rpm -ivh mysql-community-devel-5.7.38-1.el7.x86_64.rpm

启动
]# service mysqld start
查看初始化密码
]# grep 'temporary password' /var/log/mysqld.log
2022-08-18T08:34:12.220988Z 1 [Note] A temporary password is generated for root@localhost: iNKuulhDa3=w

无密码登录
]# mysql -u root -p

修改密码

update mysql.user set authentication_string=password('xxxx') where user='root';
flush privileges;

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
以下是在 CentOS 7 上安装 Zabbix 6.0、NginxMySQL 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 配置即可。 注意:以上步骤仅供参考,具体操作根据实际情况进行调整。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值