<\/span><\/h2>\n\n\n\nInstalling Apache – the most popular web server in the world – is very easy. Simply run the following command:<\/p>\n\n\n\n
yum install httpd<\/pre>\n\n\n\nTo start Apache and to enable it to auto-start on server boot, run these commands:<\/p>\n\n\n\n
systemctl enable httpd\nsystemctl start httpd<\/pre>\n\n\n\nTo verify that the installation is okay and the Apache web server is up and running we can try to access the server’s IP address in a web browser (e.g. http:\/\/123.123.123.123<\/code>\/) – if we receive the Apache welcome screen, we are good to go.<\/p>\n\n\n\n <\/figure><\/div>\n\n\n\nWe can check that the Apache service is properly started and working with the following command:<\/p>\n\n\n\n
systemctl status httpd<\/pre>\n\n\n\n<\/span>3. Install the MariaDB Database Server<\/span><\/h2>\n\n\n\nTo install the MariaDB Database server package, run this next command:<\/p>\n\n\n\n
yum install mariadb-server<\/pre>\n\n\n\nDuring the installation, we will be asked to enter a password for the MySQL root user. It is a good idea to create a password for the MySQL root user. Make sure to use a strong password.<\/p>\n\n\n\n
To set MariaDB to start at boot and start the MariaDB service for the first time, run:<\/p>\n\n\n\n
systemctl enable mariadb\nsystemctl start mariadb<\/pre>\n\n\n\nTo improve the security level of the MariaDB installation, we strongly recommend to run the command below:<\/p>\n\n\n\n
mysql_secure_installation<\/pre>\n\n\n\nWe will be given the option to change the MariaDB root password, remove anonymous user accounts, disable root logins outside of the localhost, and remove all test databases before finally reloading privileges. It is recommended that you answer yes to all of the prompts.<\/p>\n\n\n\n
For the Drupal setup, we need to create a database and connect it with a user that we will create as well. First, log in to the MariaDB console:<\/p>\n\n\n\n
mysql -u root -p<\/pre>\n\n\n\nThen, create a new MariaDB database and user with permissions to use it:<\/p>\n\n\n\n
create database drupal_db;\ngrant all on drupal_db.* to 'drupal_user' identified by 'password<\/strong>';\nflush privileges;\nexit;<\/pre>\n\n\n\nThese SQL commands will create a database called drupal_db<\/code>, grant all permissions to a new user called drupal_user<\/code> that has the password ‘password<\/code>‘, before saving all permissions and exiting. You can choose names different from drupal_db<\/code> and drupal_user<\/code> if you like, and we strongly recommend changing ‘password<\/code>‘ to a stronger password.<\/p>\n\n\n\n<\/span>4. Install PHP and extensions<\/span><\/h2>\n\n\n\nTo install PHP and the required PHP extensions for Drupal, we have to run the following command:<\/p>\n\n\n\n
yum install php php-pear php-mysqlnd php-curl php-mbstring php-gd php-xml php-pear php-fpm php-mysql php-pdo php-opcache php-json php-zip php-cli<\/code><\/pre>\n\n\n\nTo be sure that php-fpm<\/code> service will work even after a server reboot, run the following commands:<\/p>\n\n\n\nsystemctl enable php-fpm\nsystemctl start php-fpm<\/pre>\n\n\n\n