Need a control panel option to enable/disable Safe Mode

hostpc.com

Verified User
Joined
Aug 2, 2003
Messages
1,178
Location
Schenectady, NY
With the most recent upgrade, safemode was automatically enabled for all sites. This causes MAJOR problems for clients scripts that weren't expecting a change.

It causes an equally major problem for me, as I don't want my techs to have access to root to change to open_basedir or remove safe mode restrictions, and currently, thats the only way it can be done (I think).

A control panel option to enable/disable safe mode & open_basedir is desperately needed, if only from the admin login.

We need to implement something like this soon. Manually editing 500 sites (or every site with Invision PB, Menalto Gallery, etc.) isn't an option. Any ideas?
 
I notice in your templates that you customize them at templating time with variables, like:

Code:
<Directory |DOCROOT|>
  Options +Includes -Indexes
  php_flag engine |PHP|
  php_admin_value safe_mode 1
</Directory>

Is there anywhere in a domain's configuration that we can specify our own variables? For instance:

Code:
PHP_SAFE_MODE=(1 or 0)

Then change our template to:

Code:
<Directory |DOCROOT|>
  Options +Includes -Indexes
  php_flag engine |PHP|
  php_admin_value safe_mode |PHP_SAFE_MODE|
</Directory>

Then when a re-templating task hits we retain the configured value.
 
Hello,

For 1.20.2 I've actually taken the open_basedir and safe_mode out. Unfortunately it was causing major problems for many people and we were getting many support requests for broken sites.

If you want safe_mode and/or open_basedir, you can use the "custom httpd.conf" feature as it's *very* easy to add those features to a site, but as this thread has pointed out, quite difficult to remove them.

If you liked how it was, you are free to copy the templates over to the custom directory and modify them to your hearts content :)


On a seperate note, more in replying to what you're doing with safemode (actually this would have worked before, but I'll explain anyway) have a virtual_host template like the following:
Code:
|?PHP_SAFE_MODE=1|
<VirtualHost ...>
      |CUSTOM|
      .....
      php_admin_value safe_mode |PHP_SAFE_MODE|
      .....
</VirtualHost>
Now, since we have the custom httpd.conf feature, we can insert whatever we want into the |CUSTOM| token... so, in the custom httpd.conf tool, just add
Code:
|?PHP_SAFE_MODE=0|
Which will override the "0" because it's set after the first one.. and safe_mode will then be shut off.

This lets you have it on for all domains, and then shut it off for whatever domains you want. :)

John
 
Back
Top