« PrestaShop » : différence entre les versions
Aller à la navigation
Aller à la recherche
| (4 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 4 : | Ligne 4 : | ||
# dnf update && dnf upgrade | # dnf update && dnf upgrade | ||
=== Installation Serveur LAMP === | === Installation Serveur LAMP === | ||
Apache | ==== Apache ==== | ||
# dnf install httpd | # dnf install httpd | ||
# systemctl enable --now httpd | # systemctl enable --now httpd | ||
php 8.1 : | On supprime la page d'acceuil : | ||
# sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf | |||
Masquer les chemin et fichiers du répertoire racine : | |||
# sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf | |||
On configure Apache pour gérer les vhost via "sites-available" et "sites-enabled" : | |||
# mkdir /etc/httpd/sites-available /etc/httpd/sites-enabled | |||
# vi /etc/httpd/conf/httpd.conf | |||
<font color = grey>... | |||
# Load config files in the "/etc/httpd/conf.d" directory, if any. | |||
IncludeOptional conf.d/*.conf</font> | |||
<font color = blue>IncludeOptional sites-enabled/*.conf</font> | |||
====PHP==== | |||
---- | |||
php 8.1 (à partir de PrestaShop8) : | |||
[https://www.linuxcapable.com/how-to-install-php-8-1-on-almalinux-8/ source] | [https://www.linuxcapable.com/how-to-install-php-8-1-on-almalinux-8/ source] | ||
| Ligne 14 : | Ligne 28 : | ||
# dnf update | # dnf update | ||
# dnf module enable php:remi-8.1 | # dnf module enable php:remi-8.1 | ||
---- | |||
On install PHP et les dépendances nécessaire : | |||
# dnf install php php-{zip,xml,gd,curl,intl,xmlrpc,mbstring,mysqli,bcmath,dom,posix,cli,pdo,posix,fpm,fileinfo,json,iconv} | # dnf install php php-{zip,xml,gd,curl,intl,xmlrpc,mbstring,mysqli,bcmath,dom,posix,cli,pdo,posix,fpm,fileinfo,json,iconv} | ||
On augmente certaines limitations de PHP : | On augmente certaines limitations de PHP : | ||
| Ligne 19 : | Ligne 35 : | ||
# sed -i 's/post_max_size = .*/post_max_size = 64M/' /etc/php.ini | # sed -i 's/post_max_size = .*/post_max_size = 64M/' /etc/php.ini | ||
# sed -i 's/upload_max_filesize = .*/upload_max_filesize = 64M/' /etc/php.ini | # sed -i 's/upload_max_filesize = .*/upload_max_filesize = 64M/' /etc/php.ini | ||
MariaDB | ====MariaDB==== | ||
# dnf install mariadb-server mariadb | # dnf install mariadb-server mariadb | ||
# systemctl enable --now mariadb | # systemctl enable --now mariadb | ||
| Ligne 38 : | Ligne 54 : | ||
Reload privilege tables now? [Y/n] '''y''' | Reload privilege tables now? [Y/n] '''y''' | ||
=== Création BDD Prestashop === | === Création BDD Prestashop === | ||
# mysql -u root -p | # mysql -u root -p | ||
| Ligne 52 : | Ligne 69 : | ||
# unzip prestashop_*.zip -d /var/www/html/<font color = green>prestashop</font>/ | # unzip prestashop_*.zip -d /var/www/html/<font color = green>prestashop</font>/ | ||
# chown -R apache:apache /var/www/html/<font color = green>prestashop</font>/ | # chown -R apache:apache /var/www/html/<font color = green>prestashop</font>/ | ||
# | On configure le vhost local : | ||
# vi /etc/httpd/sites-available/<font color = green>prestashop</font>.conf | |||
<VirtualHost *:80> | |||
ServerAdmin <font color = blue>monmail@exemple.net</font> | |||
ServerName <font color = blue>prestashop.exemple.net</font> | |||
#ServerAlias <font color = blue>autrenom.exemple.net</font> | |||
DocumentRoot /var/www/html/<font color = green>prestashop</font> | |||
ErrorLog /var/log/httpd/<font color = green>prestashop</font>-error_log | |||
CustomLog /var/log/httpd/<font color = green>prestashop</font>-access_log common | |||
</VirtualHost> | |||
On active le vhost : | |||
# ln -s /etc/httpd/sites-available/<font color = green>prestashop</font>.conf /etc/httpd/sites-enabled/ | |||
# systemctl restart httpd | # systemctl restart httpd | ||
Après avoir créé un [[Nginx_ReverseProxy_LXC_Alpine_Linux#Création_d'un_"vhost"_sécurisé|VHost]] on se connecte avec un navigateur pour finaliser l'installation.. | Après avoir créé un [[Nginx_ReverseProxy_LXC_Alpine_Linux#Création_d'un_"vhost"_sécurisé|VHost sur son reverse-proxy]] on se connecte avec un navigateur pour finaliser l'installation.. | ||
Version actuelle datée du 9 octobre 2022 à 08:33
Installation
Alma Linux
# dnf update && dnf upgrade
Installation Serveur LAMP
Apache
# dnf install httpd # systemctl enable --now httpd
On supprime la page d'acceuil :
# sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf
Masquer les chemin et fichiers du répertoire racine :
# sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf
On configure Apache pour gérer les vhost via "sites-available" et "sites-enabled" :
# mkdir /etc/httpd/sites-available /etc/httpd/sites-enabled # vi /etc/httpd/conf/httpd.conf
... # Load config files in the "/etc/httpd/conf.d" directory, if any. IncludeOptional conf.d/*.conf IncludeOptional sites-enabled/*.conf
PHP
php 8.1 (à partir de PrestaShop8) :
# dnf install epel-release # dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm # dnf update # dnf module enable php:remi-8.1
On install PHP et les dépendances nécessaire :
# dnf install php php-{zip,xml,gd,curl,intl,xmlrpc,mbstring,mysqli,bcmath,dom,posix,cli,pdo,posix,fpm,fileinfo,json,iconv}
On augmente certaines limitations de PHP :
# sed -i 's/memory_limit = .*/memory_limit = 256M/' /etc/php.ini # sed -i 's/post_max_size = .*/post_max_size = 64M/' /etc/php.ini # sed -i 's/upload_max_filesize = .*/upload_max_filesize = 64M/' /etc/php.ini
MariaDB
# dnf install mariadb-server mariadb # systemctl enable --now mariadb
On sécurise MariaDB :
# mysql_secure_installation
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
Création BDD Prestashop
# mysql -u root -p
> CREATE DATABASE mabaseprestashop; > CREATE USER 'monutilisateur'@'localhost' IDENTIFIED BY 'monsupermotdepasse'; > GRANT ALL PRIVILEGES ON mabaseprestashop.* TO 'monutilisateur'@'localhost'; > EXIT
Installation PrestaShop
On récupère la dernière version sur GitHub :
# cd/tmp/ # dnf install wget unzip # wget https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.7/prestashop_1.7.8.7.zip # unzip prestashop_*.zip -d /var/www/html/prestashop/ # chown -R apache:apache /var/www/html/prestashop/
On configure le vhost local :
# vi /etc/httpd/sites-available/prestashop.conf
<VirtualHost *:80>
ServerAdmin monmail@exemple.net
ServerName prestashop.exemple.net
#ServerAlias autrenom.exemple.net
DocumentRoot /var/www/html/prestashop
ErrorLog /var/log/httpd/prestashop-error_log
CustomLog /var/log/httpd/prestashop-access_log common
</VirtualHost>
On active le vhost :
# ln -s /etc/httpd/sites-available/prestashop.conf /etc/httpd/sites-enabled/ # systemctl restart httpd
Après avoir créé un VHost sur son reverse-proxy on se connecte avec un navigateur pour finaliser l'installation..