未读
增加域名和HTTPS支持
#配置nginx https访问
配置nginx https访问
修改 nginx配置文件 这是一个配置模板,文件位于/etc/nginx/sites-enabled
1234567891011121314listen 80;#将http转发至443listen 443 ssl default_server;listen [::]:443 ssl default_server;server_name xysblog.top;ssl_certificate XXX.XXXX.pem;ssl_certificate_key XXX.XXXX.key;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;ssl_prefer_server_ciphers on;#root /var/www/html;root /home/chen/workspace/blog/blog/pu ...
未读
在linux上安装nodejs-hexo-nginx
安装 Node.js
前往网站 https://nodejs.org/en/download/ 下载对应版本使用 uname -a 命令查看 Linux 系统的架构
版本对应表:
架构
输出
i386, i686
i386
x86_64
amd64
arm, armel
arm_garbage
armv7l, armhf
armv7*
aarch64, armv8l
arm64
mips
mips*
mips64
mips64*
解压对应文件,进入文件夹,测试 bin/node、bin/npm 是否能正常使用解压时如果缺少 xz 工具包,需要执行 sudo apt install -y xz-utils
将文件夹重命名为 nodejs,并移动到 /opt/ 目录下
创建软链接将两个 bin 文件链接到系统的 bin 目录下(以后 npm 下载的所有 bin 工具均需要执行软链接,例如 npm install http-server -g)软链接命令:
12sudo ln -s /opt/nodejs/bin/node /usr/bin/ ...
未读
建站笔记
为hexo增加图片支持 修改_config.yml中post_asset_folder: true
下载 hexo-image-link$ npm install hexo-image-link --save
如果 npm下载比较慢的话,尝试 cnpm下载 $ npm install -g cnpm --registry=https://registry.npm.taobao.org $ cnpm install hexo-image-link --save 修改md文件中的图片路径 [label](markdown-file-name/image-name.jpg)
增加封面图片支持
1234567---title: 在linux上安装nodejs-hexo-nginxdate: 2024-01-24 16:09:05tags:comments: truecover: 2024/01/24/nodejs-hexo-nginx/image-js.png---
cover路径如上,日期加相对路径,可以保证封面图片和文章图片位于一个资源文件夹下
未读
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment