Page 1 of 1

[Solved] Use the IncludeOptional for redefine the DocumentRoot

Posted: Tue Sep 05, 2017 1:57 pm
by floown
Hello,

I try to install a site (a Drupal 8) that the virtualhost necessite to point to a /web subfolder to be public

I have notice in my /home/admin/conf/web/apache2.conf I have this line :

Code: Select all

IncludeOptional /home/admin/conf/web/apache2.mydomain.tld.conf
So I have edit my apache2.mydomain.tld.conf and add these lines :

Code: Select all

DocumentRoot /home/admin/web/mydomain.tld/public_html/web
    <Directory /home/admin/web/mydomain.tld/public_html/web>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/admin/web/mydomain.tld/public_html/web:/home/admin/tmp
    </Directory>

# RAJOUT pour SSL
Redirect permanent / https://www.mydomain.tld
The redirect for SSL work, but the new document root is not redirected.

Sure I have restart Apache2

I have edit apache2.mydomain.tld.conf instead of apache2.conf in case I rebuild the sites in VestaCp… (but I have try to edit apache2.conf and add manually "/web", but it's the same problem

Thanks for your help

//EDIT : it's the "Redirect permanent" for SSL who make the problem… but I don't know to have the both : the document root, and the Redirect for SSL

Re: Use the IncludeOptional for redefine the DocumentRoot

Posted: Wed Sep 06, 2017 2:37 pm
by floown
Ok, I have to edit (create) the good file with a "s" prefixe pour this domain name. It works now.