Beruflich Dokumente
Kultur Dokumente
Build Process
Kenneth Power
What you will gain
c-client (IMAP)
/opt
The Build Process
Initialization
OptMod order constructed by dependencies
Tarballs downloaded and unpacked
Install via package manager
OptMods Processed
Three main stages
2) Action Stage
OptLib installation
Dependency checking
configure
make
Action Stage
Failure halts build
make install
apxs
needed configuration applied
Post Install Tests Stage
Failure halts the process
Static pages
CGI
Others as dictated by Options
Refresher
Initialization
For each OptMod:
– Dry Run Stage
– Action Stage
– Post Install Tests Stage
Customizing the Build
Several Ways to Customize
1) Environment variables
2) Configure flags
3) Hook scripts
4) Custom OptMod
Environment Variables
Environment Variables
CFLAGS=”-DFD_SETSIZE=16382”
CXXFLAGS=”-funroll-loops”
LDFLAGS=”-L/usr/local/lib/my_lib”
Persist?
Environment Variables
EasyApache 3 RAWENV support
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
Append: .append_ENV_NAME
Prepend: .prepend_ENV_NAME
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
--with-zlib-dir=/usr/local/zlib
--enable-foo
Auto-Corrects:
--with-zlib-dir=
Becomes:
--with-zlib-dir
Configure Flags
Values added (appended) to configure
Recommend:
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
Format:
--hook-args=value
--hook-args=”param=value”
Hook Scripts
/scripts/easyapache --hook-args=value1 --hook-args="param=value"
$VAR1 = [
'3.2.0',
'4243',
'',
'',
'value1',
'param=value'
];
Hook Scripts: preeasyapache
Before anything else in the Initialization stage
exit 1
!! Executing custom hook '/scripts/preeasyapache' !!
!! Done executing '/scripts/preeasyapache' !!
!! '/scripts/preeasyapache 3.2.0 4243 value1
param=value' failed with exit code '256' !!
Hook Scripts: posteasyapache
Executed at end of successful build
/scripts/easyapache --help=hooks
/scripts/easyapache --help=hooks-advanced
Custom OptMod
Custom OptMod
Documentation:
/scripts/easyapache --perldoc
1. A Perl Module
file_name.pm
2. Stored in
/var/cpanel/easy/apache/custom_opt_mods
1: package Cpanel::Easy::ModPython;
/var/cpanel/easy/apache/custom_opt_mods/
Cpanel/
Easy/
ModPython.pm
/var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/ModPython.pm
Custom OptMod: the simple way
12-16: return $self->run_system_cmd_stack( ...
run_system_cmd_stack
Easy to use to execute multiple commands in a way
that communicates with easyapache properly.
/var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/
ModPython.pm.tar.gz
Custom OptMod: tarball
Directory inside tarball it is what goes into ‘src_cd2’
Unpacked inside:
/home/cpeasyapache/src
6: 'src_cd2' => 'mod_python-3.3.1/',
/home/cpeasyapache/src/mod_python-3.3.1
That is where the script is when the steps are run.
/var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/ModPython.pm
/var/cpanel/easy/apache/custom_opt_mods/Cpanel/Easy/ModPython.pm.tar.gz
Custom OptMod: the simple way
Pros:
little programming required
Cons:
Assumes works with all versions of Apache
(mod_python’s 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
Doesn’t verify its added to httpd.conf (and
datastore ?) by apxs
Custom OptMod
http://conference.cpanel.net/files/
Custom OptMod: success
Customizing the Build
1) Environment Variables
http://www.cpanel.net/support/docs/ea/ea3/ea3custom_modvar.html
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
Package Management
FreeBSD
VPS
Memory
Network
Dependencies
Database
Race conditions
Antiquated OS
FreeBSD
/scripts/easyapache --skip-rawopts
/scripts/easyapache --skip-rawenv
/scripts/easyapache --skip-hooks
/scripts/easyapache --skip-cpanelsync
Questions?