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.

Automating httpd.conf settings for Installation of Servers

Discussion in 'General Discussion' started by theburningred, May 13, 2009.

  1. theburningred

    theburningred Registered

    Joined:
    May 13, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Within WHM --> Service Configuration --> Apache Configuration --> Global Configuration there are several global configuration settings. The overall goal is to set all of these settings to the "PCI Recommended" settings at installation time so that you do not have to login to WHM and set these settings manually. If anyone has done this please shed some light on the process.

    The only way I can think to do it would be to include the settings in the pre main include file which would just be a matter of copying that include file to the proper location. From the little bit of testing I've done, the problem with doing so is if the settings are set via WHM at some point in the future another entry for the same directive would be created in the httpd.conf file which would cause problems.

    It would be ideal if there was a file that contained the settings for these variables, this way the control panel would reflect the changes and there wouldn't be any conflict in the future.
     
    #1 theburningred, May 13, 2009
    Last edited: May 13, 2009
  2. 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
  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
    This information is stored in /var/cpanel/conf/apache/local and if copied to the same location prior to installation may result in those settings being applied to your server when EasyApache is run (as part of the installation process). I haven't tested this myself yet.
     
  4. theburningred

    theburningred Registered

    Joined:
    May 13, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thank you very much for the info, I'll test it and let you know how it goes.
     
  5. theburningred

    theburningred Registered

    Joined:
    May 13, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    For anyone trying to perform this task in the future, it works.

    Any idea if PHP4 and 5 have a settings file? IE for settings things like register_globals, fopen, etc... Currently I'm copying over the respective php.ini files which works just fine, but I'd like to be able to do so through the file that actually sets these variables if there is one.
     
  6. 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
    You mean the main php.ini file(s) for the entire server?
     
  7. theburningred

    theburningred Registered

    Joined:
    May 13, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Correct.

    The overall goal is to have a hands free install process. IE configure as much up front as possible so that we do not have to manually set settings later on. All of our servers will be setup the same way.

    With the current process, which works, we will be running php4 and php5. We have pre-configured the php.ini files the way we want them, on each new server setup we simply copy these files in place after easyapache has completed its run. We then restart apache and make sure its up and running. There isn't currently an issue doing it this way, but I think there is probably a better way of doing it.

    Apache has its main configuration files that you pointed out earlier. These files contain the values that are used in the httpd.conf file.
    /var/cpanel/conf/apache/{main,local}

    I'm wondering if PHP also has this same type of config file. That way we can copy over the config file to a specific location and hopefully php would be built with the settings we put in place within that file. This would take the place of copying over the php.ini files.
     
  8. 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
    If you're running only one installation of PHP, that php.ini file would be located at:

    Code:
    /usr/local/lib/php.ini
    If you are running 2 installations of PHP, the above would be for PHP 5 and the below will be for PHP 4:

    Code:
    /usr/local/php4/lib/php.ini
    Now if you're trying to change the build parameters for Apache and PHP (e.g. the checkboxes you check in EasyApache), check out this documentation:

    http://twiki.cpanel.net/twiki/bin/view/AllDocumentation/InstallationGuide/ConfigureApache
     
Loading...

Share This Page