Начнём с
sudo apt-get update
Установим Apache
sudo apt-get install apache2
Установим MySQL
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Активация MySQL
sudo mysql_install_db
Завершаем установку MySQL следующим скриптом
sudo /usr/bin/mysql_secure_installation
Программа вас попросит ввести пароль БД, вводите. Затем он задаст несколько вопросов. Отвечайте, как указано ниже
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
Установим PHP
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
Перезагрузим Apache
sudo service apache2 restart
Всё, теперь по адресу localhost/index.html
должно появиться приветствие.
Корневая директория - /var/www/html
Оригинал: How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu