How to Host Ghost on an Apache Subdomain

Ghost runs on top of Node.js instead of Apache or Nginx. If you already have a website running on Apache you will need to take a few extra steps in order to allow Node.js to run along side Apache. After this tutorial you will have your main domain (we will use the domain served by Apache and your Ghost blog on a subdomain ( served by Node.js.

To add to Apache we will need to modify an Apache config file. The configuration we are looking for is typically found in /etc/httpd/conf/httpd.conf or /etc/httpd/con.d/. You will be looking for a VirtualHost configuration for

Mine looked like this:

     DocumentRoot /home/example/public_html/

Once you have found your VirtualHost configuration you can duplicate it and change it to like this:

     ProxyPreserveHost on
     ProxyPass / http://localhost:2368/

This new VirtualHost section tells Apache to pass the request to http://localhost:2368 and we have Ghost listening on port 2368.

Now restart Apache:

service apache2 restart


service httpd restart

You can access and Apache will serve the request and will be served by Node.js which is your Ghost install.