Question

504 Gateway Time-out - Reddit installation on Ubuntu 14.04

Hello,

A few months ago I set up a 0.5gb droplet to get a small project of mine online. This was based off Reddit’s open source software, and installed by simply running a script on Ubuntu 14.04 (https://github.com/reddit/reddit/wiki/reddit-install-script-for-Ubuntu). I had to give it a 4gb swap and increase swappiness to 90, but it worked. Now I’m trying the same (and with a 1gb droplet this time), but all I get is 504 gateway time-out errors. Absolutely nothing else. The favicon loads, but that’s it. The script said the installation was a success (and it works when I ran it on a VM), all of Reddit’s dependencies seem to be working, but I keep getting 504 errors (for 2 days now).

I have a 4gb swap with 90 swappiness, and this is just frustrating given that it worked a few months ago but won’t now. Before running the script, I also installed apache2 and made sure that worked, but sadly that’s all that did. Is there anything else I can do (other than trying a 2gb+ droplet)?

My droplet’s ip: 45.55.78.86

Subscribe
Share

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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Since it’s been a while since I’ve played with Reddit’s open source code I took a few minutes to try and duplicate this problem on a droplet of my own. I was not able to duplicate it but I have an idea of the cause of the issue. You mentioned having installed apache2 before running the install-reddit.sh script. My guess is that this prevented things from being configured properly.

Here are the steps I took to get a reddit install running:

1.) Created a new droplet (I used an 8GB droplet as recommended. A smaller one with swap should work just as well for testing but I would not recommend it for production).

2.) Created a user ‘reddit’

adduser reddit

3.) Added that user to sudoers

adduser reddit sudo

4.) Switched to the new user, changed to their home directory and downloaded the script

cd /home/reddit/;
su reddit;
wget https://raw.github.com/reddit/reddit/master/install-reddit.sh;

5.) Then I ran the script with sudo, as the reddit user.

sudo ./install-reddit.sh

Once the script completed, I created an entry in the /etc/hosts file on my local computer (on Windows this file is in C:\Windows\system32\drivers\etc\ while on Linux/Mac it is /etc/hosts. The entry I created pointed the name reddit.local to my droplet’s IP address. Then I could browse to reddit.local and see:

So, I would recommend doing a rebuild of your droplet with a fresh install of Ubuntu 14.04 and re-try the installation.