The steps below were written using CentOS 7 from a CentOS-provided AMI on Amazon Web Services (AWS).
The exact AMI we used is ami-6d1c2007, and you should be able to easily launch an EC2 instance using this AMI from the
AWS Marketplace.

All of the CentOS-provided AMIs have SELinux and iptables enabled.
We disabled both of these to be as straight forward as possible during this guide.
SELinux causes issues that are beyond the scope of the guide,
and we disabled iptables because we leverage EC2’s security groups for firewall access.

Let’s just turn it off for now.
Please note, if you’re using EC2 or some other cloud provider that has firewall rules enabled by default,
you will need to configure the particular firewall rules to gain access to the web server we’ll start in the guide.

sudoserviceiptablesstop

If you’d like to lock down security more, here are the ports that need to be opened up:

Getting things working using SELinux could be an entirely separate guide.
For our purposes, it’s completely out of scope, so we’re going to disable it.

Note

You will be required to restart the machine during this step.

# Edit /etc/sysconfig/selinux and make sure the line beginning
# with SELINUX looks like:
SELINUX=disabled
# If it was already disabled you can skip the following, however
# if you switched the policy from anything other than 'disabled'
# you need to relabel the filesystem to remove the garbage that
# SELinux has added. This *requires* a restart to take effect.
touch /.autorelabel
reboot
# When the machine is back up, you can confirm SELinux is not
# running
>>> selinuxenabled
>>> echo $?
>>> 1
# If the output is 1 you're good to go.

Below we’ll create a stackdio database and grant permissions to the
stackdio user for that database.

Warning

We’re not focusing on security here, so the default postgres setup definitely needs to be tweaked,
passwords changed, etc., but for a quick-start guide this is out of scope.
Please, don’t run this as-is in production :)