Skip to content

Đây là nơi lưu trữ và chia sẻ mã nguồn trang blog của mình.

License

Notifications You must be signed in to change notification settings

anhnbt/blog.anhnbt.com

Repository files navigation

Blog AnhNBT.

Đây là nơi lưu trữ và chia sẻ mã nguồn trang blog của mình: Demo

Hướng dẫn cài đặt

Clone project: https://github.com/anhnbt/blog

Install thư viện:

npm i

Cài đặt Gatsby CLI: https://www.gatsbyjs.com/docs/tutorial/part-0/#gatsby-cli

npm install -g gatsby-cli

Kiểm tra version

gatsby --version

Chạy dự án trên localhost

npm run develop

hoặc

gatsby develop

Build & Deploy dự án

gatsby build

Copy toàn bộ file trong thư mục ./public lên server thư mục /opt/blog

Tạo file cấu hình Nginx:

vim /etc/nginx/sites-enabled/blog

Cấu hình Nginx Web Server trỏ tới thư mục chứa file build

server {
        listen 80;

        server_name blog.anhnbt.com;

        root /opt/blog;

        index index.html;

        location / {
                try_files $uri /index.html =404;
        }
}

Cài đặt SSL

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d blog.anhnbt.com 

Đợi câu hỏi prompt hiện ra thì lần lượt làm theo các bước sau:

  • Email: anhnbt.it@gmail.com
  • Nhập A
  • Nhập N
  • Nhập 2

About

Đây là nơi lưu trữ và chia sẻ mã nguồn trang blog của mình.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published