Child pages
  • Guide de l'administrateur système

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Mcrypt offre une meilleure couche de sécurité à PHP, permettant l'usage d'algorithme algorithmes de hash et de chiffrement.

...

Ce fichier contient les identifiants et les "hash" des mots de passe hashés de ceux qui sont autorisé autorisés à accéder au dossier (un hash est une "empreinte" unique d'une chaîne de caractère, permettant de l'identifier rapidement.
Pour hasher créer le hash d'un mot de passe, vous pouvez passer par ce formulaire : Générateur de fichier .htpasswd.

...

Le code PHP de vos applications est la seule vulnérabilité de votre serveur. Il vous faut donc vous assurez de toujours uiliser utiliser les dernières version de vos applications : PHP, MySQL, Apache et oute les autres applications en place sur votre serveur.

...

  • /admin : contient tous les fichiers de PrestaShop relatifs au back-office. Si vous cherchez à accéder à ce dossier à l'aide de votre navigateur, il vous sera demandé de vous authentifier, pour des raisons de sécurité. Important : faites en sorte que ce dossier reste protéger par des fichiers .htaccess et .htpasswd?
  • /cache: contient des dossiers temporaires qui sont générés et réutilisés afin d'alléger la charge du serveur.
  • /classes : contient tous les fichiers relatifs au modèle Objet de PrestaShop. Chaque fichier représente (et contient) une classe PHP, et ses méthodes et propriétés.
  • /config : contient tous les fichiers de configuration de PrestaShop. Ne modifiez jamais ces fichiers, sauf on vous le demande expressément, car ils sont gérés directement par l'installateur et le back-office de PrestaShop.
  • /controllers : contient tous les fichiers relatifs aux contrôleurs de PrestaShop (dans le cadre Modèle-Vue-Contrôleur (ou MVC), l'architecture logicielle sur laquelle repose PrestaShop. Chaque fichier contrôle une partie précise de PrestaShop.
  • /css : contient tous les fichiers CSS qui ne sont pas liés aux thèmes ; de fait, ils sont la plupart du temps utlisés par le back-office de PrestaShop.
  • /docs : contient un peu de documentation. Note : vous devriez les effacer dans un environnement de production.
  • /download : contient tous vos produits numériques, pouvant être téléchargés : fichiers PDFs, MP3s, etc.
  • /img : contient toutes les images par défaut de PrestaShop, c'est à dire celles qui n'appartiennent pas au thème. C'est ici que vous trouverez les sous-dossiers des images pour les catégories de produits (/c, celles des produits (sous-dossier /p) et celle pour le back-office lui-même (sous-dossier /admin}}.
  • /install : contient tous les fichiers relatifs à l'installateur de PrestaShop. Vous devriez l'effacer après installation, afin d'améliorer la sécurité.
  • /js : contient tous les fichiers JavaScript qui ne sont pas liés aux thèmes. La plupart appartiennent au back-office. C'est également ici que vous trouverez le framework jQuery.
  • /localization : contient tous les fichiers de localisation de PrestaShop – c'est à dire, les fichiers qui contiennent des informations locales, comme la monnaie, la langue, les règles de taxes et les groupes de règles de taxes, les états et autres unités utilisées dans le pays choisi (par exemple, le volume en litre, le poids en kilogrammes, etc.).
  • /log : contient les fichiers de log générés par PrestaShop lors de diverses étapes, par exemple pendant le processus d'installation.
  • /mails : contient tous les fichiers HTML et textes relatifs aux e-mails envoyés par PrestaShop. Chaque langue dispose de son propre dossier, où vous pouvez modifier manuellement ce que vous souhaitez.
  • /modules : contient tous les modules de PrestaShop, chacun dans son propre dossier. Si vous souhaitez enlever définitivement un module, commencez par le désinstaller depuis le back-office, puis effacez son dossier à la main.
  • /override : il s'agit d'un dossier particulier, apparu à partir de la version 1.4 de PrestaShop. En utilisant la convention de nommage de dossier et fichiers de PrestaShop, il devient possible de créer des fichiers qui supplantes les classes et contrôleurs par défaut de PrestaShop. Cela vous permet de modifier le comportement fondamental de PrestaShop sans toucher aux fichiers originaux, ce qui les garde intact en prévision de la prochaine mise à jour.
  • /themes : contient tous les thèmes actuellement installés, chacun dans son propre dossier.
  • /tools : contient les outils externes qui ont été intégré à PrestaShop. Par exemple, c'est ici que vous trouverez Smarty (moteur de thème), FPDF (générateur de fichiers PDF), Swift (expediteur expéditeur d'e-mails), PEAR XML Parser (outil PHP).
  • /translations : contient un sous-dossier pour chaque langue. Cependant, si vous souhaitez modifier les traductions, vous devez utiliser l'outil interne de PrestaShop, et surtout pas les modifier directement dans ce dossier.
  • /upload : contient les fichiers qui ont été mis en ligne par les clients pour personnlisés personnalisés vos produits (par exemple, une image à imprimer sur un mug).
  • /webservice : contient les fichiers qui permettent aux applications tierces de se connecter à PrestaShop, au travers de son API.

Déplacer PrestaShop

A PrestaShop installation does seldom remain at the same physical place. There are many reasons why you would need to move your PrestaShop files and data around:

  • Moving your shop from your local computer to your online server.
  • Moving your shop from a test sub-domain to the main domain.
  • Moving your shop from one server to another.
  • Moving your shop from one domain name to another.

In all of these circumstances, you must be careful to properly move both all of your files (including the custom images, your themes, the modules you bought...) and all your data (which is contained in your MySQL database).

Moving PrestaShop to a New Server

Here are the main steps when changing servers, or copying from your local hard-drive to your online server:

  1. Put your shop in maintenance mode, so as to not lose new customers or orders while moving the data.
    Go to your back-office, and under the "Preference" tab, set the "Enable shop" option to "No".
  2. Move your files
    1. Make a backup of all the files: connect to your FTP server, and copy all the files and folders to your local hard-drive.
    2. Transfer your files to your new host: Connect to the FTP server for your new host, and copy all the files and folders that you just downloaded to your local hard-drive, as is.
  3. Move your data
    1. Make a backup of you database (a "dump"): connect to phpMyAdmin, click on the "Export" tab, select the database of your PrestaShop installation, and click the "Go" button. Save the downloaded file on your hard-drive. If phpMyAdmin times out before it is able to export all your data, contact your host.
    2. Transfer the SQL dump to the new database: connect to the new server's phpMyAdmin, click on the "Import" tab, click the "Browse..." button, find the SQL file you just downloaded, and click the "Go" button to upload it. If phpMyAdmin times out before it is able to import all your data, contact your new host.
  4. Configuration
    1. On the new server, open the /config/settings.inc.php file and update the settings for the new database server (with your own settings instead of the examples here):
      • define('_DB_SERVER_', 'sql.domainname.com');
      • define('_DB_NAME_', 'prestashop');
      • define('_DB_USER_', 'PS-user');
      • define('_DB_PASSWD_', 'djsf15');
      • define('_DB_PREFIX_', 'ps_');
    2. (1.4 and earlier) In that same file, update the Base URI setting ('/' being the server root):
      • define('__PS_BASE_URI__', '/prestashop/');
    3. Log in to your Back Office, go to the "Preferences" tab, select the "SEO & URLs" sub-tab, and change the domain name to your new domain. Do the same for the SSL domain.
      In effect, this will update the "PS_SHOP_DOMAIN" and "PS_SHOP_DOMAIN_SSL" rows in the "ps_configuration" SQL table.
    4. In your back-office, go to the "Tools" tab, "Generators" sub-tab, and regenerate both the .htaccess and robots.txt files.
  5. Connect to your new FTP server and delete everything except the index.php files in the following folders:
    • /tools/smarty/cache
    • /tools/smarty/compile
    • /tools/smarty_v2/cache
    • /tools/smarty_v2/compile
  6. Go to your back-office, and under the "Preference" tab, set the "Enable shop" option to "Yes".

You should be good to go! Check that all the links are functioning, that all your products, images, modules and themes are still there, and try to create a new account and place an order so as to make sure your shop is working as expected.

Moving PrestaShop to a New Domain

Here are the main steps when moving PrestaShop to a new domain within the same server. These are mostly a simpler version of the above steps – we do not touch the data, which stays on the same MySQL server.

  1. Put your shop in maintenance mode, so as to not lose new customers or orders will moving the data.
    Go to your back-office, and under the "Preference" tab, set the "Enable shop" option to "No".
  2. Move your files
    1. Make a backup of all the files: connect to your FTP server, and copy all the files and folders to your local hard-drive.
    2. Transfer your files to your new host: Connect to the FTP server for your new host, and copy all the files and folders that you just downloaded to your local hard-drive, as is.
  3. Configuration
    1. On the new server, open the /config/settings.inc.php file and update the settings for the new database server (with your own settings instead of the examples here):
      • define('_DB_SERVER_', 'sql.domainname.com');
      • define('_DB_NAME_', 'prestashop');
      • define('_DB_USER_', 'PS-user');
      • define('_DB_PASSWD_', 'djsf15');
      • define('_DB_PREFIX_', 'ps_');
    2. (1.4 and earlier) In that same file, update the Base URI setting ('/' being the server root):
      • define('__PS_BASE_URI__', '/prestashop/');
    3. Log in to your Back Office, go to the "Preferences" tab, select the "SEO & URLs" sub-tab, and change the domain name to your new domain. Do the same for the SSL domain.
      In effect, this will update the "PS_SHOP_DOMAIN" and "PS_SHOP_DOMAIN_SSL" rows in the "ps_configuration" SQL table.
    4. In your back-office, go to the "Tools" tab, "Generators" sub-tab, and regenerate both the .htaccess and robots.txt files.
  4. Connect to your new FTP server and delete everything except the index.php files in the following folders:
    • /tools/smarty/cache
    • /tools/smarty/compile
    • /tools/smarty_v2/cache
    • /tools/smarty_v2/compile
  5. Go to your back-office, and under the "Preference" tab, set the "Enable shop" option to "Yes".

You should be good to go! Check that all the links are functioning, that all your products, images, modules and themes are still there, and try to create a new account and place an order so as to make sure your shop is working as expected.