This is a simple shell script that will install necessary components of a LAMP server as well as other useful utilities to a fresh Ubuntu 16.04 LTS instance. This has been tested on a clean install of Ubuntu 16.04 LTS locally, as well as on a Google Cloud Platform (GCP) Compute instance that was created with Ubuntu 16.04 LTS, and the GCP compute default Compute configuration of Debian GNU/Linux 9 (stretch).
In a command terminal run these commands
wget https://raw.githubusercontent.com/deviantlycan/ubuntulampscript/master/lampInstall.sh -O- | tr -d '\r' > lampInstall.sh
chmod 0755 lampInstall.sh
sudo ./lampInstall.sh
The MySQL root password is set to "rootpass" and needs to be reset with the command
mysqladmin -u root password newpasswordhere
Once installation is complete, you should be able to do the following to test your installation:
See the default Apache page http://localhost/
See the phpMyAdmin login http://localhost/phpmyadmin/
See the PHP test page http://localhost/testphp.php
(This page was generated by the script and lives in the path /var/www/html/testphp.php and should be deleted from any non test or development system)
View status of the installed services
systemctl status apache2
systemctl status mysql
systemctl status memcached.service