Last active
January 5, 2017 14:03
-
-
Save davidneelin/d3d4b978bbcd8afac24ae9da077b6142 to your computer and use it in GitHub Desktop.
auto install ghost blog system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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