Monday, April 11, 2022

How To Install Magento 2.4 on Rocky Linux 8

 in This Tutorial you will Learn "  How To Install Magento 2.4 on Rocky Linux 8"
                          
Magento is a free, open-source, PHP-based eCommerce platform and cloud solution to grow your online business rapidly. It is built on open-source technology, with a flexible shopping cart system and an admin control panel that helps you start your online store easily. Magento also offers many plugins and themes to enhance a customer’s experience.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf install httpd httpd-tools mariadb-server -y
systemctl start httpd mariadb ; systemctl enable httpd mariadb
dnf module reset php ; dnf module enable php:7.4

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

gedit  /etc/php.ini &>/dev/null
memory_limit = 1024M
upload_max_filesize = 256M
zlib.output_compression = on
max_execution_time = 18000
date.timezone = Asia/Kolkata

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install php-cli libsodium php-pear php-devel libsodium-devel make
pecl channel-update pecl.php.net
pecl install libsodium
nano /etc/php.ini
extension=sodium.so
php -i | grep sodium

mysql
CREATE DATABASE magento;
CREATE USER 'magento'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON magento.* TO 'magento'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

wget https://github.com/magento/magento2/archive/refs/tags/2.4.2.zip
unzip 2.4.2.zip ; mv magento2-* /var/www/html/magento2

cd /var/www/html/magento2
composer install
chown -R apache:apache /var/www/html/magento2

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R apache:apache .  && chmod u+x bin/magento


nano /etc/httpd/conf.d/magento.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName magento.example.com
DocumentRoot /var/www/html/magento2/
DirectoryIndex index.php
<Directory /var/www/html/magento2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/magento_error.log
CustomLog /var/log/httpd/magento_access.log combined
</VirtualHost>

systemctl restart httpd
sudo -u apache bin/magento module:disable {Magento_Elasticsearch,Magento_Elasticsearch6,Magento_Elasticsearch7}

sudo -u apache bin/magento setup:install --admin-firstname="test" --admin-lastname="tests" --admin-email="admin@example.com" --admin-user="admin" --admin-password="secure@123" --db-name="magento" --db-host="localhost" --db-user="magento" --db-password="password" --language=en_US --currency=USD --timezone=Asia/Kolkata --cleanup-database --base-url=http://"magento.example.com"

nano /etc/hosts/
192.168.1.20    magento.example.com

cd /var/www/html/magento2
sudo -u apache  bin/magento cron:install
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






No comments:

Post a Comment