apache2.2.6+php5.2.9+mysql5.1.34编译安装

Standard
rpm -ivh gettext-devel-0.14.1-13.x86_64.rpm
 
# zlib
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local/zlib
make
make install
cd ..
 
# openssl
tar -zxvf openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config \
	--prefix=/usr/local/openssl \
	--openssldir=/usr/local/openssl \
	--with-zlib-lib=/usr/local/zlib/lib \
	--with-zlib-include=/usr/local/zlib/include \
	shared \
	zlib \
	threads 
make
make test
make install
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf.d/openssl.conf
ldconfig
cd ..
 
# http
tar jxvf httpd-2.2.6.tar.bz2
cd httpd-2.2.6
./configure \
	--prefix=/usr/local/apache \
	--enable-track-vars \
	--enable-rewrite \
	--enable-proxy \
	--enable-proxy-http  \
	--enable-cache \
	--enable-disk-cache \
	--enable-mem-cache \
	--enable-so \
	--enable-ssl \
	--enable-mods-shared="cache disk_cache mem_cache" \
	--enable-rewrite=shared \
	--enable-proxy=shared \
	--enable-proxy-http=shared \
	--with-mpm=worker \
	--sysconfdir=/usr/local/apache/conf \
	--with-ssl=/usr/local/openssl \
	--with-z-dir=/usr/local/zlib \
	--with-perl 
make 
make install
cd ..
 
# DirectoryIndex index.php
# AddType application/x-httpd-php .php
# LoadModule php5_module        modules/libphp5.so
 
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
chmod +x /etc/init.d/httpd
 
# icon
tar zxvf libiconv-1.12.tar.gz
cd libiconv-1.12
./configure --prefix=/usr/local/iconv
make
make install
cd ..
 
# libpng
tar jxvf libpng-1.2.23.tar.bz2   
cd libpng-1.2.23
env \
	CPPFLAGS="-I/usr/local/zlib/include" \
	LDFLAGS="-L/usr/local/zlib/lib" \
	./configure \
	--prefix=/usr/local/libpng
make
make check 
make install
cd ..
 
# freetype
tar jxvf freetype-2.3.5.tar.bz2 
cd freetype-2.3.5
env \
	CPPFLAGS="-I/usr/local/zlib/include" \
	LDFLAGS="-L/usr/local/zlib/lib" \
	./configure \
	--prefix=/usr/local/freetype2
make
make install
cd ..
 
# jpeg
mkdir -p \
	/usr/local/jpeg6/bin \
	/usr/local/jpeg6/lib \
	/usr/local/jpeg6/include \
	/usr/local/jpeg6/man1 \
	/usr/local/jpeg6/man/man1 
 
tar zxvf jpegsrc.v6b.tar.gz    
cd jpeg-6b
./configure \
	--prefix=/usr/local/jpeg6 \
	--enable-shared --enable-static
make
make install-lib  
make install
cd ..
 
# libxml
tar -zxf libxml2-2.6.30.tar.gz
cd libxml2-2.6.30
./configure \
	--prefix=/usr/local/libxml2 \
	--with-zlib=/usr/local/zlib
make
make install
cd ..
 
# gd
tar -jvxf gd-2.0.35.tar.bz2
cd gd-2.0.35 
./configure \
	--prefix=/usr/local/gd2 \
	--with-freetype=/usr/local/freetype2 \
	--with-png=/usr/local/libpng \
	--with-jpeg=/usr/local/jpeg6 \
	CPPFLAGS="-I/usr/local/zlib/include" \
	LDFLAGS="-L/usr/local/zlib/lib"
make
make install 
cd ..
 
#mysql
groupadd mysql
useradd -g mysql mysql
tar zxvf mysql-5.1.34.tar.gz
cd mysql-5.1.34
./configure \
	--prefix=/usr/local/mysql \
	--enable-assembler \
	--without-debug \
	--with-mysqld-ldflags=-all-static \
	--with-charset=utf8 \
	--with-extra-charsets=all \
	--with-innodb \
	--with-unix-socket-path=/usr/local/mysql/mysql.sock \
	--enable-thread-safe-client \
	--with-mysqld-user=mysql
make
make install
 
cd ..
if [ -f my.cnf.slave ]; then mv my.cnf.slave /etc/my.cnf; else mv my.cnf.mast /etc/my.cnf; fi; mkdir -p /data/mysqllog/binlog /data/mysqllog/relaylog ; chown mysql.0 /data/mysqllog/binlog /data/mysqllog/relaylog  /usr/local/mysql; cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld ; /usr/local/mysql/bin/mysql_install_db --user=mysql; /etc/init.d/mysqld start
 
# php
tar zxvf php-5.2.9.tar.gz
cd php-5.2.9
./configure \
	--prefix=/usr/local/php \
	--with-zlib=/usr/local/zlib \
	--with-zlib-dir=/usr/local/zlib \
	--with-apxs2=/usr/local/apache/bin/apxs \
	--with-mysql=/usr/local/mysql \
	--with-mysql-sock=/usr/local/mysql \
	--with-pdo-mysql=/usr/local/mysql \
	--with-libxml-dir=/usr/local/libxml2 \
	--with-gd=/usr/local/gd2 \
	--with-jpeg-dir=/usr/local/jpeg6 \
	--with-png-dir=/usr/local/libpng \
	--with-freetype-dir=/usr/local/freetype2 \
	--with-libxml-dir=/usr/local/libxml2 \
	--with-openssl=/usr/local/openssl \
	--with-iconv-dir=/usr/local/iconv \
	--with-ttf \
	--with-gettext \
	--enable-gd-native-ttf \
	--enable-mbstring \
	--enable-xml \
	--enable-pcntl \
	--enable-sockets \
	--enable-zip \
	--with-bz2 \
	--disable-debug 
make
make install
cp php.ini-dist /usr/local/php/lib/php.ini 
cd ..
 
# memcache
tar zxvf memcache-2.2.1.tgz
cd memcache-2.2.1
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-memcach
make 
make install
cd ..
 
sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20060613/"\n\nextension = "memcache.so"\n#' /usr/local/php/lib/php.ini
sed -i 's#expose_php = On#expose_php = Off#' /usr/local/php/lib/php.ini
 
# soap
cd php-5.2.9/ext/soap
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-soap
make
make install
cd
 
sed -i 's#extension = "memcache.so"#extension = "memcache.so"\nextension = "soap.so"#' /usr/local/php/lib/php.ini

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.