1. PHP安装配置
参考wordpress 6.5.2版本安装记录 中关于PHP安装方法,此处不再详述。
修改php-fpm的启动用户和组为vmail,这一步是和nginx配置相呼应。配置文件/etc/opt/remi/php83/php-fpm.d/www.conf 下面几个配置:
user vmail
group vmail
listen.acl_users = vmail
#access.log = /var/opt/remi/php83/log/php-fpm/$pool.access.log #可选配置
listen = /var/opt/remi/php83/run/php-fpm/www.sock # 这个配置需要记录一下,下面nginx的配置需要用到
配置启动php-fpm:
systemctl enable php83-php-fpm
systemctl start php83-php-fpm
2. Nginx安装配置
2.1 安装nginx
yum install nginx
2.2 /etc/nginx/nginx.conf 配置文件
user vmail; #以vmail身份运行,下面会涉及相关的配置
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# 日志文件位置
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}