Skip to content

Instantly share code, notes, and snippets.

@davidneelin
Last active January 5, 2017 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidneelin/d3d4b978bbcd8afac24ae9da077b6142 to your computer and use it in GitHub Desktop.
Save davidneelin/d3d4b978bbcd8afac24ae9da077b6142 to your computer and use it in GitHub Desktop.
auto install ghost blog system
curl --L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
unzip -uo ghost.zip -d /data/web/ghost
cd /data/web/ghost && npm install --production && npm start --production
useradd -r -s /bin/false ghost
cat << STR >> /etc/systemd/system/ghost.service
[Unit]
Description=Ghost blog
After=network.target
[Service]
Type=simple
PIDFile=/var/run/ghost.pid
WorkingDirectory=/data/web/ghost
User=ghost
Group=ghost
ExecStart=/usr/bin/npm start --production
ExecStop=/usr/bin/npm stop
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target
STR
chown -R ghost:ghost /data/web/ghost
systemctl start ghost
chkconfig ghost on
server {
listen 80;
server_name blog.abc.me;
root /data/web/ghost;
access_log /data/logs/tengine/ghost_access.log main;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment