PrestaShop

De Le Wiki de Lug
Aller à la navigation Aller à la recherche

Installation

Alma Linux

Source

# 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 8.1 (à partir de PrestaShop8) :

source

# 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 on se connecte avec un navigateur pour finaliser l'installation..