The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

enable safe_mode for particular account

Discussion in 'General Discussion' started by valleytech, Nov 6, 2007.

  1. valleytech

    valleytech Member

    Joined:
    May 11, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    hi,
    I have turned ON php safe_mode to prevent local hacking.
    However, some of my clients are using osCommerce as well as zen cart to provide online shopping which require safe_mode to be OFF.

    I have realized that there're several different php.ini across the server: /usr/local/lib, /usr/local . . .

    Is it possible for me just to enable safe_mode ON for particular account?

    thanks so much!
     
  2. mitul

    mitul Well-Known Member

    Joined:
    Feb 8, 2003
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    16
    Yes you can enable safe_mode for a particular domain. Add the below entry under virtual host in httpd.conf or in .htaccess under document root folder.

    php_value safe_mode on

    Regards,
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    .htaccess PHP directives will not work for SuPHP servers. Details at:

    http://www.cpanel.net/support/docs/ea/ea3/ea3php_php_requests.html
     
  4. valleytech

    valleytech Member

    Joined:
    May 11, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    thanks!!!

    I want to globally enable SAFE_MODE tobe ON
    and use the php directory in httpd.conf to disable safe_mode on each account.

    it's not working!
    am I missing anything?

    thanks!!
     
  5. TheHeartSmasher

    TheHeartSmasher Active Member

    Joined:
    Jul 14, 2006
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Don't forget to restart the httpd service.
     
  6. valleytech

    valleytech Member

    Joined:
    May 11, 2007
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    thanks millions!
    But, I sure knew the process to apply new configuration to PHP/apache, in this case, it still didn't work.
    Besides,
    I have open_dir_restriction ON, also using .htacess. Will that be a problem?

    thanks!!!
     
  7. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    i have semilar sitution

    php 5.2.5
    apche 2.2
    suphp

    how i can disable safe mode for 1 account ....

    i have search in the httpd.conf and i found this

    Code:
        ServerName xxxx.com
        ServerAlias www.xxxx.com xxxxx.com
        DocumentRoot /home/xxxxx/public_html
        ServerAdmin webmaster@xxxxxx.com
        UseCanonicalName Off
    
        TransferLog /usr/local/apache/domlogs/xxxx.com
        CustomLog /usr/local/apache/domlogs/xxxx.com-bytes_log "%{%s}t %I .\n%{%s$
        ## User sansnom # Needed for Cpanel::ApacheConf
        UserDir disabled
        UserDir enabled xxxxxxx
        <IfModule mod_suphp.c>
            suPHP_UserGroup xxxxx xxxxx
        </IfModule>
        <IfModule concurrent_php.c>
            php4_admin_value open_basedir "/home/xxxx:/usr/lib/php:/usr/php4/lib$
            php5_admin_value open_basedir "/home/xxxx:/usr/lib/php:/usr/local/li$
        </IfModule>
        <IfModule !concurrent_php.c>
            <IfModule mod_php4.c>
                php_admin_value open_basedir "/home/xxxxx:/usr/lib/php:/usr/php4/$
            </IfModule>
            <IfModule mod_php5.c>
                php_admin_value open_basedir "/home/xxxxx:/usr/lib/php:/usr/local$
            </IfModule>
            <IfModule sapi_apache2.c>
                php_admin_value open_basedir "/home/xxxxx:/usr/lib/php:/usr/php4/$
            </IfModule>
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            SuexecUserGroup xxxxxx xxxxxx
        </IfModule>
        ScriptAlias /cgi-bin/ /home/xxxxxx/public_html/cgi-bin/

    in wich part chould i add the commande line to disable the safe mode ?
     
  8. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    anyone for this ??? !!!!
     
  9. RizyDeWino

    RizyDeWino Well-Known Member

    Joined:
    Aug 1, 2005
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Planet Earth
    Disable it in 'IfModule mod_php4.c' , 'IfModule mod_php5.c' and 'sapi_apache2.c' section.

    php_admin_value safe_mode On/Off (as per your requirement)


    Also visit the link 'http://www.cpanel.net/support/docs/ea/ea3/ea3php_php_requests.html' pasted by cPanelDavidG above , as the exact way in which this should be done also depends on your server setup.
     
    #9 RizyDeWino, Dec 26, 2007
    Last edited: Dec 26, 2007
  10. activa

    activa Well-Known Member

    Joined:
    May 23, 2006
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    i have tested it with no result . i use php as cgi and not as a module .
     
Loading...

Share This Page