I don't see why you should not be able to change the document root? What reason does the admin give?
Are you configuring a virtual host and are there many sites on this install?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I have a Laravel app installed in a Apache 2.2.15 CentOS.
After hours of researching I've found that in order to serve my app from the '/public' folder I would have to change Apache configuration and so I did. I've changed the /etc/httpd/conf.d/vhosts.conf file as such:
VirtualDocumentRoot /vhosts/%0/html/public
And everything went fine! Until the server administrator tells me that I cannot change the document root.
So I've read dozens of posts that suggest creating separate folders, one for the application and other for the public folder, and later fix the links in public/index.php. Or use symlinks to link the 'html' folder (in my case the document root) with laravel's 'public' folder.
I need to say that I'm not in a shared hosting environment. It's a Linux machine I own almost completely.
So, what do you think it's the best solution in this case? Taking in account I update the site via Git so I need to maintain directory structure as equal as possible?
Btw, I've changed the document root back to 'html' and it seems that the public/.htaccess is broken. All routes except home return 404 and you have to put /public/index.php to see anything.
You can check it all here:
http://aws.rioaliancafrancesa.com.br/public
Thanks.
Please or to participate in this conversation.