<\/span><\/h2>\nApache is the most widely used web server in the world. It is fast, secure, reliable, easy-to-use, and can be easily customized depending on your needs.<\/p>\n
To install Apache on your Debian 9 server, type the following command:<\/p>\n
sudo apt-get install apache2<\/pre>\nOnce the installation is complete, enable the Apache service to start automatically upon system boot. You can do that with the following command:<\/p>\n
sudo systemctl enable apache2<\/pre>\nTo verify that Apache is successfully installed, open your web browser, enter your server IP address, (e.g. http:\/\/12.12.12.12) and you should see a message saying “It works!”.<\/p>\n
<\/span>Step 3: Install MariaDB<\/span><\/h2>\nThe next step is to install MariaDB. It is one of the most popular database management systems.<\/p>\n
To install MariaDB on your system, type the following command and enter ‘Y’ when prompted:<\/p>\n
sudo apt-get install mariadb-server<\/pre>\nOnce the installation is complete, it is recommended to run the following command to improve the security of your MariaDB server:<\/p>\n
sudo mysql_secure_installation<\/pre>\nFirst, you will be asked to set the root password:<\/p>\n
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\r\n SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!\r\n\r\nIn order to log into MariaDB to secure it, we'll need the current\r\npassword for the root user. If you've just installed MariaDB, and\r\nyou haven't set the root password yet, the password will be blank,\r\nso you should just press enter here.\r\n\r\nEnter current password for root (enter for none):\r\nOK, successfully used password, moving on...\r\n\r\nSetting the root password ensures that nobody can log into the MariaDB\r\nroot user without the proper authorisation.\r\n\r\nSet root password? [Y\/n]\r\n<\/pre>\nType Y and enter the new MariaDB root password:<\/p>\n
New password:\r\nRe-enter new password:\r\nPassword updated successfully!\r\nReloading privilege tables..\r\n ... Success!\r\n<\/pre>\nNext, you will be asked to change the root password, but since we already created it during the MariaDB installation, we can skip this step by pressing [Enter].<\/p>\n
After this, you will get asked a couple of more questions and it is recommended that you answer ‘Y’ to all of them to confirm:<\/p>\n
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y\r\n\r\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : Y\r\n\r\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : Y\r\n\r\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : Y\r\n<\/pre>\nOnce that is done, make sure to set the MariaDB service to start on boot with the following command:<\/p>\n
sudo systemctl enable mysql<\/pre>\nThat’s it – MySQL has been installed and secured.<\/p>\n