EasyApache

 

This document is deprecated. Please see: this document for more information.


 

Setting up your Apache Options

In order to build Apache and/or PHP, you will need to select which Apache and/or PHP modules and options you require. Documentation about specific Apache modules can be found at http://httpd.apache.org/docs/ for the version of Apache you are using.

Choosing a profile

EasyApache provides several pre-built Apache profiles (and possibly some profiles you have saved). You can select a profile based on it's description. Selecting a profile does not mean that you must use the specific options it includes, you can modify it during later steps.

Choosing an Apache Version

After choosing the profile you wish to base your build off of, you'll want to select a version of Apache to use. Apache 1.3, 2.0 and 2.2 are supported. more information about the specific versions of Apache can be found at http://httpd.apache.org.

Choosing a PHP Version

After choosing your Apache version, you'll need to select whether to use PHP4, PHP5, or both. Your PHP needs will be dictated by the PHP applications running on the server. After selecting a version branch of PHP, you'll need to specify the specific version (i.e. 4.4.4).

Using PHP4 and 5

If you choose to use two versions of PHP, you'll need to configure how PHP pages are processed after Apache and PHP have been installed. This is done in the WebHost Manager under Service Configuration -> Configure PHP and Suexec or on the command line using the /usr/local/cpanel/bin/rebuild_phpconf script.

 

 

Custom Options and Compilation

Setting Custom Options

At this point, you can choose to simply Save the current configuration and build Apache. However, if you wish to set up specific custom Apache or PHP options, you can do so now. Simply check or uncheck the box next to an option or module to enable or disable it. If you click on the [ ? ] next to an Apache module/option, you'll be taken to the documentation page for that module/option.

Saving Custom Options

Each time Apache is built, the options you used will automatically be saved as the 'Last Saved Version'. However, If you have chosen to set up custom options/modules, you may want to save the configuration for later use. You can enter a Save As (filename), Profile Name (name to display), and a description.

For example:

Save As: ap22_opt_php
Name: Optimized Apache 2.2 with PHP
Description: Performance optimized Apache 2.2 with mod_rewrite and mod_evasive. PHP built with MySQL support and our other standard options. For use on Reseller_Gold servers that require common PHPscripts/apps.

After saving, these Profiles will appear in the Apache Update interface in WHM and when running /scripts/easyapache from the command line.

You can save a profile without rebuilding Apache by selecting 'Save only (Do NOT build) and then clicking on 'Next Step'. Be careful when choosing profiles to save as they will all appear in the interface and you may have to manually delete them later if you save too many.

These saved profiles can be pre-loaded later by choosing:

#/scripts/easyapache --profile=profilename

or you can build Apache with a specific profile without having to go through the interface steps by running:

#/scripts/easyapache --profile=profilename --build

Compiling

To compile apache, select 'Save and build' and then click on 'Next Step'.


 

Modifying Environmental Variables

Warning: Modifying your Apache or PHP Variables can break the compilation of Apache. cPanel is not responsible for custom changes and provides no warranty of any kind with this information. Proceed with caution.

EasyApache has the ability to let you change, add, or append to any environment variables you may want. These changes must be made on the command line before running /scripts/easyapache or Apache Update through WHM.

Adding or Changing Variables

First, create a file in /var/cpanel/easy/apache/rawenv/ with the name of the environmental variable.

For example, you could edit the PATH variable by creating /var/cpanel/easy/apache/rawenv/PATH. The contents of this file should be the value of the variable. Assuming your desired $PATH is '/bin:/usr/bin:/sbin:/usr/sbin', the file would contain only: /bin:/usr/bin:/sbin:/usr/sbin

Appending Variables

However, for the PATH variable, it is not ideal to replace it as your path needs might change. Instead, you can append your PATH change by creating a /var/cpanel/easy/apache/rawenv/.append_PATH file. In that file, simply place the path you wish to append to $PATH. For example: :/home/bin

Prepending Variables

You can also prepend variables by adding a .prepend_VARIABLE file.


 

Using Custom Configure Flags

Warning: Modifying your configure flags can break the compilation of Apache. cPanel is not responsible for custom changes and provides no warranty of any kind with this information. Proceed with caution.

EasyApache also allows you to specify any configure option supported by Apache and/or PHP. To add configuration options, simply place the option in the appropriate file (one option per line, format: option=value):


Configure Option Examples

If the file contains the following lines:

--with-someoption
--path-to-something=/usr/bin/something
--my-option=

The following will be added to the configure line:
--with-someoption --path-to-something=/usr/bin/something --my-option
You'll notice that the configure line has '--my-option' instead of '--my-option='. This is because the file is parsed and then properly formatted options are merged into the configure data structure.

 

Distributing Options Over Multiple Servers

Build Profiles

Build profiles are saved in /var/cpanel/easy/apache/profiles/custom/. They are named '{profilename}.yaml'. Simply rsync/scp/ftp the appropriate .yaml files (to the same directory on the new server) between your servers to distribute a build profile. Or once you've configured the profile, place it on a distribution server so you can suck it down with wget,sftp,etc.


Example of automating this:

#scp http://www.domain.com/mycustom.yaml /var/cpanel/easy/apache/profiles/custom/mycustom.yaml
#/scripts/easyapache --build --profile=mycustom

Custom Configure Flags or Variables

Just like Build Profiles, simply copy over the appropriate files to the same directory on the server you wish to use the flag or variable on.


cPanel Web Site Feedback Form

Find everything you were looking for? Yes No

If no, what were you looking for?

Is there anything we can do to improve your experience?

Comments:

Contact Email (optional):