Can't change document root

Hello, I have a fresh installation of HestiaCP on ubuntu 22.
I need to change a document root directory for the laravel project but GUI gives me an error that the directory doesn’t exist.

Error: Directory /home/my-laravel-domain/web/dashboard.my-laravel-domain.com/public_html/public does not exist under /home/my-laravel-domain/web/dashboard.my-laravel-domain.com/public_html/.

The ‘public’ folder does exist, I can simply cd to it from the shell. I tried to change permissions with this:

chown -R my-laravel-domain:www-data /home/my-laravel-domain/web/dashboard.my-laravel-domain.com/public_html

Didn’t help…

Hi @tonyandr,

Are you sure my-laravel-domain is your Hestia user and dashboard.my-laravel-domain.com is assigned to that user?

Show the output of these commands (replacing YourUser and YourDomain with the actual data) and executing them as root:

namei -mo /home/YourUSer/web/YourDomain/public_html/public/
v-list-web-domain YourUser YourDomain json | jq -r '.[].DOCUMENT_ROOT'

Yes, i created a user and then added websites to it using heastia panel.

The output for your command with the actual data is below:

root@admin:~# namei -mo /home/link-indexing-bot/web/dashboard.link-indexing-bot.com/public_html/public/
v-list-web-domain link-indexing-bot dashboard.link-indexing-bot.com json | jq -r '.[].DOCUMENT_ROOT'
f: /home/link-indexing-bot/web/dashboard.link-indexing-bot.com/public_html/public/
 drwxr-xr-x root              root              /
 drwxr-xr-x root              root              home
 drwxr-x--x root              root              link-indexing-bot
 drwxr-xr-x root              link-indexing-bot web
 dr-xr-x--x link-indexing-bot link-indexing-bot dashboard.link-indexing-bot.com
 drwxr-x--x link-indexing-bot www-data          public_html
 drwxr-xr-x link-indexing-bot www-data          public
/home/link-indexing-bot/web/dashboard.link-indexing-bot.com/public_html/
root@admin:~#

That’s because you are adding the new document root as /home/link-indexing-bot/web/dashboard.link-indexing-bot.com/public_html/public and you only need to add public

imagen

1 Like

Oh… I see now, thank you.
I knew its something silly like that…

1 Like