1

I'm trying to get the latest version of Ghost blogging platform integrated into my existing site. For testing purposes, I have installed it in a new directory on my site called /blog_new.

When I visit that directory in my browser, it just shows a list of files, rather than the Blog itself. I've added the config.js file and swapped the Development and Production URLs so they are pointing at the correct directory, but this is what I get:

Index List

The only Ghost installs I've done prior to this are that through the Digital Ocean droplet creation stage, I've never actually integrated it into an existing site before so I'm not sure if I'm missing something obvious or I've completely missed a whole set of steps!

Kayvan Mazaheri
  • 2,447
  • 25
  • 40
JTP
  • 151
  • 4
  • 10
  • Ghost is running its own webserver ([express](https://expressjs.com/)), you can not run this on a php server. You need install nodejs and then start the ghost webserver (i.e `node index.js`). – rckrd Aug 11 '17 at 19:33

1 Answers1

0

If your existing site is running on Apache Web Server, you can config Apache to redirect incoming requests to your Node.js application.

You can use ProxyPass directive to achieve this.

Just edit the Apache's httpd.conf and add the following:

ProxyPass /blog_new http://localhost:3000/

It will redirect incoming requests of /blog_new to your Node.js server listening at localhost:3000.

Also, make sure the following lines are NOT commented out so you get the right proxy and submodule to reroute http requests:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Now you should be able to see your Ghost installation at http://example.com/blog_new and the rest of your website should be working just like before.

Kayvan Mazaheri
  • 2,447
  • 25
  • 40
  • Thanks for this! I've never heard of ProxyPass before. I added what you suggested to my 000-default.conf file however it brought the site down. Upon closer inspection, it's hitting this error - "Invalid command 'ProxyPass', perhaps misspelled or defined by a module not included in the server configuration". Do I need to install another module? – JTP Aug 11 '17 at 21:34
  • @JTP You need `mod_proxy` module installed on Apache. – Kayvan Mazaheri Aug 11 '17 at 21:39
  • Thanks for that! The rest of the site is working again now however going to the new directory takes me to a 500 Internal Server Error. Is there anything else I need to do/change for it to show the Ghost install? – JTP Aug 11 '17 at 22:09
  • @JTP Make sure `mod_proxy_http` module is installed alongside with `mode_proxy`. Also make sure the `LoadModule` statements mentioned above are present in your config file. One last thing is to make sure _Ghost_ is up and running on your desired port (in this example, port `3000`) – Kayvan Mazaheri Aug 12 '17 at 04:33