Sun 26 Jun, 2016 GMT
Installing LAMP (Linux, Apache2, Mysql and PHP) in Ubuntu involves running several commands (or installing some softwares from package manager) and modifying config files. In this tutorial I will show you a one liner solution to this problem i.e a single line of command will do all this for you.
Installing LAMP server in Ubuntu follows through a multi-step process. To make this task automated, I have written a script which can install LAMP on Ubuntu and also set up custom sites if specified. This method should work for Ubuntu 13.10/14.04/15.10/16.04 etc.. and their derivatives (like Linux Mint 17 etc..)
wget https://raw.githubusercontent.com/neurobin/lampi/release/lampi chmod 755 lampi sudo cp lampi /usr/local/bin
sudo lampi -i
That's it. It will install LAMP server in your ubuntu machine and setup a basic website in localhost with the server name localhost and document root in /var/www/html.
If you want a site with custom name for it and put your website in an arbitrary place, then you can just set it up with:
sudo lampi -n example.com.local -dr ~/example-site
where example.com.local is your site name and ~/example-site is the document root for this site.
If you want to have https website too, then add a
-s flag to the above command:
sudo lampi -s -n example.com.local -dr ~/example-site
Of course, you could do it during the LAMP installation stage too. The following will install LAMP and setup a custom site (with https) for you:
sudo lampi -i -s -n example.com.local -dr ~/example-site
The lampi script does the following:
Copyright © 2016, Neurobin, All rights reserved.