EC t2.micro Ubuntu x64 14.0

Instance Setup

Add Swap memory space

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1

enable after reboot add to /etc/fstab

/var/swap.1 swap swap defaults 0 0

Install Apache2

sudo apt-get update
sudo apt-get install apache2

verify: http://ec-instance.compute.amazonaws.com

Install PHP 7

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get purge php5-fpm
sudo apt-get install php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm php7.0-mysql
sudo apt-get install php7.0-cgi php7.0-dbg php7.0-dev php7.0-curl php7.0-gd
sudo apt-get install php7.0-mcrypt php7.0-xsl php7.0-intl
sudo service apache2 restart

verify: php -v

Install Mysql 5.7

wget https://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb
sudo dpkg -i mysql-apt-config_0.6.0-1_all.deb

On config screen: Mysql server -> mysql 5.7- -> apply

 sudo apt-get update
 sudo apt-get install mysql-server-5.7 

verify: mysql –version

sudo service apache2 restart

Aditional Tools

Git

sudo apt-get install git

Composer

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Zip / Unzip

sudo apt-get install zip unzip

PhpMyAdmin

cd /usr/share
sudo su
wget https://files.phpmyadmin.net/phpMyAdmin/4.5.4.1/phpMyAdmin-4.5.4.1-all-languages.zip
unzip phpMyAdmin-4.5.4.1-all-languages.zip
mv phpMyAdmin-4.5.4.1-all-languages phpmyadmin
chmod -R 0755 phpmyadmin

vi /etc/apache2/sites-available/000-default.conf

After DocumentRoot /var/www/html

Alias /phpmyadmin "/usr/share/phpmyadmin/"
<Directory "/usr/share/phpmyadmin/">
     Order allow,deny
     Allow from all
     Require all granted
</Directory>
service apache2 restart

Configuring

enable mod_rewrite

sudo a2enmod rewrite
sudo service apache2 restart

rewrite for .htaccess

sudo vi /etc/apache2/apache2.conf 

AllowOverride None to AllowOverride All

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

sudo service apache2 restart

Rolando Lucio

My Personal Blog!