Last active
April 23, 2020 17:11
-
-
Save linuxbiekaisar/45db88fc3a876e82bdf640d4528dab42 to your computer and use it in GitHub Desktop.
Install Nginx, Php and Mariadb on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Youtube: https://www.youtube.com/watch?v=CdK8Nb-ED9M | |
#Install NGINX | |
sudo apt-get update | |
sudo apt-get install nginx | |
sudo systemctl start nginx | |
sudo systemctl enable nginx | |
sudo systemctl restart nginx | |
sudo systemctl stop nginx | |
sudo systemctl start nginx | |
sudo systemctl status nginx | |
nginx -v | |
#Install MariaDB | |
sudo apt install mariadb-server | |
sudo systemctl start mariadb.service | |
sudo systemctl enable mariadb.service | |
sudo systemctl restart mariadb.service | |
sudo systemctl stop mariadb.service | |
sudo systemctl start mariadb.service | |
sudo systemctl status mariadb.service | |
mysql --version | |
#Secure MariaDB | |
sudo mysql_secure_installation | |
#When prompted, answer the questions below by following the guide. | |
Enter current password for root (enter for none): Just press the Enter | |
Set root password? [Y/n]: Y | |
New password: Enter any password | |
Re-enter new password: Repeat same password | |
Remove anonymous users? [Y/n]: Y | |
Disallow root login remotely? [Y/n]: Y | |
Remove test database and access to it? [Y/n]: Y | |
Reload privilege tables now? [Y/n]: Y | |
#Now that MariaDB is installed, to test whether the database server was successfully installed | |
sudo mysql -u root -p | |
mysql -u root -p | |
CREATE DATABASE school DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
GRANT ALL ON school.* TO 'trainee'@'localhost' IDENTIFIED BY 'D@y-7869'; | |
FLUSH PRIVILEGES; | |
EXIT; | |
#Install PHP 7.3 With Modules | |
sudo apt-get update && apt-get upgrade | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install php7.3 | |
#sudo apt-get install php7.3 libapache2-mod-php7.3 libaprutil1-dbd-sqlite3 php7.3-cli php7.3-common php7.3-json php7.3-opcache php7.3-readline | |
sudo apt-get install php-pear php7.3-curl php7.3-dev php7.3-gd php7.3-mbstring php7.3-zip php7.3-mysql php7.3-xml | |
#Install PHPMyAdmin | |
sudo apt-get install phpmyadmin php-mbstring php-gettext -y | |
#Make sure to select No | |
#add this line "Include /etc/phpmyadmin/apache.conf" at /etc/apache2/apache2.conf | |
#/etc/init.d/apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment