jmlot

jmlot

记录分享学习过程

Setting up Hexo blog (Ubuntu server)

Setting up Hexo Blog#

1. Server Configuration#

Server Requirements#

Programs that need to be installed on the server

  • Nginx
  • Node.js (Node.js version should not be lower than 10.13, it is recommended to use Node.js 12.0 and above)
  • Git
  • npm (I didn't have the npm command after installing Node, so I had to install it myself)

Using Ubuntu server as an example

First, update the system

sudo apt-get update && apt-get upgrade -y
  1. Install Nginx
sudo apt install nginx
  1. Install Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
  1. Install Git
sudo apt-get install git
  1. Install npm
apt install npm

Install Hexo#

  1. Create a directory to store files
mkdir /var/hexo && cd /var/hexo
  1. Install Hexo
npm install -g hexo-cli
  1. Initialization

Go to the hexo folder created earlier and execute

hexo init jmlot
# Then a jmlot folder will be created, the blog files seem to be placed here
  1. Generate static files, an additional public folder will be created
hexo g

image-20230419172240854

Newly generated Public folder

image-20230419172344837

  1. View the blog
hexo s

Hexo Help Commands#

image

The blog program has been set up and can run normally!

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.