DNS points to admin's files, rather than user's files

nutN2Lewz

Verified User
Joined
Feb 26, 2013
Messages
20
My admin user level domain is xyz.com.
I also have a seperate account (user1) that uses the same domain of xyz.com.

I altered my registrar dns info ...

xyz.com is now available at /home/admin/domains/xyz.com/public_html
instead of in the user's account at /home/user1/domains/homepokertourney.com/public_html.

I assume that the admin account takes precedence over the user's account. How can I make the domain point to the user's files instead of to the admin's files? If I remove xyz.com from the admin account will the domain automatically start pointing to the user's files?

Thanks, Barry
 
Yes, my domain is resolved and it works good except for a couple PHP pages. Those pages (search.php and portal.homepokertourney.com/index.php) rely on certain php commands (require_once, etc.) that error because the files have changed ownership (from user1 to admin).

I can alter the files and ownerships in the admin directories but it would be much quicker to point the domain to user1's directories on the server rather than to the admin's directories. It would also be better in that I could allow people to log in as user1 to alter/upload files.

Thanks, Barry
 
So I have hompokertourney.com set as my admin domain. I also used the same domain for a normal user (hp2) that I imported from cPanel at my old server. I want the hp2 files to load rather than the admin files.

Right now the admin files take precedence (over the user files) ...
http://www.homepokertourney.com/search.php

Resulting in PHP errors due to SAFE MODE and absolute addressing ...

PHP Warning: include(): SAFE MODE Restriction in effect. The script whose uid is 0 is not allowed to access /home/hp2/domains/homepokertourney.com/public_html/forums/SSI.php owned by uid 512 in /home/admin/domains/homepokertourney.com/public_html/search.php

PHP Warning: include(/home/hp2/domains/homepokertourney.com/public_html/forums/SSI.php): failed to open stream: No such file or directory in /home/admin/domains/homepokertourney.com/public_html/search.php


But if I load the hp2 user files there are no errors ...
http://173.208.143.202/~hp2/search.php

So is there any quick way to make the hp2 user files load rather than the admin user level files? If I delete the hompokertourney.com domain from my admin user level will it also delete the domain from the hp2 user account? And if I do delete that domain from my admin user level, will the hp2 user files load instead or will I go 404.

I know that I can solve this problem by editing my admin php files to change the absolute links that point to my user files. For example I can change (/home/hp2/domains/homepokertourney.com/public_html/forums/SSI.php) to point to my admin files (/home/admin/domains/homepokertourney.com/public_html/forums/SSI.php). I don't have many php files on my site so this is not a huge effort but I do not like having my hp2 files in my admin account - if I want to have someone else work on the hp2 files I would have to give them access to my admin account, rather than to a user account.

I'm just looking for as simple a solution as possible. How can I force my hp2 user files to load rather than my admin user level files? I have a feeling that it might be best to edit my admin files (removing absolute addresses to hp2) and leave things as they are.

Thanks, Barry
 
Last edited:
How did you manage add one domain to two users? Directadmin does not allow that. So you should remove the domain from admin if you want the site be opened from regular user homedir. Also you might want to use move domain script, which is located in /usr/local/directadmin/scripts/ Though I'm not sure how will it work in your case, when you have one domain added to both admin and homepo2 user.

Of you mean that your hostname is the same with user's domain? If this is the case, then you should change your hostname something to server.domain.com, where change domain.com with your real domain name.
 
I have homepokertourney.com as my admin User Level domain and I also have homepokertourney.com as my hp2 User domain. My hostname is server.homepokertourney.com.

It might have something to do with the cPanel to DA script that I used to import the hp2 cPanel account from my previous server. I've only had my new server for about a week. I set up the admin account first with homepokertourney.com and then imported my cPanel hp2 acccount with homepokertourney.com.

When I go to my admin User Level I see homepokertourney.com as having zero subdomains and using zero database disk usage but when I go into my hp2 account I see homepokertourney.com as having four subdomains and 700MB database disk usage. The two accounts also show different nameservers for the same domain.

Gotta get some sleep and then I will delete the admin User Level homepokertourney.com domain. I guess I don't have to move that domain because it already exists in my hp2 User account. This should be interesting. I spent the past week securing my server and moving accounts over from cPanel - I hope I don't have to start from scratch if things don't work.

Thanks, Barry
 
Last edited:
Be sure to back up the domain before deleting it; it's possible that there's really only one domain and that when DirectAdmin set it up during the restore it somehow overwrote the one existence in /home. If that's the case you don't want to lose it, so make a backup.

Jeff
 
I did a backup and then ciicked on Delete Domain as gently as possible. It worked. I then went to my domain home page and clicked refresh - Error 403 Forbidden, Error 403 Forbiden ... and then my home page loaded from my user files instead of my admin files! Yes! So it appears that the domain in my admin directories took precedence over the domain in my user directories.

About 10 minutes later I noticed a slowdown on my server and thousands of errors in my my /var/log/messages log ...
server named[2185]: client xxx.xxx.xxx.118#20985: query (cache) 'www.homepokertourney.com/A/IN' denied

So I checked my admin DNS Administation and noticed that the homepokertourney domain was missing from the list. I added the domain and almost everything is back to normal. My domain showed "Local Data" and "Local Mail" as "NO". I got the Local Mail back to YES but I'm still trying to figure out how to get the "Local Data" back to yes.

All email based on user hp2 does not work. When I try to view my email accounts for user hp2 I get "Cannot open the user password file for reading" and no email accounts are shown. When I attempt to 'Create mail account' I get ...

Cannot open the password file to add the user: Unable to get Lock on file:
open error for /etc/virtual/homepokertourney.com/passwd.lock: No such file or directory
/etc/virtual/homepokertourney.com: No such file or directory


I checked and those directories have been eliminated. I changed my password to try to rebuild those directories but that did not solve the problem. I haven't had time to try to fix that problem.

Thanks, Barry
 
Last edited:
As directadmin does not allow have duplicates of domains, when you deleted the domain from admin, directadmin removed DNS zone for the domain, and /etc/virtual/homepokertourney.com as well. So for now you need to re-create DNS zone and recover /etc/virtual/homepokertourney.com.

The simplest way would be at least this is how I see that:

1. Login as user homepo2

2. Change name of homepokertourney.com to homepokertourney-old.com

3. Add a new domain homepokertourney.com to the account

4. Move all content from /home/homepo2/domains/homepokertourney-old.com/public_html/ to /home/homepo2/domains/homepokertourney.com/public_html/

5. Make sure to move all your emails from /home/homepo2/imap/homepokertourney-old.com/ to /home/homepo2/imap/homepokertourney.com/

6. Make sure your site opens OK and remove the homepokertourney-old.com domain in directadmin.

Of course you might need to re-add all email accounts manually.
 
Back
Top