CentOS-7部署PHP-7.4
CentOS-7部署PHP-7.4
使用CentOS-7-x86_64-Minimal-2009.iso安装
一、常用操作
1:关闭防火墙
service firewalld stop
systemctl disable firewalld
2:启用登录密钥
mkdir -p ~/.ssh&&echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINczVrP1nQt56KrtY0zFDRYvNGjMVS2MphwNWXH5j7yg xixi-ed25519-20240206'>>~/.ssh/authorized_keys
3:下载常用工具
yum install tmux wget
4:关闭SELinux
setenforce 0
vi /etc/selinux/config
SELINUX=permissive
二、PHP-FPM服务
1:安装php7.4
yum install epel-release
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum --enablerepo=remi install php74-php-fpm php74-php-mysqli php74-php-redis php74-php-xml php74-php-mbstring php74-php-intl
systemctl enable php74-php-fpm
(rpm -ivh remi-release-7.rpm依赖epel-release)
2:配置文件
vi /etc/opt/remi/php74/php-fpm.d/www.conf
;listen = /run/php-fpm/www.sock
listen = 127.0.0.1:9000
3:重启FPM服务
service php74-php-fpm restart
三、NGINX服务器
1:安装NGINX
yum install epel-release
yum install nginx
systemctl enable nginx
service nginx restart
(yum install nginx依赖epel-release)
或者可以直接指定包
yum install pcre2
wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.24.0-1.el7.ngx.x86_64.rpm
rpm -ivh nginx-1.24.0-1.el7.ngx.x86_64.rpm
systemctl enable nginx
service nginx restart
四、MySQL-8.0服务器
yum remove -y mariadb-libs
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-common-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-plugins-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-libs-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-icu-data-files-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-server-8.0.36-1.el7.x86_64.rpm
systemctl enable mysqld
service mysqld restart
五、Redis服务器
yum install redis
systemctl enable redis
vi /etc/redis.conf
requirepass your_password
service redis restart
六、SVN服务器
yum install subversion
systemctl enable svnserve
vi /etc/sysconfig/svnserve
OPTIONS="-r /var/svn"
service svnserve restart
本文来自博客园,作者:项希盛,转载请注明原文链接:https://www.cnblogs.com/xiangxisheng/p/18074011
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!