How to install LAMP server in Ubuntu
Friday, 04. October 2019 04:46 PM UTC
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/18.04 etc.. and their derivatives (like Linux Mint 17, 18, 19 etc..)
wget https://raw.githubusercontent.com/neurobin/lampi/release/lampi chmod 755 lampi sudo cp lampi /usr/local/bin
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.
sudo lampi -i
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:
where example.com.local is your site name and ~/example-site is the document root for this site.
sudo lampi -n example.com.local -dr ~/example-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
Now visit https://example.com.local or http://example.com.local.
The lampi script does the following: