fbpx

Instalare Magento 2.4.2 cPanel

Se dezactiveaza din WHM – Shell Fork Bomb Protection

EasyApache -> se activeaza mod_version

SSH:

yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

In : nano /etc/yum.repos.d/elasticsearch.repo se adauga

[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/oss-7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-m

yum -y install elasticsearch-oss

cp -pv /etc/elasticsearch/jvm.options /etc/elasticsearch/jvm.options.original
nano /etc/elasticsearch/jvm.options
#-Xms2g
#-Xmx2g
# Se setează la o optime din memoria RAM
-Xms512m
-Xmx512m

systemctl enable --now elasticsearch

systemctl status elasticsearch

Se verifica daca elasticsearch ruleaza prin :

curl http://127.0.0.1:9200

Se comenteaza open_basedir si din disable_functions se scoate popen

yum -y install libsodium

yum -y install libsodium libsodium-devel

/opt/cpanel/ea-php74/root/usr/bin/pecl install libsodium

Instalare Redis:

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install redis --enablerepo=remi --disableplugin=priorities
systemctl enable redis
systemctl start redis

SE COPIAZA TOT IN TERMINAL

for phpver in $(ls -1 /opt/cpanel/ |grep ea-php | sed 's/ea-php//g') ; do
cd ~
wget -O redis.tgz https://pecl.php.net/get/redis
tar -xvf redis.tgz
cd ~/redis* || exit
/opt/cpanel/ea-php"$phpver"/root/usr/bin/phpize
./configure --with-php-config=/opt/cpanel/ea-php"$phpver"/root/usr/bin/php-config
make && make install
echo 'extension=redis.so' > /opt/cpanel/ea-php"$phpver"/root/etc/php.d/redis.ini
rm -rf ~/redis*
done

/scripts/restartsrv_httpd

/scripts/restartsrv_apache_php_fpm

Se verifica daca extensia PHP este instalata pe fiecare versiune prin:

for phpver in $(ls -1 /opt/cpanel/ |grep php | sed 's/ea-php//g') ; do
echo "PHP $phpver" ; /opt/cpanel/ea-php$phpver/root/usr/bin/php -i |grep "Redis Support"
done

Outputul ar trebui sa fie urmatorul:

PHP 55
Redis Support => enabled
PHP 56
Redis Support => enabled
PHP 70
Redis Support => enabled
PHP 7X
Redis Support => enabled

Setari standard Redis:

nano /etc/redis.conf

timeout 1
Se decomenteaza : save 3600 1
save 300 10
save 60 10000
maxclients 2000
maxmemory 512M
Memoria se seteaza in functie de specificatiile serverului, de ex 512M pentru un server cu 4G

Ulterior din cPanel se creaza user si baza de date cu toate privilegiile.

Se copiaza in public_html arhiva de aici <<<<< https://www.dropbox.com/s/dabtec3xbk17f3b/magento-ce-2.4.2-p1-2021-04-22-10-49-09.zip?dl=1 >>>>> se poate lua cu wget sau o descarcati local, o urccati in public_html si o dezarhivati.

Se merge in locatie, ex : cd /home/tutorial/public_html

Se schimba userul din SSH cu userul aferent cPanel : ex : su <userul>

A NU SE INSTALA CU ROOT

Ulterior dupa ce s-a schimbat userul se introduc toate liniile de mai jos dar modificati baza de date, base_url, db username si parola cu ce a fost setata inainte in cPanel:

bin/magento setup:install --backend-frontname="admin" \
--db-host="localhost" \
--db-name="tutorial_mxhost" \
--db-user="tutorial_mxhost" \
--db-password="tCLEj4Jqs9MMP6pp" \
--language="en_US" \
--currency="EUR" \
--timezone="Europe/Bucharest" \
--use-rewrites=1 \
--use-secure=0 \
--base-url="http://tutoriale.mxhost.info" \
--base-url-secure="https://tutoriale.mxhost.info" \
--admin-user=adminuser \
--admin-password=123123q \
--admin-email=tutorial@mxh.ro \
--admin-firstname=admin \
--admin-lastname=user \
--cleanup-database

Dupa instalare se dau urmatoarele comenzi tot cu userul aferent din cPanel:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento index:reindex
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

Ulterior se intra in platforma cu http:/domeniul.ro/admin (la instare se poate modifica din admin in orice alt nume custom la linia –backend-frontname=”admin” \ ) si se activeaza 2FA.

Was this article helpful?

Related Articles