prestashopprestashop-1.7

DocumentRoot for PrestaShop


In tutorials, I have seen prestashop installed in at least three different DocumentRoot's:

/var/www/html/
/var/www/html/prestashop/
/var/www/html/prestashop/public_html

Is there any logical reason to prefer one location over the others? In my case, there is an Apache server and I will have two different websites (two domains).


Solution

  • /var/www/html is the default directory for apache default config.

    Prestashop is meant to be used at the web root, so no matter what you choose you must adapt the apache configuration to match the directory where prestashop actually is.

    That being said, you should go for /var/www/yourdomain.com or /opt/website/yourdomain.com (I think it fits more the File Hierarchy Standard).

    People sometimes use /var/www/domain.com/public_html so they can put some private content in /var/www/domain.com that can be used by their website but is not facing the web.

    Do use nested subdirectories if you don't have a reason for it. Go for the most straightforward way.