wrong documentroot

bigbr0thr

Verified User
Joined
Feb 2, 2004
Messages
5
I want to transfer a domain to my own servers.
To prepare the transfer i copied the whole site to the proper public_html dir.
The problem is, i want to test the transferd site before i change the dns-entry's to my own server.
The only way to reach the site is trough the http://62.xxx.xxx.xxx/~user syntax, because the domain doesnt resolve yet.
But when i do that it seems that apache uses the default httpd.conf settings and not the httpd.conf settings that the domain should use. The documentroot points to /var/www/html, and it should point to /home/user/domains/xxxxx/public_html.
Because of this al include's in my php programs are giving errors.
Is there a way to let documentroot point to the right dir ??
 
Hello,

The ~user directive has nothing to do with any virtual host. It uses the "UserDir" directive in the main httpd.conf file. That will just point to /home/user/public_html, which is a symbolic link to the correct domain.

Verify that the user exists, /home/user/public_html exists, and is pointing to the correct directory, and that the directory exists. Also make sure that the UserDir directive hasn't been manually changed.

John
 
Thnx 4 the reply John,

i looked into your suggestions.
The user exists, the directory exists, the link is ok and the userdir directive is public_html, so it looks ok.
but check these links and take a look at the php var. document_root.

http://62.212.90.180/~bigbr0thr/siteinfo.php
http://www.fd-nl.nl/siteinfo.php

Although you can access the site in both ways, the doc_root still points to a wrong directory ???
And because some php functions make a path relative to the document_root things go wrong.

Any suggestions ?

Harry
 
Hello,

When you access the site via ~username, no "DocumentRoot" is used. Only the "UserDir" directive is what points ~username to the new path.. Because no virtualhost is used for ~username, the default DocumentRoot of /var/www/html is shown, even though you will be directed to /home/bigbr0thr/public_html.

It's like ~username is a "virtual" subdomain of 62.212.90.180, and the DocumentRoot for 62.212.90.180 is obviously /var/www/html. It's the ~username thing that's doing magic things, which is causing the confusion :) Everything is as it should be.

John
 
Hello,

When you access the site via ~username, no "DocumentRoot" is used. Only the "UserDir" directive is what points ~username to the new path.. Because no virtualhost is used for ~username, the default DocumentRoot of /var/www/html is shown, even though you will be directed to /home/bigbr0thr/public_html.

It's like ~username is a "virtual" subdomain of 62.212.90.180, and the DocumentRoot for 62.212.90.180 is obviously /var/www/html. It's the ~username thing that's doing magic things, which is causing the confusion :) Everything is as it should be.

John

Whether it is possible to correct for it?
When the user comes so ~username instead of domen.com that variables DOCUMENT_ROOT and also PHP_SELF efficient data give not. For example: http://site-maker.biz/ - so works
http:// 82.144.221.72/~site/ - and so is not present If it to not correct for that from an opportunity to come to the address of http: // 82.144.221.72 / site/is not present any to sense. As the user was not developed yet DNS cannot correctly check up working capacity of a site.
It is necessary to correct for it.
Thanks.
 
Back
Top