New DA install will not serve from public_html

darkus

Verified User
Joined
Dec 15, 2005
Messages
148
Never had this problem with any DA install before

For background, I did a new DA install which failed because i did not have proper nameservers setup and so domain names could not resolve during the DA isntall and failed. So I just re-ran the DA install and everything seemed to go very well (although it renamed my machines hostname for some reason to a generic DA hostname). I then installed 4 versions of PHP (8.2, 7.4, 7.3, 5.4).

Then I setup my domain with the basics, it seems like any option for a symlink between private_html and public_html is no longer there and looking inside the DA file manager it seems to indicate such a symlink exists or is created by default. Great!

I double check inside shell
Code:
lrwxrwxrwx. 1 admin admin 13 Aug  2 19:50 private_html -> ./public_html
drwx--x--x. 3 admin admin 22 Aug  2 19:50 public_ftp
drwxr-xr-x. 4 admin admin 40 Aug  2 20:54 public_html
Great!

I set my domain to use a different PHP version (7.3)

I put my files into public_html but the webserver simply will not serve form the public_html directory, I just get the standard
Code:
Forbidden
You don't have permission to access this resource.

Checking in my error logs I see this:
Code:
[Sat Aug 02 20:55:54.274229 2025] [autoindex:error] [pid 1630822:tid 1631289] [client] AH01276: Cannot serve directory /home/admin/domains/---.com/private_html/: No matching DirectoryIndex (index.html,index.htm,index.shtml,index.php,index.phtml) found, and server-generated directory index forbidden by Options directive

Strangely enough, when I look inside the private_html directory, there is another public_html directory inside of that private_html directory, is it supposed to be like that in new DA? Thats just a side thing.

But any ideas why private_html wont just symlink to public_html in previous versions of DA?

I am assuming something went werong with my installation TBH becauyse of that intial snafu I had, but everything else seems to be working so far
 
Ok I was dumb and I by accident didnt have the files in the right public_html folder, I moved everything properly (and I manually changed my servers hostname away from the DA set one), now I am getting this error:

Code:
[Sat Aug 02 21:59:44.103721 2025] [core:error] [pid 1654420:tid 1655088] [client xxx] AH00037: Symbolic link not allowed or link target not accessible: /home/admin/domains/----/private_html
 
Last edited:
OK! This is 100% user (me) error. I moved files from my old server to new server public_html folder and doing so the ownership changed from admin:admin to 1000. I just changed ownership of public_html back to admin:admin and the problem is solved!
 
(although it renamed my machines hostname for some reason to a generic DA hostname).
You might have not done all required steps to setup the hostname correctly, it has to be both in /etc/hosts (can be done via de hostname command) and also in /etc/hostname so if you do hostname and hostname -f DA will pick it up automatically. Hopefully you did change things back to your own hostname after installation.

As for the moving, maybe next time you can use the admin backup/transfer option or use rsync to move, which will keep the ownership.
 
to be sure, reset the file and directory permission to default
Code:
cd /usr/local/directadmin/scripts
./set_permissions.sh all
 
You might have not done all required steps to setup the hostname correctly, it has to be both in /etc/hosts (can be done via de hostname command) and also in /etc/hostname so if you do hostname and hostname -f DA will pick it up automatically. Hopefully you did change things back to your own hostname after installation.

As for the moving, maybe next time you can use the admin backup/transfer option or use rsync to move, which will keep the ownership.
Thanks! I actually found an old guide you posted up about this yesterday and followed those steps (including the reboot) and it seems to work, atleast so far as I can see :) :) I keep ny fingers crossed this keeps working. I can always do an OS reload if I have to since im still at the start of the migration but I am praying not
 
dont forget to put cd before, was forgot in the original post, edited now
 
Back
Top