Created
February 2, 2014 15:24
-
-
Save connrs/8769890 to your computer and use it in GitHub Desktop.
Ghost Blog Configuration (Apache, Ubuntu Upstart)
This file contains 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
#!/bin/bash | |
NODE_ENV=production /home/myuser/local/bin/node /home/myuser/www/index.js |
This file contains 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
<VirtualHost 77.73.1.223:80> | |
ServerName ghostblog.example.com | |
ProxyRequests off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> | |
<Location /> | |
ProxyPass http://localhost:2368/ | |
ProxyPassReverse http://localhost:2368/ | |
</Location> | |
</VirtualHost> |
This file contains 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
#!upstart | |
description "MyUser Ghost Blog" | |
author "myuser" | |
start on startup | |
stop on shutdown | |
respawn | |
respawn limit 10 20 | |
chdir /home/myuser/www/ | |
script | |
echo $$ > /home/myuser/run/upstart-ghost.pid | |
exec sudo -u myuser '/home/myuser/bin/ghost' >> /home/myuser/ghost.log 2>&1 | |
end script | |
pre-start script | |
# Date format same as (new Date()).toISOString() for consistency | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /home/myuser/ghost.log | |
end script | |
pre-stop script | |
rm /home/myuser/run/upstart-ghost.pid | |
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /home/myuser/ghost.log | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
user-blog.conf
file is the upstart config file. You would place this within /etc/init/ so that Upstart can use it on boot.The
ghost
file is a binary that would live within/home/myuser/
that is called by the Upstart scriptThe
user-blog.conf
file is the Apache2 VirtualHost configuration. It makes use of Apache's proxy capabilities to pass requests to your domain through to the Ghost application running on port 2368.