Change the document root to /Public

Discussion in 'Installation/Configuration' started by Pierrot727, Sep 20, 2024.

  1. Pierrot727

    Pierrot727 Member

    Dear ISPConfig team,
    I would like to deploy a php project in Symfony7 but for that, i will need that the document root will not indicate :
    /var/www/clients/client0/web6
    but
    /var/www/clients/client0/web6/public/
    Could you help me telling me how to do it ?
    I guess it's in in PHP open_basedir, but i don't want to make stupid thinks so i prefer to ask. And is there any impact for the https certificate.

    thanks for your time.

    Pierrot
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    set it in the apache/nginx directives section in the options tab of the website settings

    apache:
    DocumentRoot /var/www/clients/client0/web6/web/public

    nginx:
    ##subroot public ##
     
    Pierrot727, till and ahrasis like this.
  3. Pierrot727

    Pierrot727 Member

    Ok super, thanks so i add in Apache Directives :
    {DOCROOT}/public
    <Directory {DOCROOT}/public>
    AllowOverride All
    Require all granted
    </Directory>

    That's enought, Correct ?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Use:

    Code:
    DocumentRoot  {DOCROOT_CLIENT}/public
    for an Apache server if you do not want to hard-code the path as {DOCROOT_CLIENT} variable contains the real folder name (/var/www/clientX/webY/web), while {DOCROOT} contains just the symlink path (domain name path). I don't think you need the Directory part. But if it does not work, you can try to add it.
     
    ahrasis and Pierrot727 like this.
  5. Pierrot727

    Pierrot727 Member

    Thank so much till because my code crash apach so i was guessing something was wrong :)

    Now it works
     

Share This Page