nano /etc/caddy/Caddyfile #返回配置文件内容 # The Caddyfile is an easy way to configure your Caddy web server. # # Unless the file starts with a global options block, the first # uncommented line is always the address of your site. # # To use your own domain name (with automatic HTTPS), first make # sure your domain's A/AAAA DNS records are properly pointed to # this machine's public IP, then replace the line below with your # domain name. # :80 # Set this path to your site's directory. # root \* /usr/share/caddy # root \* /home/wwwroot/weixinRSSxml # Enable the static file server. # file\_server # Another common task is to set up a reverse proxy: # reverse\_proxy localhost:8080 # Or serve a PHP site through php-fpm: # php\_fastcgi localhost:9000 # Refer to the Caddy docs for more information: # https://caddyserver.com/docs/caddyfile # 闲作坊网站 你的域名 { encode gzip root \* /home/wwwroot/网站目录 file\_server php\_fastcgi 127.0.0.1:9000 #PHP7.4-fpm配置一致 }
如上修改好后,退出保存。重启caddy服务
1 2
service caddy restart #重启 service caddy status #查看状态
mysql -uroot -p“安装mysql-server设置root密码” #不需要“” # 登录MySQL之后,使用如下命令: >create database 你的数据库名称; >use 你的数据库名称; >create user 'admin'@'%' identified by '密码'; >grant all privileges on 你的数据库名称.\* to 'admin'@'%'; >flush privileges; >exit; # 退出数据库后,重启数据库 service mysql restart
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
service mysql status #正常返回信息 ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-03-19 17:19:27 CST; 1 weeks 0 days ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Main PID: 1717 (mysqld) Status: "Server is operational" Tasks: 38 (limit: 4915) Memory: 328.5M CPU: 9min 24.320s CGroup: /system.slice/mysql.service └─1717 /usr/sbin/mysqld Mar 19 17:19:26 lance-aliyun systemd[1]: Starting MySQL Community Server... Mar 19 17:19:27 lance-aliyun systemd[1]: Started MySQL Community Server.
nano /etc/php/7.4/fpm/pool.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. user = www-data group = www-data ; The address on which to accept FastCGI requests. ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; ; 'port' - to listen on a TCP socket to all addresses ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. ;listen = /run/php/php7.4-fpm.sock #注释掉 listen = 127.0.0.1:9000 #新添加 ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) ;listen.backlog = 511