Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default Automating httpd.conf settings for Installation of Servers

    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.
    Last edited by theburningred; 05-13-2009 at 12:28 PM.

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jul 2005
    Location
    New Jersey, USA
    Posts
    397

    Default

    You may want to send this suggestion to cpanel. The function is relatively new so it should evolve over time, and probably be the default in the future.

  3. #3
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by theburningred View Post
    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.
    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. #4
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default Automating httpd.conf settings for Installation of Servers

    Thank you very much for the info, I'll test it and let you know how it goes.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default

    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. #6
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by theburningred View Post
    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.
    You mean the main php.ini file(s) for the entire server?

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4

    Default

    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. #8
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by theburningred View Post
    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.
    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/vi...onfigureApache

Similar Threads & Tags
Similar threads

  1. httpd.conf virtual hosts only includes std config settings not ssl
    By mobcdi in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 05-10-2011, 12:46 PM
  2. tweak settings changes emptied httpd.conf
    By pavemen in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-02-2008, 10:56 AM
  3. Preserving httpd.conf settings - Apache 2.2.6
    By erick_paper in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-18-2008, 10:43 PM
  4. upcp is changing httpd.conf to 600 this break many fantastico installation
    By BianchiDude in forum cPanel and WHM Discussions
    Replies: 33
    Last Post: 07-31-2005, 07:06 AM
  5. Uptime, diskswapping, httpd.conf settings
    By ozzi4648 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-11-2003, 02:07 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube