注册服务
根据教程步骤操作的小伙伴需要PHP-FPM配置文件:输入命令
sudo mv/usr/local/php7/etc/php-fpm.conf.default/usr/local/php7/etc/php-fpm.conf
sudo mv/usr/local/php7/etc/php-fpm.d/xxx.conf.default/usr/local/php7/etc/php-fpm.d/www.conf
注册服务为:
sudo vim /usr/lib/systemd/system/php-fpm.service
添加内容:
[Unit]
Description=php-fpm
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/php7/sbin/php-fpm
PrivateTmp=true
[Install]
WantedBy=multi-user.target
最后启动即可:输入一下代码
systemctl daemon-reload
systemctl start php-fpm. service
lsof -i: 9000

搭建下载BlessingSkin
首先,创建一个目录,作为网站目录:
mkdir /www/BlessingSkin -pv
cd /www/BlessingSkin
之后,下载BlessingSkin的发行版本,选择安装6.0.0-beta.3:
Wget'xxxxx://github.xxx/bs-community/blessing-skin-server/releases/download/6.0.0-beta.3/blessing-skin-server-6.0.0-beta.3.zip'
解压即可:
unzip blessing-skin-server-6.0.0-beta.3.zip

安装官网要求需要重命名和初始化:输入以下代码
cp .env.example .env
/usr/local/php7/bin/php artisan key:generate (初始化)

配置Nginx
vim /usr/local/nginx/nginx.conf
查看:输入以下代码
user www;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name localhost;
root /www/BlessingSkin/public;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$query_string;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# php-fpm配置
location ~ [^/]\.php(/|$){
# try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}
}
3. 提权&重载配置
刚刚都是用root用户直接修改文件,现在把网站目录权限移交给www:
chown www:www /www -R
重载配置:systemctl reload nginx
浏览器访问网站,即可看到效果:

