Dropbox based web site files + Ghost blog on subdomain

June 28, 2014 2.9k views

Hey everyone.

I’m looking to deploy my new site (avephoto.com) on a dropbox install along with a Ghost blog under the subdomain (blog.avephoto.com).

The dropbox functionality is convenience & workflow integration. At the moment I’m looking to have just the website content live in dropbox, and the blog content on server space. The website is a flat-file cms called Kirby and the blog would be Ghost based.

After doing some reading and searching, it seems I will need to run a virtual host.
Do I need a different droplet for each part of thing (ie dropbox, ghost, Apache server)?

Any advice/input would be greatly appreciated before I begin to tackle this project.
I’m new to how instances work, however I’m familiar with terminal and
remote web server management.

Thanks
Oscar

3 Answers

You can definitely do this all on one droplet. Like you said, you just need to use virtual hosts. If you want to use our pre-installed Ghost one-click image as a base, it uses Nginx as its web server. To achieve what you want, your configuration would look something like:

server {
    listen 80;
    server_name blog.example.com ;

    client_max_body_size 10M;

    location / {
            proxy_pass http://localhost:2368/;
            proxy_set_header Host $host;
            proxy_buffering off;
    }
}

server {
        listen   80;
        server_name example.com;
        root /path/to/your/dropbox;

        index index.php index.html index.htm;

       location ~ .php {
           fastcgi_pass  127.0.0.1:9000;
           fastcgi_index index.php;
           include fastcgi_params;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           fastcgi_param PATH_INFO $fastcgi_script_name;
       } 

       location / {
           try_files $uri $uri/ /index.php?$query_string;
       }
}

As Ghost is a node.js app, it runs on its own port. You then use a proxy pass to redirect it to port 80. Kirby is PHP based, so you need to set php5-fpm.

by Justin Ellingwood
A LEMP stack (Linux, Nginx, MySQL, and PHP) is a powerful set of software that can be configured to serve dynamic sites and web apps from your server. In this guide, we will discuss how to install a LEMP stack on an Ubuntu 14.04 server.

Nice! Thank you. I was leaning more toward Nginx from what I had been reading. Seems like going with a one-click Ghost droplet will get me started on some of the steps.

Thanks for sharing the configs too. I didn’t realize this was as straight forward as a setting up a server.

Awesome
O

Sorry to threadjack @okiave @asb, but I keep receiving 404s from my Dropbox + Nginx config.

Steps I’ve taken:

  1. Installed dropbox
  2. Installed nginx and served hello world successfully
  3. Created a symlink from /var/www/example.com/public_html to ~Dropbox/path/to/site

I found this thread and went ahead and deleted the symlink to try your instructions. I added the ~Dropbox/path/to/site in the nginx config file. Still 404s.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!