I just installed Ghost blog and what would be a good title of the first blog post? That's right! A post about Ghost =)
My server is running Ubuntu. Aside from this blog there are a number of websites hosted on it. Its all configured with Apache so I'll write a few notes on installing Ghost blog on Ubuntu and Apache using vhosts (Virtual Hosts).
I use mod_proxy to pass incoming requests to the Ghost application. I deny any request to /ghost/signup, this is to ensure that none can access the signup page. Right now, but that can change!, there can only be one user.
#/etc/apache2/sites-enabled/000-default <VirtualHost *:80> ServerName ghost.bjurr.se ProxyPreserveHost on ProxyPass / http://localhost:2368/ # Enable mod_proxy and uncomment to disable signup # <LocationMatch ^/ghost/signup> # Order Deny,Allow # Deny from All # </LocationMatch> </VirtualHost>
sudo apachectl restart
NPM and NodeJS
I initially tried APT to install these packages but since those packages are to old I found another way. I used a script called node-and-npm-in30s.sh.
Read about it here.
Making it run, always
There is a number of alternatives here, I went for
sudo nano -w /etc/supervisor/conf.d/ghost.conf
[program:ghost] command = /home/bjerre/local/bin/node/node /home/bjerre/sites/ghost.bjurr.se/index.js directory = /home/bjerre/sites/ghost.bjurr.se user = bjerre autostart = true autorestart = true stdout_logfile = /var/log/supervisor/ghost.log stderr_logfile = /var/log/supervisor/ghost_err.log environment = NODE_ENV="production"
sudo supervisorctl restart all
During setup I had some issues, perhaps my solution can help someone. I installed version 0.3.2.
- Images folder owned by root.
sudo chown ghost:ghost content/images
- SQLite DB owned by root.
sudo chown ghost:ghost content/data/ghost.db
- Node not found. Fixed by using absolute path to node in supervisor config.
config.jsnot being found. I solved it by downloading current version of
config-loader.jsfrom the GitHub repository.
If you have another issue, I would suggest tailing these logs: