クラウドサーバー+ドメイン名+ hexoビルドブログ

80,4000,22ポート1つのアリクラウドサーバーセキュリティグループのルールを有効にし、

方向を設定することも忘れないでください、または他の...

2ドメイン名は、サーバのIPを指します

3 gitのインストール

yum install git

4のNode.jsをインストールします。

ダウンロードアドレス:(のwgetコマンド、または自分のコンピュータを介してアップロードすることができます)

https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.gz

減圧

[root@VM_0_7_centos ~]# tar zxvf node-v12.13.1-linux-x64.tar.gz 

/ usr / localの下に置きます

[root@VM_0_7_centos ~]# mv node-v12.13.1-linux-x64 /usr/local/

/ binディレクトリへのソフトリンク

[root@VM_0_7_centos ~]# ln -s /usr/local/node-v12.13.1-linux-x64/bin/node /bin/node
[root@VM_0_7_centos ~]# ln -s /usr/local/node-v12.13.1-linux-x64/bin/npm /bin/npm

テスト環境変数

[root@VM_0_7_centos ~]# node -v
v12.13.1
[root@VM_0_7_centos ~]# npm -v
6.12.1

5インストールhexo

npm install -g hexo-cli

接続を設定します

[root@VM_0_7_centos node_modules]# ln -s /usr/local/node-v12.13.1-linux-x64/lib/node_modules/hexo-cli/bin/hexo /bin/hexo

ブログのファイルを生成します

[root@VM_0_7_centos ~]# hexo init hexos

[root@VM_0_7_centos ~]# cd hexos/

静的接続を生成します

[root@VM_0_7_centos hexos]# hexo g
[root@VM_0_7_centos hexos]# hexo s

表示ページ

http://106.54.3.104:4000/

6インストールnginxの

[root@VM_0_7_centos hexos]# yum install nginx

オープンサービス

[root@VM_0_7_centos hexos]# systemctl start nginx

表示ページ

http://IP地址

最初から設定したブート

[root@VM_0_7_centos hexos]# systemctl enable nginx
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.

図7は、構成ファイルを変更nginxの

[root@VM_0_7_centos public]# vim /etc/nginx/nginx.conf

修正ライン4

user root;

修正ライン41

        server_name  www.sunlizhao.cn;

修正ライン42

        root         /root/hexos/public;

ブログのディレクトリを入力します(キャッシュをクリアし、生成するページ、アップロード)

[root@VM_0_7_centos hexos]# pwd
/root/hexos
[root@VM_0_7_centos hexos]# hexo clean
[root@VM_0_7_centos hexos]# hexo g
[root@VM_0_7_centos hexos]# hexo d

再起動nginxのサービス

[root@VM_0_7_centos hexos]# nginx -s reload

あなたは、ページへのIPまたはドメイン名でアクセスすることができます!

おすすめ

転載: www.cnblogs.com/inmeditation/p/12051710.html