Linux AMI Install Guide

Easy Setup

You can now install with a single command prompt! Use this method unless you have a good reason not to!

wget -qO - | bash
  1. Server Setup

Server Size: If you can get it, a t2.xlarge works great for hosting both MySQL and PHP. Sometimes you may want to use seperate servers for the database. If so, get at least a t2.medium for the database.

After you acquire the server, install Httpd, MySQL, PHP, and dependancies. You can do this with the commands below:

(Note on PHP - Currently there is no simple memcached package available for PHP 7.1, so we typically use 7.0)

sudo yum update -q -y > /dev/null 2>&1
sudo yum remove php* -q -y > /dev/null 2>&1
sudo yum install -y -q gcc pcre-devel zip unzip httpd24 libcurl httpd24-devel php70.x86_64 php70-mysqlnd php70-common php70-gd > /dev/null
sudo yum install -y -q php70-mbstring php70-mcrypt php70-devel php70-xml php7-pear.noarch php70-pdo memcached php70-memcached > /dev/null
sudo yum install -y -q php70-pecl-memcached php70-zip libzip mysql mysql-server mysql-devel > /dev/null
sudo sed -i 's/AllowOverride None/AllowOverride All/gI' /etc/httpd/conf/httpd.conf
sudo chkconfig httpd on
sudo chkconfig --level 345 memcached on
sudo service memcached restart
sudo service httpd restart
cd /var/www/html
sudo wget -O
sudo unzip -o
sudo rm
sudo chown -R apache:apache /var/www/html
sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
sudo /etc/init.d/iptables save
  1. Enable htaccess

    You will likely need to enable .htaccess overrides. Open the /etc/httpd/conf/httpd.conf file with vim and find a chunk that looks like the following:

    <Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

Modify the "AllowOverride" piece of this to say "All".

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

Restart httpd to enable the configuration change.

sudo service httpd restart
  1. MySQL Setup

    If the MySQL Database is on the same server, install with the following commands:

    sudo yum install -y mysql mysql-server mysql-devel
    sudo service mysqld start
    sudo chkconfig mysqld on
    sudo mysql_secure_installation
    sudo service mysqld restart

Then, log into MySQL with your root user. (Password blank by default - but you should have configured something else in Step 1)

mysql -u root -p

Then, run the following commands to create a database and user:

CREATE DATABASE tableau_portal;
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON tableau_portal.* TO 'newuser'@'localhost';
  1. Code Installation

    Run http://[your-server-here]/install.php in a web browser.

  2. Set up Cron

    Add a crontab with the following line. Modify the path to artisan as needed.

* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1
  1. Final Steps

    After installation, remove install.php and the install_files folder. Manage through /backend as needed.