Caddy php 配置

Caddy php 配置

六月 8, 2018 阅读 1991 字数 843 评论 0 喜欢 0

安装Caddy

官网:https://caddyserver.com/download

选择平台、插件、执照即可下载。

官方提供两种下载方式

直接下载、一键安装脚本

推荐使用一键安装脚本:

curl https://getcaddy.com | bash -s personal 

安装php

yum install php php-fpm php-mysql php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc

 

修改php配置文件

vi /etc/php-fpm.d/www.conf

原配置

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = apache
; RPM: Keep a group allowed to write in log dir.
group = apache

修改后

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = caddy
; RPM: Keep a group allowed to write in log dir.
group = caddy

修改后保存启动php-fom

systemctl start php-fpm

添加新用户

useradd caddy

切换用户caddy

su caddy

在web目录下创建配置文件Caddyfile

www.example.com
gzip
tls [email protected]
fastcgi / 127.0.0.1:9000 php

保存后启动caddy

发表评论