File not found under /home/admin/public_html

giees

Verified User
Joined
Apr 22, 2020
Messages
11
The files (index.html and info.php) copied to the /home/admin/public_html folder are not working. However, when I copy them to the /var/www/html page displays.

In the configuration settings in the DA panel (Custom HTTPD Configurations/View Domain Configuration), DocumentRoot is set to "/home/admin/domains/domain_name/public_html".

However, info.php shows USER as webapps, and HOME as /var/www/html.

Zrzut ekranu 2024-03-19 131118.png
 
Is this a newly installed server?
If yes, wait until you get a message in your message system that all background tasks are finished, before starting to use it.

However, info.php shows USER as webapps, and HOME as /var/www/html.
If you indeed copied things to the /var/www/html directory (which you shoudn't do if you don't know what it's for) then you can get odd results.

The /var/www/html directory is indeed only used for the webapps, so roundcube webmail and phpmyadmin.
The default index.html there only displays that the server is working correctly, in case people visit via hostname or ip address. This can be changed to something you like, but you do -not- put your admin website there.

/home/admin/domains/domain_name/public_html
This is the place where your admin website should be stored.
You say they are not working, but how are they not working? What do you see, what error?
Is your domain registered with youre registrar and your DNS setup correctly? Had the domain time to synchonize?

We can help you better if you give us the error showing why it's not working in the normal way and maybe the domain name so we can investigate as to what is going on.
 
Is this a newly installed server?
If yes, wait until you get a message in your message system that all background tasks are finished, before starting to use it.
Yes, newly installed server, and I waited to finished all tasks. This is my second server, where I plan to create a new version of the online store (Prestashop 8). Currently, the older version is running on my first server (Prestashop 1.6).

I didnt't put any admin website files to /var/www/html. Only info.php

You say they are not working, but how are they not working? What do you see, what error?

I have two files under /home/admin/domains/domain_name/public_html - default index.html, and info.php, which I created.
When I enter IP SERVER/index.html or IP SERVER/info.php, I receive a 'file not found' message.

My domain is still attached to the first server, where my shop is still running.
 
When I enter IP SERVER/index.html or IP SERVER/info.php, I receive a 'file not found' message.
Yes that is logically, it doesn't work that way.
When entering serverip/index.html or serverip/info.php (if you place it there) you will always visit the /var/www/html directory.

I think what you want to achieve is making use of the userdir option, to visit a userdir via ip address of the server. But I'm not sure if it's enabled by default.

You should be able to visit it like this:

So in your case it would be:

If that is not enabled, then enable it like this as root via SSH:
Code:
cd /usr/local/directadmin/custombuild
./build set userdir_access yes
./build rewrite_confs
 
Now it works, thanks. :)

What about when I finish configuring the store on the second server? Will reversing the change to "userdir_access no" and switching the domain from the first server to the second be enough? Will the store be visible after entering the address - domain.pl (not domain.pl/~admin)?
 
The best way to check your site on the new server is to modify your hosts file on your own computer so that on your computer domain.pl points to the new server. Then you can be sure everything is working correctly.
 
The best way to check your site on the new server is to modify your hosts file on your own computer so that on your computer domain.pl points to the new server. Then you can be sure everything is working correctly.
And after remove it from the hosts file of your pc of course :-)
 
Will the store be visible after entering the address - domain.pl (not domain.pl/~admin)?
Yes as soon as the domain resolves to the new ip, then it will work on there.

Some things might work odd when using the userdir_access option so changing the hosts file might work better, like suggested above.
You also have to remember removing it from the hosts file if you want to work or check things on your original site again.
 
Thanks for all the advice. I decided to buy a temporary domain for about 3 dollars and after connecting it to the second server, everything works. :)
 
If your store somewhere uses absolute links in the database or configuration for the domain, you should change that too (database search/replace).
 
Thanks for all the advice. I decided to buy a temporary domain for about 3 dollars and after connecting it to the second server, everything works. :)

A temp domain doesn't really help with transferring a current domain.
 
Back
Top