Skip to content

arcana261/ucoder

Repository files navigation

Install Hexo

sudo npm install -g hexo-cli
npm install

Serve

hexo server

Admin Panel

Open http://127.0.0.1:4000/admin

Generate

hexo generate

Nginx Config

First create an nginx configuration, assuming code is cloned as /usr/share/nginx/ucoder.ir

server {
  listen 80;
  server_name ucoder.ir;
  server_name www.ucoder.ir;

  root /usr/share/nginx/ucoder.ir/public;
}

Now install certbot to enable SSL

yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
sudo yum install certbot-nginx

Enable CertBot on our Nginx Configuration

sudo certbot --nginx

OR IF YOU RUN INTO BUG PROBLEM

sudo certbot --authenticator standalone --installer nginx --pre-hook "systemctl stop nginx" --post-hook "systemctl stop nginx"

Test if renewal procedure succeeds

sudo certbot renew --dry-run

Enable CronTab job to renew our certificates automatically

sudo crontab -e
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew 

Allow Nginx to read user content

setsebool -P httpd_read_user_content 1

OR SIMPLY USE ANSIBLE

About

My personal blog in hexo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published