<\/span><\/h2>\n\n\n\nFirst, log in to your AlmaLinux 8 server via SSH as the root user:<\/p>\n\n\n\n
ssh root@IP_Address -p Port_number<\/pre>\n\n\n\nYou will need to replace ‘IP_Address’ and ‘Port_number’ with your server\u2019s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.<\/p>\n\n\n\n
Before starting, you have to make sure that all AlmaLinux OS packages installed on the server are up to date. You can do this by running the following commands:<\/p>\n\n\n\n
dnf update -y<\/pre>\n\n\n\n<\/span>Install Apache, MariaDB and PHP<\/span><\/h2>\n\n\n\nFirst, install Apache web server and MariaDB database server with the following command:<\/p>\n\n\n\n
dnf install httpd httpd-tools mariadb-server -y<\/pre>\n\n\n\nAfter installing both packages, you will need to install PHP version 7.4 and above to your server.<\/p>\n\n\n\n
To do so, first install the EPEL and Remi PHP repository with the following command:<\/p>\n\n\n\n
rpm -Uvh https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm
dnf install -y https:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm<\/pre>\n\n\n\nNext, reset the PHP default repository and enable the Remi repository with the following command:<\/p>\n\n\n\n
dnf module reset php
dnf module install php:remi-7.4<\/pre>\n\n\n\nNext, install PHP 7.4 with other required extensions with the following command:<\/p>\n\n\n\n
dnf install php php-cli php-mysqlnd php-opcache php-xml php-gd php-soap php-pdo php-bcmath php-intl php-mbstring php-json php-iconv php-zip unzip git -y<\/pre>\n\n\n\nNext, edit the php.ini file and change the default settings:<\/p>\n\n\n\n
nano \/etc\/php.ini<\/pre>\n\n\n\nChange the following values:<\/p>\n\n\n\n
memory_limit = 1024M
upload_max_filesize = 256M
zlib.output_compression = on
max_execution_time = 18000
date.timezone = UTC
\ufeff<\/pre>\n\n\n\nSave the file then start the Apache and MariaDB service and enable them to start at system reboot:<\/p>\n\n\n\n
systemctl start httpd
systemctl start mariadb
systemctl enable httpd
systemctl enable mariadb<\/pre>\n\n\n\n<\/span>Configure MariaDB for Magento<\/span><\/h2>\n\n\n\nFirst, you will need to set a MariaDB root password and secure the MariaDB installation. You can do it by running the following script:<\/p>\n\n\n\n
mysql_secure_installation<\/pre>\n\n\n\nAsk all questions as shown below:<\/p>\n\n\n\n
Enter current password for root (enter for none):
Set root password? [Y\/n] Y
New password:
Re-enter new 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
\ufeff<\/pre>\n\n\n\nNext, log in to MariaDB with the following command:<\/p>\n\n\n\n
mysql -u root -p<\/pre>\n\n\n\nOnce you are connected, create a database and user for Magento:<\/p>\n\n\n\n
MariaDB [(none)]> CREATE DATABASE magentodb;
MariaDB [(none)]> CREATE USER 'magentouser'@'localhost' IDENTIFIED BY 'password';<\/pre>\n\n\n\nNext, grant all the privileges to the Magento database:<\/p>\n\n\n\n
MariaDB [(none)]> GRANT ALL ON magentodb.* TO 'magentouser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;<\/pre>\n\n\n\nNext, flush the privileges to apply the changes and exit from the MariaDB:<\/p>\n\n\n\n
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;<\/pre>\n\n\n\n<\/span>Download Magento<\/span><\/h2>\n\n\n\nBefore starting, you will need to install Composer on your server. You can install it with the following command:<\/p>\n\n\n\n
curl -sS https:\/\/getcomposer.org\/installer | php
mv composer.phar \/usr\/local\/bin\/composer<\/pre>\n\n\n\nNext, change the directory to Apache root directory and download the Magento with the following command:<\/p>\n\n\n\n
cd \/var\/www\/html\/
wget https:\/\/github.com\/magento\/magento2\/archive\/2.3.zip<\/pre>\n\n\n\nOnce downloaded, unzip the downloaded file with the following command:<\/p>\n\n\n\n
unzip 2.3.zip<\/pre>\n\n\n\nNext, rename the extracted directory to magento2:<\/p>\n\n\n\n
mv magento2-2.3 magento2<\/pre>\n\n\n\nNext, change the directory to magento2 with the following command:<\/p>\n\n\n\n
cd magento2<\/pre>\n\n\n\nNext, update the Composer and install all required PHP dependencies using the following command:<\/p>\n\n\n\n
composer update
composer install<\/pre>\n\n\n\nNext, set proper permission and ownership with the following command:<\/p>\n\n\n\n
chown -R apache:apache \/var\/www\/html\/magento2
chmod -R 755 \/var\/www\/html\/magento2<\/pre>\n\n\n\n