rearrange account (failed now what? - help please)

joshua39

Registered
Mar 19, 2004
4
0
151
I rearrange 1 of account that using 3 gig of space on /home
And last night I moved it to /home2 (using WHM rearrange account).

The problem now is I'm getting this error:

Warning: Unknown(): open_basedir restriction in effect. File(/home2/kazhi/public_html/index.php) is not within the allowed path(s): (/home/kazhi:/usr/lib/php:/usr/local/lib/php:/tmp) in Unknown on line 0

Warning: Unknown(/home2/kazhi/public_html/index.php): failed to open stream: Operation not permitted in Unknown on line 0

Warning: (null)() [function.include]: Failed opening '/home2/kazhi/public_html/index.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0
And when I ssh and see the /home2 folder.. I saw all my files there..
Anybody can help me here...

Thanks
 

NexGenUK

Active Member
May 7, 2004
35
0
156
If you login to SSH as the root user, you shuold be able to edit the file "/usr/local/apache/conf/httpd.conf"

:- pico -w /usr/local/apache/conf/httpd.conf

in there, find the virtualhost for the domain and you will find one of the following
(Incase you havent done this before the virtualhost may look something like the following)

<VirtualHost 83.170.96.171:80>
ServerAlias www.bigblagger.co.uk
ServerAdmin [email protected]
DocumentRoot /home/bigblag/public_html
User bigblag
Group bigblag
<IfModule mod_php4.c>
php_admin_value open_basedir "/home/bigblag:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/bigblag/php"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/bigblag:/usr/lib/php:/usr/local/lib/php:/tmp"
php_admin_value include_path ".:/usr/lib/php:/usr/local/lib/php:/home/bigblag/php"
</IfModule>

ServerName bigblagger.co.uk

User bigblag
Group bigblag
BytesLog /usr/local/apache/domlogs/bigblagger.co.uk-bytes_log
CustomLog /usr/local/apache/domlogs/bigblagger.co.uk combined
ScriptAlias /cgi-bin/ /home/bigblag/public_html/cgi-bin/
<IfModule mod_suphp.c>
suPHP_UserGroup bigblag bigblag
</IfModule>
</VirtualHost>
This is from a site on one of my companies servers.

The bits of interest that will relate to your problem will be:
<IfModule mod_php4.c>
php_admin_value open_basedir "/home/kazhi:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
and/or
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/kazhi:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
You need to change the path slightly to say "/home2/kazhi:/ur/lib/php:/usr/local/lib/php:/tmp".


Once youve done that, close and save the file (press ctrl+x, it'll ask you to save), and then restart apache:
/etc/init.d/httpd restart

If you dont have root access, you'll have to contact the company you host with.

Hope that helps and doesnt confuse too much lol
 

linux.newbie

Well-Known Member
Sep 8, 2006
73
0
156
Since you will be adding more accounts to /home2, I would suggest adding /home2 permanently to your server configurations.

edit /scripts/phpopenbasectl
check for the line
print HC "<IfModule mod_php4.c>\nphp_admin_value open_basedir
or
print HC "<IfModule mod_php5.c>\nphp_admin_value open_basedir
and add "/home2:" next to home without quotes there.

Then,
/scripts/phpopenbasectl off
/scripts/phpopenbasectl on

This is applicable if, on the file you have set "/home" and not the homedir parameter.