<\/span><\/h2>\nTo connect to your server via SSH as user root, use the following command:<\/p>\n
ssh root@IP_ADDRESS -p PORT_NUMBER<\/pre>\nand replace \u201cIP_ADDRESS\u201d and \u201cPORT_NUMBER\u201d with your actual server IP address and SSH port number.<\/p>\n
Once logged in, make sure that your server is up-to-date by running the following commands:<\/p>\n
sudo apt-get update\r\nsudo apt-get upgrade<\/pre>\n<\/span>2. Install the MySQL Database Server<\/span><\/h2>\nNext, we will install the MySQL server. To install the default package, run the following command:<\/p>\n
sudo apt-get install mysql-server<\/pre>\nThis will install MySQL 5.7 on your server, but it will not prompt you to set a password or make any other configuration changes. Because this leaves your installation of MySQL insecure, in order to improve the security of your MySQL server, we recommend that you run the ‘mysql_secure_installation<\/strong>‘ script by typing the following command:<\/p>\nmysql_secure_installation<\/pre>\nThis script will help you to perform important security tasks like setting up a root password, disable remote root login, remove anonymous users, etc.<\/p>\n
<\/span>3. Create a Database for Joomla<\/span><\/h2>\nNow, we will create our MySQL database for our Joomla site. Log in to your MySQL server with the following command and enter your MySQL root password:<\/p>\n
sudo mysql -u root -p<\/pre>\nIn this section, we will create a new MySQL database joomla<\/code> and assign user access to it to a new user admin_user<\/code> with password Strong_Password<\/code>:<\/p>\nCREATE DATABASE joomla;\r\nGRANT ALL PRIVILEGES ON joomla.* TO 'admin_user'@'localhost' IDENTIFIED BY 'Strong_Password';\r\nFLUSH PRIVILEGES;\r\nexit;<\/pre>\nDon\u2019t forget to replace \u2018Strong_Password\u2019 with an actual strong password.<\/p>\n
<\/span>4. Install Apache and PHP<\/span><\/h2>\nTo install the Apache web server, run the following command:<\/p>\n
sudo apt-get install apache2<\/pre>\nAfter the installation is complete, you should enable Apache to start automatically upon server reboot with:<\/p>\n
sudo systemctl enable apache2<\/pre>\nYou can also check the status of your Apache service with the following command:<\/p>\n
sudo systemctl status apache2<\/pre>\nOutput:<\/p>\n
apache2.service - The Apache HTTP Server\r\n Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\r\n Drop-In: \/lib\/systemd\/system\/apache2.service.d\r\n \u2514\u2500apache2-systemd.conf\r\n Active: active (running)\r\n Main PID: 905 (apache2)\r\n Tasks: 7 (limit: 1110)\r\n CGroup: \/system.slice\/apache2.service\r\n \u251c\u2500 905 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500 923 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500 926 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500 927 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500 928 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500 929 \/usr\/sbin\/apache2 -k start\r\n \u2514\u250016816 \/usr\/sbin\/apache2 -k start\r\n<\/pre>\nSince Joomla is a PHP-based application, our next step is to install PHP and some PHP extensions required by Joomla:<\/p>\n
sudo apt-get install php php-xml php-mysql php-zip<\/pre>\nRestart the Apache web server to load the PHP modules:<\/p>\n
sudo systemctl restart apache2<\/pre>\nNow check the PHP version installed on your server:<\/p>\n
php -v<\/pre>\nOutput:<\/p>\n
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )\r\nCopyright (c) 1997-2018 The PHP Group\r\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\r\n with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies<\/pre>\n