sudo systemctl enable nginx # 设置开机启动 sudo service nginx start # 启动 nginx 服务 sudo service nginx stop # 停止 nginx 服务 sudo service nginx restart # 重启 nginx 服务 sudo service nginx reload # 重新加载配置,一般是在修改过 nginx 配置文件时使用。
当我在执行 sudo service nginx start 时会报这个错误,
1 2 3
[root@VM-0-8-centos ~]# sudo service nginx start Redirecting to /bin/systemctl start nginx.service Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
joe@joes-MacBook-Pro Blog % npm run deploy Debugger attached. > hexo-site@0.0.0 deploy /Users/joe/Documents/Blog > hexo deploy
Debugger attached. INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... On branch master nothing to commit, working tree clean The authenticity of host '175.24.24.72 (175.24.24.72)' can't be established. ECDSA key fingerprint is SHA256:******. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '175.24.24.72' (ECDSA) to the list of known hosts. root@175.24.24.72's password: #这里输入服务器密码 Enumerating objects: 178, done. Counting objects: 100% (178/178), done. Delta compression using up to 4 threads Compressing objects: 100% (144/144), done. Writing objects: 100% (178/178), 2.71 MiB | 8.08 MiB/s, done. Total 178 (delta 23), reused 0 (delta 0) To 175.24.24.72:/home/git/blog * [new branch] HEAD -> master Branch 'master' set up to track remote branch 'master' from 'root@175.24.24.72:/home/git/blog'. INFO Deploy done: git
joe@joes-MacBook-Pro Blog % hexo d INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... [master dee1457] Site updated: 2021-08-17 10:05:07 1 file changed, 1 insertion(+), 1 deletion(-) git@175.24.24.72's password: #输入上面设置的git密码 Enumerating objects: 7, done. Counting objects: 100% (7/7), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (4/4), 365 bytes | 365.00 KiB/s, done. Total 4 (delta 2), reused 0 (delta 0) remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: remote unpack failed: unpack-objects abnormal exit To 175.24.24.72:/home/git/blog.git ! [remote rejected] HEAD -> master (unpacker error) error: failed to push some refs to 'git@175.24.24.72:/home/git/blog.git' FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html Error: Spawn failed at ChildProcess.<anonymous> (/Users/joe/Documents/Blog/node_modules/hexo-util/lib/spawn.js:51:21) at ChildProcess.emit (events.js:314:20) at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
joe@joes-MacBook-Pro Blog % hexo d INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... On branch master nothing to commit, working tree clean git@175.24.24.72's password: #输入上面设置的git密码 Enumerating objects: 7, done. Counting objects: 100% (7/7), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (4/4), 365 bytes | 365.00 KiB/s, done. Total 4 (delta 2), reused 0 (delta 0) fatal: Unable to create '/home/git/blog.git/refs/heads/master.lock': ???? fatal: the remote end hung up unexpectedly fatal: the remote end hung up unexpectedly FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html Error: Spawn failed at ChildProcess.<anonymous> (/Users/joe/Documents/Blog/node_modules/hexo-util/lib/spawn.js:51:21) at ChildProcess.emit (events.js:314:20) at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)