EA3 Build
EA3 Build
EA3 Build
Definitions
OptMod
It is what you select
OptLib
Software dependency provided by cPanel c-client (IMAP) /opt
Initialization
OptMod order constructed by dependencies Tarballs downloaded and unpacked Install via package manager
OptMods Processed
Three main stages 1) Dry Run Stage 2) Action Stage 3) Post Install Test Stage
Action Stage
Failure halts build make install apxs needed configuration applied
Refresher
Initialization For each OptMod: Dry Run Stage Action Stage Post Install Tests Stage
Environment Variables
Environment Variables
Environment Variables
EasyApache 3 RAWENV support Store contents in file Location:
/var/cpanel/easy/apache/rawenv/ENV_NAME
Environment Variables
/var/cpanel/easy/apache/rawenv/CFLAGS -O0 -g
Environment Variables
Problem: over writes existing
/var/cpanel/easy/apache/rawenv/PATH
Environment Variables
/var/cpanel/easy/apache/rawenv/.prepend_PATH
/usr/local/app/bin
Result:
/usr/local/app/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/ local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Environment Variables
More Information:
http://www.cpanel.net/support/docs/ea/ea3/ea3custom_modvar.html
Configure Flags
Configure Flags
Apache 1.3.x - /var/cpanel/easy/apache/rawopts/Apache1 Apache 2.0.x - /var/cpanel/easy/apache/rawopts/Apache2 Apache 2.2.x - /var/cpanel/easy/apache/rawopts/Apache2_2 All PHP 4.x versions - /var/cpanel/easy/apache/rawopts/all_php4 All PHP 5.x versions - /var/cpanel/easy/apache/rawopts/all_php5 Specific PHP Version - /var/cpanel/easy/apache/rawopts/PHP-X.X.X
Configure Flags
Values added (appended) to configure Possibility for conflicts Recommend: disable EA3 Entry
Configure Flags
More Information:
http://www.cpanel.net/support/docs/ea/ea3/ea3custom_flags.html
Hook Scripts
Hook Scripts
/scripts/preeasyapache /scripts/posteasyapache /scripts/before_apache_make /scripts/after_apache_make_install /scripts/before_httpd_restart_tests /scripts/after_restart_tests
Hook Scripts
Each receives following arguments (in order shown): 1) EasyApache version 2) EasyApache revision 3) Apache version built 4) Comma separated PHP version(s) being built 5) --hook-args you stipulate Environment Variable: ea3_params_yaml
Hook Scripts
Custom arguments: --hook-args Format: --hook-args=value --hook-args=param=value
Hook Scripts
/scripts/easyapache --hook-args=value1 --hook-args="param=value"
$VAR1 = [
];
Hook Scripts
Other scripts executed at specific points in process Exit value not important
Hook Scripts
More Information: /scripts/easyapache --help=hooks /scripts/easyapache --help=hooks-advanced
Custom OptMod
Custom OptMod
Documentation: /scripts/easyapache --perldoc WHM >> Software >> Apache Update >> Help >> Cpanel::Easy Framework POD
Custom OptMod
An OptMod is: 1. A Perl Module file_name.pm 2. Stored in
/var/cpanel/easy/apache/custom_opt_mods
run_system_cmd_stack Easy to use to execute multiple commands in a way that communicates with easyapache properly. First argument is an array reference. Each item is an array ref of a command suitable for a standard perl system() call Wraps the logic up for multiple run_system_cmd_returnable() to use as one step
/var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/ ModPython.pm.tar.gz
/home/cpeasyapache/src/mod_python-3.3.1 That is where the script is when the steps are run. If no tarball/src_cd2 its in the .../cpeasyapache/src (which can be /usr/home or /var/cpanel at times)
(mod_pythons tarball has Apache1/ and Apache2/ directories that the same commands need done in for the given apache version)
Assumes it has all the system things it needs No info about what this option does Doesnt verify its added to httpd.conf (and datastore ?) by apxs
Custom OptMod
Some of the possibilities: 1. Divide into non-destructive and system changes a. non-destructive (pre check, info gathering type things) : dryrun element b. system changes: steps element 2. Split each group into individual steps 3. Add Apache version logic (modify src_cd2 and steps based on Apache version) 4. Much much more, see the documentation for details
Custom OptMod
1: package Cpanel::Easy::ModPython; 2: 3: our $easyconfig = { 4: 'name' => 'Mod Python', 5: 'url' => 'http://www.modpython.org/', 6: 'note' => 'For Django and other Python related scripts', 7: 'hastargz' => 1, 8: 'ensurepkg' => ['python-devel'], 9: 'src_cd2' => 'mod_python-3.3.1/', 10: 'modself' => sub { ... append Apache1 or Apache2 to src_cd2 ... }, 11: 'step' => { 12: '0' => { 13: 'name' => 'Configuring mod_python', 14: 'command' => sub { 15: my( $self ) = @_; 16: return $self->run_system_cmd_returnable([ 17: qw(./configure --with-apxs=/usr/local/apache/bin/apxs) 18: ]); 19: }, 20: },
Custom OptMod
21: '1' => { 22: 'name' => 'Making mod_python', 23: 'command' => sub { 24: my( $self ) = @_; 25: return $self->run_system_cmd_returnable(['make']); 26: }, 27: }, 28: '2' => { 29: 'name' => 'Installing mod_python', 30: 'command' => sub { 31: my( $self ) = @_; 32: return $self->run_system_cmd_returnable(['make','install']); 33: }, 35: }, 35: '3' => { 36: 'name' => 'Adding mod_python to httpd.conf', 37: 'command' => sub {... $self->ensure_loadmodule_in_httpdconf...}, 38: }, 39: }, # end step 40: }; 41: 42: 1;
Custom OptMod
Full source and tarball: http://conference.cpanel.net/files/
2) Configure Flags
http://www.cpanel.net/support/docs/ea/ea3/ea3custom_flags.html
3) Hook Scripts
/scripts/easyapache --help=hooks /scripts/easyapache --help=hooks-advanced
4) Custom OptMod
/scripts/easyapache --perldoc
Troubleshooting
Common Problems
VPS
Memory Minimum requirement: 256 MB Dedicated vs. Burst
Package Management
Failure can be fatal
http://www.cpanel.net/support/could_not_ensurepkgs.htm
FreeBSD
Questions?