Skip to content

Instantly share code, notes, and snippets.

@yaleksandr89
Last active June 30, 2019 11:42
Show Gist options
  • Save yaleksandr89/c7c54af700c3d401dc633d1148d37db9 to your computer and use it in GitHub Desktop.
Save yaleksandr89/c7c54af700c3d401dc633d1148d37db9 to your computer and use it in GitHub Desktop.
In this video you will learn about the installation of LAMP stack on UBUNTU 19.04. This can work on other Ubuntu versions as well. Make sure you watch the video to get full understanding of the installation.
Following are the step by step commands that you need to follow:
*INSTALL APACHE*
* sudo apt update
* sudo apt install apache2
Adjust the Firewall to Allow Web Traffic:
* sudo ufw app list
* sudo ufw app info "Apache Full"
Allow incoming HTTP and HTTPS traffic for this profile:
* sudo ufw allow in "Apache Full"
*INSTALL MYSQL*
Here is the link to video that we created recently to install MYSQL:
https://www.youtube.com/watch?v=a5gJ6...
*INSTALL PHP*
* sudo apt install php libapache2-mod-php php-mysql
* sudo gedit /etc/apache2/mods-enabled/dir.conf
***
```
Been:
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
Become:
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
```
***
* sudo systemctl restart apache2
* sudo systemctl status apache2
*TEST PHP*
* sudo gedit /var/www/html/info.php
```
<?php
phpinfo();
```
*INSTALL PHPMYADMIN*
sudo apt install phpmyadmin
sudo systemctl restart apache2
sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
```
По умолчанию, вы не сможете авторизоваться в Phpmyadmin от пользователя root, поэтому что у программы есть такая мера безопасности. Отключить ее можно, но не всегда это работает и не всегда так, как нам нужно. Поэтому проще создать нового пользователя со всеми теми же возможностями, что и у root.
Для этого откройте консоль MySQL и выполните там такие команды:
sudo mysql
> CREATE USER 'admin'@'localhost' IDENTIFIED BY 'пароль';
> GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
> FLUSH PRIVILEGES;
Мы создали пользователя с именем admin и паролем "пароль". Вторая команда выдает этому пользователю права на все базы данных, а также даёт возможность изменять полномочия других пользователей, а третья обновляет таблицы привилегий.
```
sudo systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment