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.

Global safe_mode ON, want Local safe_mode OFF

Discussion in 'General Discussion' started by hoball, May 17, 2009.

  1. hoball

    hoball Registered

    Joined:
    Sep 13, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I have searched over google that it is possible for me to have safe_mode OFF locally, while having it turned ON globally.
    It is done by adding a line to the VirtualHost tag of the domain in httpd.conf:
    Code:
    php_admin_flag safe_mode Off
    However, in cPanel 11, the system changed and I am quite confused now. I am not sure where to add the line as the new httpd.conf warn me not to edit the file directly.

    Would anybody show me the direction on editing the VirtualHost tag?

    Thank you!!
     
  2. 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
    As httpd.conf says, use the include files. Here's information on using includes:

    http://www.cpanel.net/documentation/easyapache/customdirectives.html

    Scroll to the section: httpd.conf changes contained in a <VirtualHost>
     
  3. PlatinumServerM

    PlatinumServerM Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2005
    Messages:
    397
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    New Jersey, USA
    cPanel Access Level:
    Root Administrator
  4. hoball

    hoball Registered

    Joined:
    Sep 13, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    Thanks for your reply. I would like to post a follow up question:
    For example, I am editing the domain xxx.com for Local Safe_mode OFF
    in the httpd.conf, there is a section for xxx.com
    Code:
    <VirtualHost 1.2.3.4:80>
        ServerName xxx.com
        ServerAlias [url]www.xxx.com[/url]
        DocumentRoot /home/xxx/public_html
        [blah..blah..blah..]
    </VirtualHost>
    What should I add in the include file??
    should I create a full <VirtualHost> tag in Post_VirtualHost_Include, with
    "php_admin_flag safe_mode Off" ?
     
  5. 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
    It would be the full <VirtualHost .. > .. </VirtualHost> tag.
     
  6. hoball

    hoball Registered

    Joined:
    Sep 13, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I am sorry to bother you again, I followed the documentation, and created a file with path
    /usr/local/apache/conf/userdata/xxx/xxx.com/custom-config.conf

    in the custom-config.conf, I tried the followings but was not successful.
    Would you mind giving me a suggestion? Thank you.

    Code:
    <VirtualHost>
    php_admin_flag safe_mode Off
    </VirtualHost>
    with IP
    Code:
    <VirtualHost 1.2.3.4:80>
    php_admin_flag safe_mode Off
    </VirtualHost>
    only one line:
    Code:
    php_admin_flag safe_mode Off
     
  7. 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
    It has to have the full contents of the Virtualhost, not just the setting you want to add/change.
     
  8. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    php safe_mode option is going to be removed from PHP6.
     
  9. hoball

    hoball Registered

    Joined:
    Sep 13, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello
    the script: /scripts/verify_vhost_includes always return error if the .conf at /etc/httpd/conf/userdata/std/2/xxx/xxx.com/ has the following line:

    php_admin_value safe_mode Off

    sudo /scripts/verify_vhost_includes --show-test-output
    Code:
    Testing /usr/local/apache/conf/userdata/std/2/xxx/xxx.com/custom-config.conf...FAILED
            No changes made without --commit flag
    [TEST RESULTS]
    Syntax error on line 7 of /usr/local/apache/conf/userdata/std/2/xxx/xxx.com/custom-config.conf:
    Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
    
    [/TEST RESULTS]

    It seems to me that the script is not recognizing the flag, however, ignoring this message is fine to apache. the Local Safe Mode is OFF.
     
    #9 hoball, Jun 4, 2009
    Last edited: Jun 4, 2009
  10. 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
    Hmm, definitely talk to our technical analysts about that. They may be able to do something about that issue: http://tickets.cPanel.net/submit
     
Loading...

Share This Page