CentOS-9部署PHP系统

使用centos-9-stream-default_20221109_amd64.tar.xz模板安装LXC

一、SSH服务器和常用工具

1:安装ssh服务器

dnf update
dnf install openssh-server
dnf install tar tmux

2:配置SSH服务器文件

vi /etc/ssh/sshd_config

PermitRootLogin yes
PasswordAuthentication yes

3:启动SSH服务器

service sshd start

4:启用登录密钥

mkdir -p ~/.ssh&&echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINczVrP1nQt56KrtY0zFDRYvNGjMVS2MphwNWXH5j7yg xixi-ed25519-20240206'>>~/.ssh/authorized_keys

二、PHP-FPM

1:安装php7.4

dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf module list php
dnf module enable php:remi-7.4
dnf install php-fpm php-mysqli php-redis php-xml php-mbstring php-intl
systemctl enable php-fpm

2:配置文件

;listen = /run/php-fpm/www.sock
listen = 127.0.0.1:9000

3:重启FPM服务

service php-fpm restart

三、NGINX

1:安装NGINX

dnf install nginx
systemctl enable nginx
service nginx restart

四、MySQL

yum install mysql-server
systemctl enable mysqld
service mysqld restart

五、Redis

dnf install redis
systemctl enable redis
vi /etc/redis/redis.conf
requirepass your_password
service redis restart

六、SVN

dnf install subversion
systemctl enable svnserve
vi /etc/sysconfig/svnserve
service svnserve restart

其他系统相关的IP修改

vi /var/www/html/project/ai_frontend/dist/config.js
vi /var/www/html/project/ai_backend/public/config.php