I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be tweaked, if any, etc.).
I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be tweaked, if any, etc.).
It will install all the basic LAMP stack for you, prompt for MySQL root password, etc.
More specifically it will install the following packages, and their dependencies.
You might also want to take a peek at the Ubuntu Server Guide.
Install Apache
Install PHP
As fo 16.04, the number is dropped:
Install MySQL
Install phpMyAdmin
As with the PHP installation, in 16.04, the number is dropped:
Combined installation
16.04:
Before 16.04:
The easiest way to install LAMP with PHPMyAdmin is using:
You don't even need to install taskel. More details can be found here, which gives this:
To access PHPMyAdmin, open terminal & type:
Add this line somewhere in that file:
Finally restart Apache using:
or
In Synaptic, click edit and mark by task. Then select LAMP Server and hit apply. Done.
I personally always find that installing the MySQL server and then PHPMyAdmin will install all the parts I need
(doing this first means it asks for the root account password to be set in advance)
then
It also gives you all the tools you'll need to administrate your MySQL server once it's installed :)
On commandline the simplest way is probably to use tasksel:
The packages are
apache2
andlibapache2-mod-php5
. php5 has a number of additional modules, you may need some. List them withapt-cache search php5
Try revising your search or
Enable php5 with
Restart apache
The following wiki pages can be very helpful if you are starting with apache.
https://help.ubuntu.com/community/ApacheMySQLPHP
https://help.ubuntu.com/11.10/serverguide/C/httpd.html
Note- This answer was migrated from elsewhere. To add mysql install
http://www.apachefriends.org/en/xampp-linux.html
It has LAMP as well as phpmyadmin integrated along with perl modules. Installs in /opt/lampp so can be installed/removed easily...
My Swiss Army knife command:
PHP7.0 is standard on Ubuntu 16+
Heres the rundown:
1 As Always
2 Install Apache2
3 Install mysql-server
4 Install PHP 7.0
5 Install phpmyadmin
Note, you'll need to add
Include /etc/phpmyadmin/apache.conf
to the file you'll open with the following command. (credit)Optional