nu-steve

Member
Apr 13, 2002
7
0
301
I'm currently running all my user's domains with the following in their VirtualHost config in httpd.conf:

php_admin_value open_basedir &/home/username:/tmp&

so that they cannot peruse through other user's files with a php script. I don't want to have to add these by hand all the time, so I was looking at wwwacct which creates the file, and where it writes to httpd.conf (around like 643) and was wondering what happens if I edit the file to make the httpd.conf changes automatically add the aforementioned line to all newly created accounts. I realize there are two places to change, for named based and ip based accounts. Just wondering if wwwacct will get overwritten soon or if I can 'chattr +i' it so that it can't be changed, and if in fact wwwacct is updated I can just update it manually and then replace my changes. Or possibly get it set as an option to the script for everyone to use?

Mainly wondering how often wwwacct gets updated and if I'd be safe editing it to fit this particular need.

edit: I've noticed that this is only for creating accounts, the subdomain setup uses a different script all together, although I couldn't figure out where the code for it was, was hoping someone could point me to where the script for creating subdomains is so I can modify that appropriately.
 

SHSaeed

Well-Known Member
May 9, 2002
243
0
316
I am wondering the exact same thing. I have to add the following line to my httpd.conf file for every new site:

php_admin_value open_basedir &/home/username/:/tmp/phpuploads/&

I tried to change the /scripts/wwwacct file, but only a few minutes later it seemed to have been replaced with the old script.
 

bliz42

Member
May 7, 2002
21
0
301
fix suggestion

seems like it would be a smart thing to have a custom script that would run along with adding a user... or even better, to use a template for creating the new entry into httpd.conf, so we could just update the template all we wanted.
 

moronhead

Well-Known Member
Aug 12, 2001
706
0
316
[b:db1e15c2e6]& php_admin_value open_basedir &/home/username:/tmp&

so that they cannot peruse through other user's files with a php script.[/b:db1e15c2e6]

Does turning on the safe mode in php.ini not handle this?
 

SHSaeed

Well-Known Member
May 9, 2002
243
0
316
I just noticed that even though I've modified wwwacct to add the open_basedir line to all domains, it does not add them to subdomains. I'm guessing there's another script that adds subdomains to httpd.conf. Anyone know which one?
 

Radio_Head

Well-Known Member
Verifed Vendor
Feb 15, 2002
2,048
1
343
[quote:5af1fe33c7][i:5af1fe33c7]Originally posted by moronhead[/i:5af1fe33c7]

[b:5af1fe33c7]& php_admin_value open_basedir &/home/username:/tmp&

so that they cannot peruse through other user's files with a php script.[/b:5af1fe33c7]

Does turning on the safe mode in php.ini not handle this?[/quote:5af1fe33c7]


if you use php_admin_value open_basedir &/home/username:/tmp& for every account , you may disable safe mode .
 

Radio_Head

Well-Known Member
Verifed Vendor
Feb 15, 2002
2,048
1
343
Could be fantastic to have
php_admin_value open_basedir &/home/username:/tmp&
created by whm for every new account .


please post your comment here
http://web.cpanel.net/bugzilla/show_bug.cgi?id=519
 

SHSaeed

Well-Known Member
May 9, 2002
243
0
316
[quote:b2105032eb][i:b2105032eb]Originally posted by Radio_Head[/i:b2105032eb]

Could be fantastic to have
php_admin_value open_basedir &/home/username:/tmp&

created by whm for every new account .[/quote:b2105032eb]

That can be done simply by modifying /scripts/wwwacct, the problem is subdomains.
 

Radio_Head

Well-Known Member
Verifed Vendor
Feb 15, 2002
2,048
1
343
[quote:0536873edb][i:0536873edb]Originally posted by (SH)Saeed[/i:0536873edb]

[quote:0536873edb][i:0536873edb]Originally posted by Radio_Head[/i:0536873edb]

Could be fantastic to have
php_admin_value open_basedir &/home/username:/tmp&

created by whm for every new account .[/quote:0536873edb]

That can be done simply by modifying /scripts/wwwacct, the problem is subdomains.[/quote:0536873edb]

(!) Thank you , ok :p .