Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

403 for DocumentRoot outside of ServerRoot

Tags:

apache

xampp

My Xampp on linux is set up like this

ServerRoot "/opt/lampp"
DocumentRoot "/home/webadmin/webroot"
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/home/webadmin/webroot">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
<IfModule dir_module>
    DirectoryIndex index.html index.html.var index.php index.php3 index.php4
</IfModule>
...

This leads to a 403. However, when I change DocumentRoot to "/opt/lampp/htdocs", it works.

Already double checked that /home/webadmin/webroot is readable. What could be the issue here?

like image 844
S B Avatar asked Mar 23 '26 02:03

S B


1 Answers

ServerRoot must be a directory above the DocumentRoot, so if you really need to have document root at "/home/webadmin/webroot" you must set your ServerRoot to "/home/webadmin/webroot" at least... or something like "/home/webadmin"

like image 86
Mr. BeatMasta Avatar answered Mar 25 '26 00:03

Mr. BeatMasta