网站开发按钮图片素材,万能网站浏览器,怎么用PS做珠宝网站,服务专业的网站建站公司背景#xff1a;
服务器需要执行hexo s来运行项目#xff0c;但这个命令是基于前台的#xff0c;故想直接嫁接在systemctl命令基础上来控制环境#xff1a; Centos 8 前置环境就不说了,Hexo安装好#xff0c;起码装完自己得先看hexo命令生效没#xff0c;前置环境做好后…背景
服务器需要执行hexo s来运行项目但这个命令是基于前台的故想直接嫁接在systemctl命令基础上来控制环境 Centos 8 前置环境就不说了,Hexo安装好起码装完自己得先看hexo命令生效没前置环境做好后 1、先把hexo的命令建个软链
ln -s /usr/local/software/node-v19.0.0-linux-x64/lib/node_modules/hexo-cli/bin/hexo /usr/local/bin/hexo不是很明白的话直接看图这样会方便很多 2、创建三个脚本位置不要改
sudo vi /etc/systemd/system/hexo-cl.service [Unit]Descriptionhexo cleanAfternetwork.target[Service]ExecStart/usr/local/bin/hexo clUserrootWorkingDirectory/www/wwwroot/blog.tuomasi-dang.com/blog[Install]WantedBymulti-user.target
sudo vi /etc/systemd/system/hexo-g.service [Unit]Descriptionhexo generateAfternetwork.target hexo-cl.service[Service]ExecStart/usr/local/bin/hexo gUserrootWorkingDirectory/www/wwwroot/blog.tuomasi-dang.com/blog[Install]WantedBymulti-user.targetsudo vi /etc/systemd/system/hexo.service [Unit]Descriptionhexo serverAfternetwork.target hexo-g.service[Service]ExecStart/usr/local/bin/hexo sRestartalwaysUserrootWorkingDirectory/www/wwwroot/blog.tuomasi-dang.com/blog[Install]WantedBymulti-user.target 注WorkingDirectory的目录简单来说就是你的hexo工作目录直白点就是在这个目录下你的hexo命令是可以运行的 3、刷新systemctl配置 sudo systemctl daemon-reload4、然后就可以通过这些命令来进行管理 eg: 启动hexo sudo systemctl start hexo-clsudo systemctl start hexo-gsudo systemctl start hexo
管理hexo sudo systemctl start hexosudo systemctl stop hexosudo systemctl restart hexosudo systemctl status hexo 补充 网址放出去了千万别乱搞啊撑不住 END