Archive for the ‘Apache’ Category
Benchmarking of MySQL Persistent Connections vs Non-Persistent Connections
Posted by Robert Swarthout | Filed under Apache, Benchmarking, PHP
This post will be about the what always seems to be a hot topic among PHPers about what connection type to use when connection to a MySQL database.
I used MySQL 5.0.45, PHP 5.2.4 for this benchmarking. You can download the same sample MySQL database that is used for this set of benchmarking by visiting http://dev.mysql.com/doc/#sampledb. In the list of example databases, choose the one named ’sakila’.
For each connection type I will run three tests to see compensate for variations in tests. I will be using http_load to do the benchmarking of the connection file. To view each of the connection files, download the file bundle at the end of this post.
Below is the benchmark command with the options used for each run.
./http_load -verbose -parallel 20 -seconds 600 urls.txt
The urls.txt file contains the following:
http://127.0.0.1/mysql_connection_bench_{CONNECT_TYPE}.php
Between each benchmark run I will restart both Apache and MySQL.
Results for the standard MySQL functions in PHP using mysql_connect.
Run #1:
11024 fetches, 20 max parallel, 44096 bytes, in 600.007 seconds
4 mean bytes/connection
18.3731 fetches/sec, 73.4925 bytes/sec
msecs/connect: 0.22087 mean, 48.992 max, 0.03 min
msecs/first-response: 1087.74 mean, 2880.95 max, 355.012 min
HTTP response codes: code 200 — 11024
Run #2:
10895 fetches, 20 max parallel, 43580 bytes, in 600.004 seconds
4 mean bytes/connection
18.1582 fetches/sec, 72.6328 bytes/sec
msecs/connect: 0.219867 mean, 48.58 max, 0.031 min
msecs/first-response: 1100.1 mean, 2623.47 max, 369.341 min
HTTP response codes: code 200 — 10895
Run #3:
11134 fetches, 20 max parallel, 44536 bytes, in 600.003 seconds
4 mean bytes/connection
18.5566 fetches/sec, 74.2264 bytes/sec
msecs/connect: 0.217796 mean, 42.036 max, 0.03 min
msecs/first-response: 1076.59 mean, 3079.73 max, 270.734 min
HTTP response codes: code 200 — 11134
Results for the standard MySQL functions in PHP using mysql_pconnect.
Run #1:
10982 fetches, 20 max parallel, 43928 bytes, in 600.025 seconds
4 mean bytes/connection
18.3026 fetches/sec, 73.2103 bytes/sec
msecs/connect: 0.216663 mean, 69.795 max, 0 min
msecs/first-response: 1091.52 mean, 3166.82 max, 254.36 min
HTTP response codes: code 200 — 10982
Run #2:
11002 fetches, 20 max parallel, 44008 bytes, in 600.001 seconds
4 mean bytes/connection
18.3366 fetches/sec, 73.3465 bytes/sec
msecs/connect: 0.20555 mean, 47.176 max, 0.031 min
msecs/first-response: 1089.51 mean, 2953.82 max, 414.826 min
HTTP response codes: code 200 — 11002
Run #3:
11196 fetches, 20 max parallel, 44784 bytes, in 600 seconds
4 mean bytes/connection
18.66 fetches/sec, 74.6399 bytes/sec
msecs/connect: 0.2013 mean, 22.478 max, 0.03 min
msecs/first-response: 1070.5 mean, 2506.02 max, 448.161 min
HTTP response codes: code 200 — 11196
Results for non-persistent connections with PDO_MYSQL.
Run #1:
10995 fetches, 20 max parallel, 43980 bytes, in 600.008 seconds
4 mean bytes/connection
18.3248 fetches/sec, 73.299 bytes/sec
msecs/connect: 0.203731 mean, 17.309 max, 0.029 min
msecs/first-response: 1090.44 mean, 2852.34 max, 358.45 min
HTTP response codes: code 200 — 10995
Run #2:
10971 fetches, 20 max parallel, 43884 bytes, in 600.002 seconds
4 mean bytes/connection
18.285 fetches/sec, 73.1398 bytes/sec
msecs/connect: 0.21357 mean, 32.036 max, 0 min
msecs/first-response: 1092.36 mean, 3515.71 max, 456.688 min
HTTP response codes: code 200 — 10971
Run #3:
11161 fetches, 20 max parallel, 44644 bytes, in 600.001 seconds
4 mean bytes/connection
18.6016 fetches/sec, 74.4065 bytes/sec
msecs/connect: 0.20571 mean, 31.679 max, 0.031 min
msecs/first-response: 1073.96 mean, 2539.06 max, 351.236 min
HTTP response codes: code 200 — 11161
Results for persistent connections with PDO_MYSQL.
Run #1:
10347 fetches, 20 max parallel, 41388 bytes, in 600.006 seconds
4 mean bytes/connection
17.2448 fetches/sec, 68.9793 bytes/sec
msecs/connect: 0.253049 mean, 96.354 max, 0 min
msecs/first-response: 1158.52 mean, 2596.78 max, 282.647 min
HTTP response codes: code 200 — 10347
Run #2:
11106 fetches, 20 max parallel, 44424 bytes, in 600.008 seconds
4 mean bytes/connection
18.5098 fetches/sec, 74.0391 bytes/sec
msecs/connect: 0.226898 mean, 51.29 max, 0.03 min
msecs/first-response: 1079.29 mean, 2393.4 max, 311.85 min
HTTP response codes: code 200 — 11106
Run #3:
10978 fetches, 20 max parallel, 43912 bytes, in 600.029 seconds
4 mean bytes/connection
18.2958 fetches/sec, 73.1831 bytes/sec
msecs/connect: 0.210895 mean, 30.339 max, 0 min
msecs/first-response: 1091.98 mean, 3455.6 max, 373.751 min
HTTP response codes: code 200 — 10978
Results Analysis
- mysql_connect
- Average requests per second: 18.3626
- Average requests completed: 11,017
- mysql_pconnect
- Average requests per second: 18.4330
- Average requests completed: 11,060
- PDO_MySQL non-persistent
- Average requests per second: 18.4038
- Average requests completed: 11,042
- PDO_MySQL persistent
- Average requests per second: 18.0168
- Average requests completed: 10,810
Basically what the numbers above shows us is that in an isolated environment it makes no difference which connection type you are going to use. My past experience in live heavily trafficked environment says that using non-persistent connections is better than using persistent connections. Where this difference comes shows itself the most is when an apache thread will hang and still hold the persistent connection to mysql preventing other apache processes from connecting. By tweaking your apache and mysql settings you can achieve very good performance with non-persistent connections.
Source files for this benchmarking test.
PHP Subversion Frontend - Part 1
Posted by Robert Swarthout | Filed under Apache, PHP, Subversion
I am going to begin the process of explaining how to setup a PHP frontend to a remote subversion (SVN) working copy. The post today will talk about how to correctly setup apache to work in a multi-user setup.
One of the the nice things about SVN is that it keeps track of who changes what line and what changes they made on that line. SVN bases the username it stores on who committed the file. The trick in getting a PHP frontend to SVN to work correctly is that the user that apache is running as needs to be the user who is performing the commit action. To do this and make it work in a multiple user environment I have setup apache to proxy through requests to a specific URL to another instance of apache running as the needed user. In this setup you will need to have mod_proxy either loaded or compiled into your apache setup.
For example a request sent to http://rswarthout.svn.dummydomain.com would be routed through a proxy in apache to another instance of apache at http://127.0.0.1:8001. This internal address will handle the apache requests and pass it back to the web facing apache server instance.
The apache virtual host config below is for the web facing apache instance:
<VirtualHost 12.34.56.78:80>
ServerName rswarthout.svn.dummydomain.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8001/
ProxyPassReverse / http://127.0.0.1:8001/
<VirtualHost>
You will need to start a seperate instance of apache and pass it the config file to run. The config file below will start apache and have it listen on IP 127.0.0.1 only on port 8001.
Listen 127.0.0.1:8001
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .phpDocumentRoot “/home/svn.dummydomain.com/public_html”
<Directory “/home/svn.dummydomain.com/public_html”>
Options -Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>User rswarthout
Group rswarthoutDirectoryIndex index.php index.html
php_admin_value include_path “.:/home/svn.dummydomain.com/:/usr/share/pear”
In the above apache config you will see that I am setting the include path for PHP as well in the last line. This is not a requirement but it is good practice to only have files accessible through apache that need to be. To start a seperate instance of apache with the above config run the following command.
/path/to/apache/httpd -f /path/to/above/config/file.conf
That is all for this piece of the puzzle. Next time I will begin to explain the PHP side of the puzzle. When this puzzle is broken up into its smaller pieces it is quite easy to work through.
IE 6, Apache mod_deflate, blank pages…
Posted by Robert Swarthout | Filed under Apache, IE
I just ran across an interesting bug in IE 6 when a page is loading an external javascript file. If Apache is outputting the external javascript compressed (gzip) IE will do one of the following things:
- Return a blank page
- Try loading the page forever
Prior to finding this bug, our apache settings for mod_deflate looked like…
AddOutputFilterByType DEFLATE text/html text/css text/xml text/plain application/x-javascript
Now it looks like…
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.[0678] no-gzip
BrowserMatch \bMSIE\s7Â !no-gzip !gzip-only-text/html
Making these changes seemed to have fixed the issue. Now when a page is loaded in IE6, any external javascript file will not be gzipped and their page load will be slower. I suppose that is punishment for not upgrading to IE7 or getting Firefox.
PHP frontend to Subversion (SVN)
Posted by Robert Swarthout | Filed under Apache, PHP, Subversion
So over the last week I have been working on and off with a PHP frontend to SVN. The frontend needed to be designed in such a way that each developer could access their working copies and make the full range of actions against them. I decided to also use an AJAX setup so that pages would be quickly loaded and updated by a single toggle of a folder. The first issue that I had to deal with was when a SVN command was issues it needed to be issued as the owner of the code so that SVN could track edits correctly. After googling around for a bit I quickly realized that there was not a viable Apache MPM that would serve virtual hosts under different users and groups. Then the light bulb flipped on, setup a proxy and redirect requests to developer.dev.domain.com to its own instance of apache running as the user and group ‘developer’. This would ensure that all SVN commands would run as ‘developer’ when executed. I then moved onto setting up the interface. The features that are working at this time are:
- create working copy from repository (svn checkout)
- delete working copy
- svn add
- svn blame
- svn commit
- svn copy
- svn delete
- svn diff
- svn move
- svn propset
- search files (via a grep/find combination, omitting .svn folders)
- svn log
- svn rename
- svn status
- update local working copy
- update stage environment
- publish stage environment
A few things that I learned while working with doing the SVN commands was that when executing a command via the php function exec() I need to add the flag –config-dir=$USER_HOME_DIR/.subversion (or where ever the users .subversion folder is located). Also if a command does not seem to be executing correctly you can add “2>&1″ without quotations to the command being run and it will return any error messages through the $ouput variable for exec();
Install of Apache 2.2.3, MySQL 5.0.18 and PHP 5.2.0
Posted by Robert Swarthout | Filed under Apache, Fedora, MySQL, PHP
After getting our new servers delivered I came to the conclusion very quickly that I would like a way to easily get the same configurations on every box without having to spend the rest of my life doing so. Each box needed to have Apache, MySQL and PHP installed and configured. I decided to write a bash script to do this for me. In the end I am very happy with the way that the script works. It leaves very little work to be done once the script is done running. In the end I have two scripts, one is for a 32bit machine and one is for 64bit machines. Below is the 64bit script. The install will compile PHP with all of the supported modules that we need. The only thing that needs to be done with PHP is the setting the correct config options in the php.ini, this includes putting in APC cache extension.
#!/bin/sh
# Abort on any errors
set -e# Where do you want all this stuff built?
SRCDIR=/home/support/software/source# Unpack our large file that contains all needed packages that are not going to be obtained from yum
#rm -Rf ${SRCDIR}
#gzip -d nbs_core_install.gz
#cd nbs_core_install/
#cp -R * ${SRCDIR}/# Install gcc
yum -y install gcc# Install cc
yum -y install cc# Install libtool
yum -y install libtool# Extract OpenSSH and install openssh and the sshd in the init.d
cd ${SRCDIR}
tar xzf ${SRCDIR}/openssh-4.5p1.tar.gz
cd ${SRCDIR}/openssh-4.5p1
./configure
make
make install
cp -f ${SRCDIR}/sshd.init.d /etc/rc.d/init.d/sshd
chmod 755 /etc/rc.d/init.d/sshd
rm -f /etc/rc.d/rc3.d/S70sshd
cd /etc/rc.d/rc3.d && ln -s /etc/rc.d/init.d/sshd S70sshd
rm -Rf ${SRCDIR}/openssh-4.5p1# Install libjpeg-devel
yum -y install libjpeg-devel# Install jpeg.v6b
cd ${SRCDIR}
tar xzf ${SRCDIR}/jpegsrc.v6b.tar.gz
cd ${SRCDIR}/jpeg-6b
cp /usr/share/libtool/config.guess ./
cp /usr/share/libtool/config.sub ./
./configure –enable-shared
make libdir=/usr/lib64
install -d /usr/local/man/man1
make libdir=/usr/lib64 install
rm -Rf ${SRCDIR}/jpeg-6b# Install libtiff & libtiff-devel
yum -y install libtiff libtiff-devel# Install Ghostscript (needed for ImageMagick)
yum -y install ghostscript# Install ImageMagick
yum -y install ImageMagick# Install libxml2
cd ${SRCDIR}
tar xzf ${SRCDIR}/libxml2-2.6.27.tar.gz
cd ${SRCDIR}/libxml2-2.6.27
./configure –enable-shared
make
make install
make tests
rm -Rf ${SRCDIR}/libxml2-2.6.27# Install libxslt
cd ${SRCDIR}
tar xzf ${SRCDIR}/libxslt-1.1.19.tar.gz
cd ${SRCDIR}/libxslt-1.1.19
./configure –prefix=/usr
make
make install
rm -Rf ${SRCDIR}/libxslt-1.1.19# Install zlib
cd ${SRCDIR}
tar xzf ${SRCDIR}/zlib-1.2.3.tar.gz
cd ${SRCDIR}/zlib-1.2.3
./configure –shared –prefix=/usr
make
make install
rm -Rf ${SRCDIR}/zlib-1.2.3# Install libmcrypt
cd ${SRCDIR}
tar xzf ${SRCDIR}/libmcrypt-2.5.7.tar.gz
cd ${SRCDIR}/libmcrypt-2.5.7
./configure –disable-posix-threads –prefix=/usr
make
make install# Install libmcrypt lltdl
cd ${SRCDIR}/libmcrypt-2.5.7/libltdl
./configure –prefix=/usr –enable-ltdl-install
make
make install
rm -Rf ${SRCDIR}/libmcrypt-2.5.7# Install mhash
cd ${SRCDIR}
tar xzf ${SRCDIR}/mhash-0.9.7.1.tar.gz
cd ${SRCDIR}/mhash-0.9.7.1
./configure –prefix=/usr
make
make install
rm -Rf ${SRCDIR}/mhash-0.9.7.1# Install Freetype
cd ${SRCDIR}
tar xzf ${SRCDIR}/freetype-2.2.1.tar.gz
cd ${SRCDIR}/freetype-2.2.1
./configure
make
make install
rm -Rf ${SRCDIR}/freetype-2.2.1# Install libidn
cd ${SRCDIR}
tar xzf ${SRCDIR}/libidn-0.6.9.tar.gz
cd ${SRCDIR}/libidn-0.6.9
./configure –with-iconv-prefix=/usr –prefix=/usr
make
make install
rm -Rf ${SRCDIR}/libidn-0.6.9# Install OpenSSL
cd ${SRCDIR}
tar xzf ${SRCDIR}/openssl-0.9.8d.tar.gz
cd ${SRCDIR}/openssl-0.9.8d
./config
make
make test
make install
rm -Rf ${SRCDIR}/openssl-0.9.8d# Install cURL
cd ${SRCDIR}
tar xzf ${SRCDIR}/curl-7.15.0.tar.gz
cd ${SRCDIR}/curl-7.15.0
./configure –enable-ipv6 –enable-cookies –enable-crypto-auth –prefix=/usr
make
make install
rm -Rf ${SRCDIR}/curl-7.15.0# Install c-client (IMAP)
cd ${SRCDIR}
tar xzf ${SRCDIR}/imap-2004g.tar.Z
cd ${SRCDIR}/imap-2004g
make lrh
cp c-client/c-client.a /usr/lib/libc-client.a
cp c-client/*.h /usr/include
rm -Rf ${SRCDIR}/imap-2004g# Install Apache
cd ${SRCDIR}
tar xzf ${SRCDIR}/httpd-2.2.3.tar.gz
cd ${SRCDIR}/httpd-2.2.3
./configure –enable-rewrite –enable-ssl –enable-deflate –enable-so –enable-proxy –prefix=/usr/local/apache2
make
make install
rm -Rf ${SRCDIR}/httpd-2.2.3# Install httpd init.d file
cd ${SRCDIR}
rm -f /etc/rc.d/init.d/httpd
cp httpd.init.d /etc/rc.d/init.d/httpd
chmod 755 /etc/rc.d/init.d/httpd
rm -f /etc/rc.d/rc3.d/K*httpd
rm -f /etc/rc.d/rc3.d/S*httpd
cd /etc/rc.d/rc3.d && ln -s /etc/rc.d/init.d/httpd F15sshd# Install libpng
cd ${SRCDIR}
tar xzf ${SRCDIR}/libpng-1.2.15.tar.gz
cd ${SRCDIR}/libpng-1.2.15
./configure
make
make install
rm -Rf ${SRCDIR}/libpng-1.2.15# Install MySQL
yum -y install perl-DBI
cd ${SRCDIR}
rpm -i MySQL-server-standard-5.0.18-0.rhel4.x86_64.rpm
rpm -i MySQL-client-standard-5.0.18-0.rhel4.x86_64.rpm
rpm -i MySQL-devel-standard-5.0.18-0.rhel4.x86_64.rpm
rpm -i MySQL-shared-standard-5.0.18-0.rhel4.x86_64.rpm
rpm -i MySQL-standard-debuginfo-5.0.18-0.rhel4.x86_64.rpm
ln -s /usr/lib64/mysql/libmysqlclient.a /usr/lib/libmysqlclient.a# Install Flex
yum -y install flex# Install libdv
yum -y install libdv# Install re2c needed for php pfro compile
cd ${SRCDIR}
tar zxf ${SRCDIR}/re2c-0.11.0.tar.gz
cd ${SRCDIR}/re2c-0.11.0
./configure
make
make install# Install PHP
cd ${SRCDIR}
tar xzf ${SRCDIR}/php-5.2.0.tar.gz
cd ${SRCDIR}/php-5.2.0
./configure ‘–prefix=/usr’ ‘–exec-prefix=/usr’ ‘–bindir=/usr/bin’ ‘–sbindir=/usr/sbin’ ‘–sysconfdir=/etc’ ‘–datadir=/usr/share’ ‘–includedir=/usr/include’ ‘–libdir=/usr/lib64′ ‘–libexecdir=/usr/libexec’ ‘–localstatedir=/var’ ‘–sharedstatedir=/usr/com’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–with-mcrypt=/usr’ ‘–with-config-file-path=/etc’ ‘–with-bz2′ ‘–with-curl’ ‘–with-curl-ssl’ ‘–with-exec-dir=/usr/bin’ ‘–with-freetype-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-gd’ ‘–with-ttf’ ‘–with-gdbm’ ‘–with-gettext’ ‘–with-ncurses’ ‘–with-gmp’ ‘–with-iconv’ ‘–with-jpeg’ ‘–with-openssl’ ‘–with-png’ ‘–with-regex=system’ ‘–with-xsl=/usr’ ‘–with-expat-dir=/usr’ ‘–with-zlib’ ‘–with-layout=GNU’ ‘–with-kerberos=/usr/kerberos’ ‘–with-apxs2=/usr/local/apache2/bin/apxs’ ‘–without-oci8′ ‘–enable-inline-optimization’ ‘–enable-gd-native-ttf’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-sockets’ ‘–enable-trans-sid’ ‘–enable-memory-limit’ ‘–disable-rpath’ ‘–disable-debug’ ‘–with-mysql=/usr/local/mysql’ ‘–with-mysqli=/usr/bin/mysql_config’
make
make install
cp php.ini-dist /etc/php.ini
rm -Rf ${SRCDIR}/php-5.2.0# Install Memcache PHP Extension
cd ${SRCDIR}
tar xzf ${SRCDIR}/memcache-2.1.0.tgz
cd ${SRCDIR}/memcache-2.1.0
phpize
./configure
make
mkdir /usr/local/phpextensions/
cp ${SRCDIR}/memcache-2.1.0/modules/memcache.so /usr/local/phpextensions/
rm -Rf ${SRCDIR}/memcache-2.1.0# Install APC (php cache)
cd ${SRCDIR}
tar xzf ${SRCDIR}/APC-3.0.12p2.tgz
cd ${SRCDIR}/APC-3.0.12p2
phpize
./configure –enable-apc-mmap=yes –with-apxs2=/usr/local/apache2/bin/apxs
make
cd ${SRCDIR}/APC-3.0.12p2/modules/
cp apc.so /usr/local/phpextensions# Install libevent-devel
yum -y install libevent-devel# Install Memcache Daemon
cd ${SRCDIR}
tar xzf ${SRCDIR}/memcached-1.2.1.tar.gz
cd ${SRCDIR}/memcached-1.2.1
./configure
make
make install
rm -Rf ${SRCDIR}/memcached-1.2.1# Install BRUTIS
cd ${SRCDIR}
cp monitor.php /home/support/
chmod 700 /home/support/monitor.php
cp ${SRCDIR}/crontab_root /var/spool/cron/root# Install perl-Net-SSLeay
yum -y install perl-Net-SSLeay# Install Webmin
cd ${SRCDIR}
rpm -U webmin-1.310-1.noarch.rpmecho
echo
echo ———- INSTALL COMPLETE! ———-
echo
echo
And here is the 32bit script.
#!/bin/sh
# Abort on any errors
set -e# Where do you want all this stuff built?
SRCDIR=/home/support/software/source# Install gcc
yum -y install gcc# Install libtool
yum -y install libtool# Extract OpenSSH and install openssh and the sshd in the init.d
cd ${SRCDIR}
tar xzf ${SRCDIR}/openssh-4.5p1.tar.gz
cd ${SRCDIR}/openssh-4.5p1
./configure
make
make install
cp -f ${SRCDIR}/sshd.init.d /etc/rc.d/init.d/sshd
chmod 755 /etc/rc.d/init.d/sshd
rm -f /etc/rc.d/rc3.d/S70sshd
cd /etc/rc.d/rc3.d && ln -s /etc/rc.d/init.d/sshd S70sshd
rm -Rf ${SRCDIR}/openssh-4.5p1# Install libjpeg-devel
yum -y install libjpeg-devel# Install jpeg.v6b
cd ${SRCDIR}
tar xzf ${SRCDIR}/jpegsrc.v6b.tar.gz
cd ${SRCDIR}/jpeg-6b
cp /usr/share/libtool/config.guess ./
cp /usr/share/libtool/config.sub ./
./configure –enable-shared
make
install -d /usr/local/man/man1
make install
rm -Rf ${SRCDIR}/jpeg-6b# Install libtiff & libtiff-devel
yum -y install libtiff libtiff-devel# Install Ghostscript (needed for ImageMagick)
yum -y install ghostscript# Install ImageMagick
yum -y install ImageMagick# Install libxml2
cd ${SRCDIR}
tar xzf ${SRCDIR}/libxml2-2.6.27.tar.gz
cd ${SRCDIR}/libxml2-2.6.27
./configure –enable-shared
make
make install
make tests
rm -Rf ${SRCDIR}/libxml2-2.6.27# Install libxslt
cd ${SRCDIR}
tar xzf ${SRCDIR}/libxslt-1.1.19.tar.gz
cd ${SRCDIR}/libxslt-1.1.19
./configure –prefix=/usr
make
make install
rm -Rf ${SRCDIR}/libxslt-1.1.19# Install libmcrypt
cd ${SRCDIR}
tar xzf ${SRCDIR}/libmcrypt-2.5.7.tar.gz
cd ${SRCDIR}/libmcrypt-2.5.7
./configure –prefix=/usr
make
make install# Install Freetype
cd ${SRCDIR}
tar xzf ${SRCDIR}/freetype-2.2.1.tar.gz
cd ${SRCDIR}/freetype-2.2.1
./configure
make
make install
rm -Rf ${SRCDIR}/freetype-2.2.1# Install OpenSSL
cd ${SRCDIR}
tar xzf ${SRCDIR}/openssl-0.9.8d.tar.gz
cd ${SRCDIR}/openssl-0.9.8d
./config
make
make test
make install
rm -Rf ${SRCDIR}/openssl-0.9.8d# Install cURL
cd ${SRCDIR}
tar xzf ${SRCDIR}/curl-7.15.0.tar.gz
cd ${SRCDIR}/curl-7.15.0
./configure –enable-ipv6 –enable-cookies –enable-crypto-auth –prefix=/usr
make
make install
rm -Rf ${SRCDIR}/curl-7.15.0# Install c-client (IMAP)
cd ${SRCDIR}
tar xzf ${SRCDIR}/imap-2004g.tar.Z
cd ${SRCDIR}/imap-2004g
make lrh
cp c-client/c-client.a /usr/lib/libc-client.a
cp c-client/*.h /usr/include
rm -Rf ${SRCDIR}/imap-2004g# Install Apache
cd ${SRCDIR}
tar xzf ${SRCDIR}/httpd-2.2.3.tar.gz
cd ${SRCDIR}/httpd-2.2.3
./configure –enable-rewrite –enable-ssl –enable-deflate –enable-so –enable-proxy –prefix=/usr/local/apache2
make
make install
rm -Rf ${SRCDIR}/httpd-2.2.3# Install httpd init.d file
cd ${SRCDIR}
rm -f /etc/rc.d/init.d/httpd
cp httpd.init.d /etc/rc.d/init.d/httpd
chmod 755 /etc/rc.d/init.d/httpd
rm -f /etc/rc.d/rc3.d/K*httpd
rm -f /etc/rc.d/rc3.d/S*httpd
cd /etc/rc.d/rc3.d && ln -s /etc/rc.d/init.d/httpd F15sshd# Install libpng
cd ${SRCDIR}
tar xzf ${SRCDIR}/libpng-1.2.15.tar.gz
cd ${SRCDIR}/libpng-1.2.15
./configure
make
make install
rm -Rf ${SRCDIR}/libpng-1.2.15# Install MySQL
yum -y install perl-DBI
cd ${SRCDIR}
rpm -i MySQL-server-standard-5.0.18-0.rhel3.i386.rpm
rpm -i MySQL-client-standard-5.0.18-0.rhel3.i386.rpm
rpm -i MySQL-devel-standard-5.0.18-0.rhel3.i386.rpm
rpm -i MySQL-shared-standard-5.0.18-0.rhel3.i386.rpm# Install Flex
yum -y install flex# Install libdv
yum -y install libdv# Install PHP
cd ${SRCDIR}
tar xzf ${SRCDIR}/php-5.2.0.tar.gz
cd ${SRCDIR}/php-5.2.0
./configure ‘–prefix=/usr’ ‘–exec-prefix=/usr’ ‘–bindir=/usr/bin’ ‘–sbindir=/usr/sbin’ ‘–sysconfdir=/etc’ ‘–datadir=/usr/share’ ‘–includedir=/usr/include’ ‘–libdir=/usr/lib64′ ‘–libexecdir=/usr/libexec’ ‘–localstatedir=/var’ ‘–sharedstatedir=/usr/com’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–with-mcrypt=/usr’ ‘–with-config-file-path=/etc’ ‘–with-bz2′ ‘–with-curl’ ‘–with-curl-ssl’ ‘–with-exec-dir=/usr/bin’ ‘–with-freetype-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-gd’ ‘–with-ttf’ ‘–with-gdbm’ ‘–with-gettext’ ‘–with-ncurses’ ‘–with-gmp’ ‘–with-iconv’ ‘–with-jpeg’ ‘–with-openssl’ ‘–with-png’ ‘–with-regex=system’ ‘–with-xsl=/usr’ ‘–with-expat-dir=/usr’ ‘–with-zlib’ ‘–with-layout=GNU’ ‘–with-kerberos=/usr/kerberos’ ‘–with-apxs2=/usr/local/apache2/bin/apxs’ ‘–without-oci8′ ‘–enable-inline-optimization’ ‘–enable-gd-native-ttf’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-sockets’ ‘–enable-trans-sid’ ‘–enable-memory-limit’ ‘–disable-rpath’ ‘–disable-debug’ ‘–with-mysql=/usr/local/mysql’ ‘–with-mysqli=/usr/bin/mysql_config’
make
make install
cp php.ini-dist /etc/php.ini
rm -Rf ${SRCDIR}/php-5.2.0# Install Memcache PHP Extension
cd ${SRCDIR}
tar xzf ${SRCDIR}/memcache-2.1.0.tgz
cd ${SRCDIR}/memcache-2.1.0
phpize
./configure
make
mkdir /usr/local/phpextensions/
cp ${SRCDIR}/memcache-2.1.0/modules/memcache.so /usr/local/phpextensions/
rm -Rf ${SRCDIR}/memcache-2.1.0# Install APC (php cache)
cd ${SRCDIR}
tar xzf ${SRCDIR}/APC-3.0.12p2.tgz
cd ${SRCDIR}/APC-3.0.12p2
phpize
./configure –enable-apc-mmap=yes –with-apxs2=/usr/local/apache2/bin/apxs
make
cd ${SRCDIR}/APC-3.0.12p2/modules/
cp apc.so /usr/local/phpextensions# Install libevent-devel
yum -y install libevent-devel# Install Memcache Daemon
cd ${SRCDIR}
tar xzf ${SRCDIR}/memcached-1.2.1.tar.gz
cd ${SRCDIR}/memcached-1.2.1
./configure
make
make install
rm -Rf ${SRCDIR}/memcached-1.2.1# Install BRUTIS
cd ${SRCDIR}
cp monitor.php /home/support/
chmod 700 /home/support/monitor.php
cp ${SRCDIR}/crontab_root /var/spool/cron/root# Install perl-Net-SSLeay
yum -y install perl-Net-SSLeay# Install Webmin
cd ${SRCDIR}
rpm -U webmin-1.310-1.noarch.rpmecho
echo
echo ———- INSTALL COMPLETE! ———-
echo
echo