if you could give me some more details of your setup i might be able to assist you better. But from given details:
web files should belong to user:www-data. If you have set up all your websites with admin user. you need to chown the public_html folder as: chown -R admin:www-data public_html
Wow thanks for the feedback Dennis, I suspected that too with the red warning light on “don’t do this as admin” there be dragons.
I took your suggestions with the chown commands for the website created under the admin user.
These are the present permissions.
root@Deb9ovhVPS:/home/host/web/user-domain.com# cd /home/admin/web/admin-domain.com/
root@Deb9ovhVPS:/home/admin/web/admin-domain.com# ls -la
dr-xr-x–x 9 admin admin 4096 Feb 9 07:40 .
drwxr-xr-x 4 admin admin 4096 Feb 9 19:24 …
drwxr-x–x 2 admin admin 4096 Feb 9 06:48 cgi-bin
drwxr-x–x 2 admin admin 4096 Feb 9 07:40 document_errors
dr-xr-x–x 2 admin admin 4096 Feb 9 07:40 logs
drwxr-x–x 2 admin admin 4096 Feb 9 06:48 private
drwxr-x–x 5 admin www-data 4096 Feb 9 09:33 public_html
drwxr-x–x 2 admin www-data 4096 Feb 9 06:48 public_shtml
dr-xr-x–x 2 admin admin 4096 Feb 9 06:48 stats
root@Deb9ovhVPS:/home/admin/web/admin-domain.com# cd public_html/
root@Deb9ovhVPS:/home/admin/web/admin-domain.com/public_html# ls -la
drwxr-x–x 5 admin www-data 4096 Feb 9 09:33 .
dr-xr-x–x 9 admin admin 4096 Feb 9 07:40 …
-rw-r–r-- 1 admin www-data 235 Feb 9 07:05 .htaccess
-rw-r–r-- 1 admin www-data 418 Feb 9 07:05 index.php
-rw-r–r-- 1 admin www-data 19550 Feb 9 07:05 license.txt
-rw-r–r-- 1 admin www-data 7322 Feb 9 07:05 readme.html
etc…
Success!
Your new web server is ready to use. (so permissions didn’t do the trick, perhaps I did not chown correctly)
I then created a user on the system to see what permissions were defaulted when adding a domain (so that I could compare to the admin account).
root@Deb9ovhVPS:/home/admin/web/admin-domain.com/public_html# cd /home/host/web/user-domain.com/
root@Deb9ovhVPS:/home/host/web/user-domain.com# ls -la
drwxr-x–x 9 host host 4096 Feb 9 19:30 .
drwxr-xr-x 3 host host 4096 Feb 9 19:30 …
drwxr-x–x 2 host host 4096 Feb 9 19:30 cgi-bin
drwxr-x–x 2 host host 4096 Feb 9 19:30 document_errors
dr-xr-x–x 2 host host 4096 Feb 9 19:30 logs
drwxr-x–x 2 host host 4096 Feb 9 19:30 private
drwxr-x–x 5 host www-data 4096 Feb 9 19:37 public_html
drwxr-x–x 2 host www-data 4096 Feb 9 19:30 public_shtml
dr-xr-x–x 2 host host 4096 Feb 9 19:30 stats
root@Deb9ovhVPS:/home/host/web/user-domain.com# cd public_html/
root@Deb9ovhVPS:/home/host/web/user-domain.com/public_html# ls -la
drwxr-x–x 5 host www-data 4096 Feb 9 19:37 .
drwxr-x–x 9 host host 4096 Feb 9 19:30 …
drwxr-xr-x 2 host host 4096 Feb 9 19:37 files
-rw-r–r-- 1 host host 431 Feb 9 19:37 .htaccess
-rw-r–r-- 1 host host 42814 Feb 9 19:37 index.php
-rw-r–r-- 1 host host 2 Feb 9 19:37 robots.txt
drwxr-xr-x 3 host host 4096 Feb 9 19:37 themes
etc…
Initially, the user-domain.com loaded the document root with the under-construction message, but as soon as I enabled the let’s encrypt SSL certificate it also spawned the Success! Your new web server is ready to use page.
I was running some of these domains on the server before, I’m not sure if it’s some clash between SSL’s issued but even if I disable the let’s encrypt SSL certificate, I still get the same response. Success!
Appreciate the help Dennis but my inpatient, blunt force persona just pushed the re-install button to rule out any potential errors between the chair and keyboard.
I will update when the new install completes and see if any bugs remain.
Fresh install Debian 10, no hitches in install, no changes to anything
Logged in with admin account, created a user account, logged in with user account, added a domain (which was already pointed to the server IP) but the same issue persists.
root@server:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@server:~# apachectl configtest
Syntax OK
root@server:~#
root@server:~#
Logged in with admin account, created a user account, logged in with user account, added a domain (which was already pointed to the server IP) but the same issue persists.
If you created a new user USERNAME and created a new DOMAIN.TLD. then your configs should go into
/home/USERNAME/conf/web/DOMAIN.TLD/
when looking at your apache2 and nginx config files, they all point to /home/admin/ instead of /home/USERNAME/
can you adjust the configs and file locations and give this another go?
So the problem was solved by @dennis.bradenton it appears HestiaCP does not automatically add the www alias on your domain while setting up a new website like VestaCP used to do.
Adding the www into the aliases field in the control panel solved the issue and everything seems to be up and running now.