Moving to ghost and streamlining WordPress

0

Well we are testing ghost and getting away from WordPress. It’s been a great ride, but nice to learn a new system that is running on node.js and which is much simpler. I’m going to run the two in parallel for a while at tongfamily.com and richtong.org, so stay tuned. In the mean time some notes;

  1. Digital Ocean’s model is more expensive at $5/droplet vs $13/month for an unlimited single server with unlimited storage at Bluehost, but more convenient for development as you get complete isolation. I’ll likely keep Bluehost for gallery for instance and even try Ghost on bluehost to see if that works alongside WordPress. The main issue seems to be that Ghost uses nginx while WordPress is Apache based, so i don’t know how to make them get along.

  2. WordPress has grown into a very complete system particularly with JetPack. Ghost is the opposite, it takes various services and pushed them out. For instance, it uses Cloudinary for image storage, Disqus for comments. So I’ll experiment with using those services. Disqus already fails to suck out all the comments from WordPress, so it looks like a manual export is needed. Ghost has an export add-in for WordPress, so you can get the raw content.

  3. Bootstrap.js. The theme are pretty underdeveloped for Ghost, but fortunately the structure of the templates is much simpler and you can use Github as the way to manage all this which is really nice. Since node.js is completely in user space that helps a lot too. But still it would be nice to have a complete template with Jumotron and grid already done for you. In the mean time I have to learn Handlebar.

  4. Github to manage themes is way more convenient that unzip. You just install git on your Digital Ocean droplet and away you pull 🙂 So all you need to do is go to /var/www/ghost/content/themes and clone themes into it

cd /var/www/ghost/content/themes
git clone git@github.com:howtoinstallghost/howtoinstallghost.git
  1. If you need to update your ghost installation then the one liner wget -O - https://allaboutghost.com/updateghost-digitalocean | sudo bash is the equivalent of doing a pull.

  2. Install SSL for the admin interface. This should actually be required because when you go to the admin interface, you are sending everything over clear text! You need a free SSL certificate and then have to install it manually.

  3. Nginx is the frontend to ghost and the router. So you can actually decide what to spawn off in the nginx config file and the allaboutghost folks were good enough to include their entire config file and it is pretty easy to see first how to setup SSL (Note they shouldn’t accept SSLv3 given the bug in it!) and then you can see that they say that their sitemap.xml is handled as a direct file transfer from /var/www instead of going to ghost. What is happening is that every nodejs installation listens on a different port and nginx routes the top / to the local port 127.0.0.1:2368 so you can have multiple node running on different sites by change the / and the port. The actual port that is used is in /var/www/ghost/config in the config json object config.production.server.port.

server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/allghostthemes/allghostthemes.com.crt;
ssl_certificate_key /etc/nginx/ssl/allghostthemes/allghostthemes.com.pem;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
server_name allghostthemes.com www.allghostthemes.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
location ~ ^/(sitemap.xml) {
root /var/www;
}
}
  1. If you want to run multiple sites on the same system, then you just use nginx to look at the inbound name and then send it to different ports, so in this case for instance tongfamily.com goes to port 2368 and gracetong.com goes to 2370. You have to setup two node installations and change config in each to these ports of course. Digital Ocean has a good tutorial:

server { listen 80; server_name sales-blog.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:2368; } } server { listen 80; server_name marketing-blog.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:2370; } }
  1. Ghost themes are much simpler than WordPress themes. First you don’t need to know PHP (as you do with WordPress). You just code using Handlebar and write declarative stuff. Second the number of files is smaller and more logical (if less powerful). Default.hbs is applied to every page and then there are page specific files that load afterwards like post.hbs, page.hbs, etc.

  2. Allghosthemes has a good list of free themes to start with.

  3. Using PM2 seems like a good way to make sure ghost is always running if you are not running on Digital Ocean. OTOH, with Digital Ocean, it is already a service, so a simple service ghost stop works well or service nginx stop

  4. On Digital Ocean the world works in reverse. You login as root and then need to sudo -u ghost to do things in that context. /var/www/ghost is the home directory.

  5. When you do an initial digital ocean installation, you have to put the real name of the site into /var/www/ghost/config and /etc/nginx/sites-available/ghost

Related Posts

© All Right Reserved