As promised, I am going to post up a guide for others to follow after spending numerous hours trying to get this figured out properly. This is a continuation from here:
Where I was totally lost.
This guide assumes:
- OVH Cloud or Dedicated Server
- Clean install Ubuntu 14.04LTS 64bit
- A Record Pointing (sub)Domain for Discourse to IP
It’s my first step at new installs. Now we’re going to switch to generic kernel for AUFS support.
apt-get install linux-image-server
mv /etc/grub.d/06_OVHkernel /etc/grub.d/25_OVHkernel
This will install the kernel, AUFS, and update grub so that it loads after the reboot.
If you’re running a dedicated, bind9 should continue to work. Skip these next steps. If you’re in the cloud, bind9 will be broken. No need for a broken service installed on the rig. You will also need to rig DNS resolution. The following two lines will make it so for this instance, and after reboots.
apt-get remove bind9
echo “nameserver 188.8.131.52” | sudo tee /etc/resolv.conf > /dev/null
echo “nameserver 184.108.40.206” | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null
I suggest another update at this point. This will verify name resolution is a success, if nothing else.
At this point, you will either go directly to following standard Digital Ocean Guide: discourse/INSTALL-digital-ocean.md at master · discourse/discourse · GitHub
For Discourse only server and be done,
Else will need more setup to host Nginx/Apache sites as well.
If the latter:
apt-get install nginx
Place this config in file, taken from this link:
Modify the domain name towards your A record made for discourse.
service nginx restart
Now you can continue with the:
However when you are modifying app.yml file, be sure to change the port for the container from - 80:80 to 4578:80. This is the only difference in the guide to follow.
You should now have your instance of discourse behind the ngnix reverse proxy. From here, you can either work with nginx directly to create more sites, else configure apache2 behind the reverse proxy. I have now had success with both.
An OVH Cloud 1 package with 2GB ram is enough to run discourse and several other sites, though I don’t have the members yet to confirm up to what size. The good thing about the OVH “cloud” (ESXI) is that you can upgrade your package if need be with a single-click from the OVH manager.
I set app.yml to 384MB and 3 unicorn workers which leads 500-800MB ram left for other services/sites to be run.
Not all VPS are created equal. OpenVZ is considered partial virtualization. You need something like ESXI/KVM for full virtualization. What this ends up meaning relevant to this thread is with OpenVZ you are limited to the kernel version of the host. I have tested servermania, and ovh classic, both are stuck with 2.6 kernels, which will not work for discourse which needs AUFS. You could possibly get lucky with OpenVZ and find a new host with late kernel, but why risk it?