惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
SecWiki News
SecWiki News
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
P
Palo Alto Networks Blog
V
Vulnerabilities – Threatpost
Project Zero
Project Zero
WordPress大学
WordPress大学
NISL@THU
NISL@THU
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Privacy & Cybersecurity Law Blog
Jina AI
Jina AI
AWS News Blog
AWS News Blog
Scott Helme
Scott Helme
Martin Fowler
Martin Fowler
C
Cybersecurity and Infrastructure Security Agency CISA
Forbes - Security
Forbes - Security
H
Heimdal Security Blog
小众软件
小众软件
I
Intezer
A
Arctic Wolf
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
O
OpenAI News
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
Latest news
Latest news
G
GRAHAM CLULEY
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
N
News and Events Feed by Topic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V2EX - 技术
V2EX - 技术
Stack Overflow Blog
Stack Overflow Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LINUX DO - 最新话题
博客园 - Franky
P
Proofpoint News Feed
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
P
Proofpoint News Feed
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
F
Full Disclosure
Security Latest
Security Latest

herrkaefer

"Vibe planning \u003e vibe coding" "Anything to Markdown" "Built anocus: anonymous commenting for static sites" "日记与小说 -- AI 续写小说欣赏" "Any-podcast: from newsletters to a podcast" "Made MicPipe: a simple voice input tool using ChatGPT dictation" "关于 Tools 和 Skills 的一点感想" "Realtime monitoring of ComEd hourly price" "Introducing SwiftEdgeTTS" "Thoughts on the philosophy of building AI-native apps" "jelly鼻屎" "等饭的人" "Use home assistant to motivate my kid to brush teeth" "Migrated Blog to Hugo and Cloudflare Pages" "Easy Aspen monitoring for Chicago parents" "Introducing HabitBuilder: A simple Telegram bot for habit tracking" "鼓捣" "Open folder or file with Sublime Text from Finder toolbar" "Python dev workflow on macOS" "Create new text file from Finder toolbar" "Uno reinvented for 3-year-old kids" "Uno变身儿童数字游戏" "自动转发Twitter到微博" "Handle annoying operations of objects in Realm DB" "Introducing Mole" "Note taking without note taking app" "Deploy Python web application on Ubuntu server" "Setup Shadowsocks / VPN on Ubuntu Server" "Linode Notes - Basic Setup" "CLASS Style Adapted for Embedded Systems" "psycopgr Tutorial" "pgRouting Notes" "PostgreSQL Notes" "阿城三王" "这一年,这一把日子" "另一面的发现——读《坟》" "定理" "封面与腰封" "Google book下载" "lulu最新写真出炉" "The Big Bang Theory第三季" "自拍婚纱照1" "日全食" "期待动画片" "《麦兜响当当》动画电影主题曲" "转:饶毅--“杂志拜物教”:何时发Cell Nature Science 论文害你" "转:饶毅--提醒年轻人:何时SCI害你?" "西安" "3d打印机" "Dropbox" "刷牙" "贴几张照片" "6156167" "永久和凤凰" "老板的想法" "春" "原来奥巴马也是个朗读者" "应邀发Freeware List 2.0" "史上最能睡的淘宝老板" "至少出名的效果是达到了" "错怪了msn" "独立游戏节2009" "114" "馒头" "Crayon Physics Deluxe" "2008,2009" "盖章记" "小虎队附身许巍" "怎么给word文档加索引:排序问题" "怎么给word文档加索引Q\u0026amp;A" "怎么给Word文档加索引" "教我如何不疯掉" "二则" "P" "哦!报告" "蓝天" "萧翰" "lm" "故宫印象" "转:美国历任总统像" "time can kill itself" "嗯" "建议,只是建议哦" "奥地利行记3" "奥地利行记2" "奥地利行记1" "叶子" "GayBoy" "天使教你扔frisbie" "门徒因何面容愁?" "手机教堂" "丝竹管弦之盛" "残奥" "争座位" "秋意浅" "总理府" "流觞曲水" "映带左右引以为" "咚咚咚 续" "茂林修竹又有"
"Move Jekyll blog to Ubuntu VPS"
"herrkaefer" · 2017-02-20 · via herrkaefer

(Tested on: Linode with Ubuntu 16.04 LTS)

Install Jekyll on Ubuntu VPS




sudo apt update && apt -y upgrade



sudo apt install ruby ruby-dev ruby-bundler zlib1g-dev build-essential make gcc git jekyll bundler

Automated deployment with Git

On VPS,




mkdir ~/blog.git # the site source



mkdir -p ~/www/blog # the built site

Setup git hook to automatically build the site whenever after site source is updated:




cd ~/blog.git



git init --bare



cp hooks/post-update.sample hooks/post-receive

> --bare means that our folder will have no source files, just the version control.

Edit hooks/post-receive:




#!/bin/sh



GIT_REPO=$HOME/blog.git



TMP_GIT_CLONE=$HOME/tmp/blog



PUBLIC_WWW=$HOME/www/blog



git clone $GIT_REPO $TMP_GIT_CLONE



jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW



rm -Rf $TMP_GIT_CLONE



exit

Serve static site with Nginx

Install nginx:

Add a configuration:




sudo nano /etc/nginx/conf.d/blog.conf

with content:




server {



# listen on http (port 80)



# remove the "default_server" if you are running multiple sites off the same VPS



listen 80 default_server;



# the IP address of your VPS



server_name herrkaefer.com;



# see http://nginx.org/en/docs/http/server_names.html for options



# to use your own domain, point a DNS A record at this IP address



# and set the server name to (eg.) "blog.example.com"



# the path you deployed to. this should match whatever was in your



# Capistrano deploy file, with "/current" appended to the end



# (Capistrano symlinks to this to your current site)



root /home/herrkaefer/www/blog;



index index.html



# how long should static files be cached for, see http://nginx.org/en/docs/http/ngx_http_headers_module.html for options.



expires 1d;



}

Then remove default config file and restart Nginx:




sudo rm /etc/nginx/sites-enabled/default



sudo systemctl restart nginx

Remember to allow Nginx port if the firewall is enabled.

Local machine setup

On local machine, in Jekyll repo folder, add remote repository:

Show remotes:

Add remote named web:




git remote add web username@[host]:~/blog.git

If you need to specify other SSH port, you should do:




git remote add web ssh://username@[host]:[port][absolutePathTo]/blog.git

note that ssh:// can not be omitted.

Write and publish

After writing,




git commit -am "blog updated"



git push web master

Troubleshoot

Nginx 403 Forbidden

nginx 403 Forbidden 排错记录 - 简书