//-------------------------------------------------------// //------- lamp presentation at austin linux meetup ------// //---------- by bob carnaghi & jason schonberg ----------// //---------- july 5, 2010 ----------// //-------------------------------------------------------// //---------- ----------// //-------------------------------------------------------// //---------- ----------// //-------------------------------------------------------// //---------- compile section ----------// download sources: apache: http://httpd.apache.org/download.cgi#apache22 http://www.trieuvan.com/apache/httpd/httpd-2.2.15.tar.gz mysql: http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.3-m3-linux2.6-i686-icc.tar.gz/from/http://mysql.he.net/ http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.4-m3.tar.gz/from/http://mysql.he.net/ php: http://php.net/downloads.php http://us3.php.net/get/php-5.3.2.tar.gz/from/us2.php.net/mirror phpmyadmin: http://www.phpmyadmin.net/home_page/downloads.php http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.3.2/phpMyAdmin-3.3.2-english.tar.gz?use_mirror=cdnetworks-us-2 webmin: http://prdownloads.sourceforge.net/webadmin/webmin-1.510.tar.gz questions/concerns to be addressed: compile options: how to find info on config options, what they mean, etc. (need links) what is the difference running php as a cgi? path to executables? modules @ apache: how to compile, use, etc. `export install=/usr/local/`, then test it with `echo $install` compile process: -> cd to source directory -> `./configure [--with-options=xyz]` (check for system libraries, writes the make file) (as user) -> `make` (as user) -> `make test` -> `make install` (as root) -> `make clean` -> note the .config.cache hidden file, and the config.log file -> for security, run `configure`, `make`, `make test`, etc. as regular user - then run `make install` as root (must have elevated privileges to copy binaries to their final home) -> make sure you have gcc (the gnu compiler) and gcc-c++ (the gnu c++ compiler) installed `yum -y install gcc gcc-c++` misc. notes: compile apache & mysql first compile php last, because it links/loads modules that work with/against apache/mysql why compile? -> note difference between installing per rpm and compiling -> compile is specific to local hardware -> circumvent the actions of others (security or configuration) -> can custom compile: strip out for lighter binary, or add options that aren't usually available -> latest features -> bug fixes -> advanced development may need a custom install -> custom patches pre-build: -> need gcc (the GNU c compiler) -> `yum install ncurses ncurses-devel gcc gcc-devel gcc-c++ kernel-headers kernel-devel` -> `mkdir /usr/local/src/{apache,php,mysql,phpmyadmin,webmin}` -> set prefix location variable: `export install=/usr/local` //---------------------------------------------------------// //--------- apache ---------// go to current apache configuration, look for /server-status & /server-info perform `rpm -qa | grep httpd` download the source {/usr/local/src/apache} `cd /usr/local/src/apache` unzip: `tar xvzf xyz` `./configure --prefix=$install/httpd/ --enable-rewrite --enable-so [--enable-maintainer-mode]` make (as user) make install note config file: $install/httpd/conf/httpd.conf excellent source of information for building/compiling apache, including modules and customizations: http://www.faqs.org/docs/apache-compile/intro.html //---------------------------------------------------------// //--------- mysql ---------// download the source {/usr/local/src/mysql} `cd /usr/local/src/mysql` unzip: `tar xvzf xyz` `./configure --prefix=$install/mysql `make` `make install` Building MySQL threw a configure error "No curses/termcap library found"... `yum -y install termcap libtermcap libtermcap-devel ncurses ncurses-devel php-ncurses` MySQL has lots of config options, the above is the bare minimum; it's possible to do a lot of path tweaking. //---------------------------------------------------------// //--------- php ---------// download the source {/usr/local/src/php} `cd /usr/local/src/php` unzip: `tar xvzf xyz` yum -y install libxml2-devel `./configure --prefix=$install --with-config-file-path=$install --with-apxs2=$install/bin/apxs --enable-debug {WHAT DOES PHP DEBUGGING DO?} ./configure --prefix=$install/php --with-config-file-path=$install/php --with-apxs2=$install/httpd/bin/apxs --enable-debug “make install” will alter the httpd.conf file. It's important to also add the following: AddType application/x-httpd-php .php (and whatever other files you want parsed) Then copy php.ini-dist from your source folder to $install/php/php.ini