天天看點

centos 5.4 lamp配置

lamp安裝

先下載下傳apache,mysql,php安裝包:

httpd-2.2.15.tar.gz    http://www.apache.org/dist/httpd/httpd-2.2.15.tar.gz

mysql-5.5.2-m2.tar.gzhttp://download.softagency.net/MySQL/Downloads/MySQL-5.5/mysql-5.5.2-m2.tar.gz

php-5.3.2.tar.gz   http://cn.php.net/distributions/php-5.3.2.tar.gz

ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz //php加速程式

http://files.directadmin.com/services/custombuild/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

用yum安裝一些包

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers automake libtool php-imap

======================================================================================================================

tar zxvf httpd-2.2.15.tar.gz

cd httpd-2.2.15

./configure -prefix=/usr/local/webserver/apache -with-ssl -enable-ssl -enable-so -enable-rewrite -disable-cgid -disable-cgi

=============================================================================================================================

tar zxvf mysql-5.5.2-m2.tar.gz

cd mysql-5.5.2-m2

autoreconf --force --install

libtoolize --automake --force

automake --force --add-missing

./configure --prefix=/usr/local/webserver/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=innobase

chmod +w /usr/local/webserver/mysql

chown -R mysql:mysql /usr/local/webserver/mysql

cp support-files/my-medium.cnf /usr/local/webserver/mysql/my.cnf

/usr/local/webserver/mysql/bin/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/usr/local/webserver/mysql/data --user=mysql

/bin/sh /usr/local/webserver/mysql/bin/mysqld_safe --defaults-file=/usr/local/webserver/mysql/my.cnf &

/usr/local/webserver/bin/mysqladmin -u root password '12345'

===========================================================================================================================

http://cn.php.net/distributions/php-5.3.2.tar.gz

http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gz

wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0"

wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?modtime=1194463373&big_mirror=0"

wget http://pecl.php.net/get/memcache-2.2.5.tgz

wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?modtime=1175740843&big_mirror=0"

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.8.tar.gz

wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2

wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

wget http://blog.s135.com/soft/linux/nginx_php/imagick/ImageMagick.tar.gz

wget http://pecl.php.net/get/imagick-2.2.2.tgz

==================================================================================================================================

tar zxvf libiconv-1.13.tar.gz

cd libiconv-1.13/

./configure --prefix=/usr/local

make

make install

cd ../

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8/

./configure

make

make install

/sbin/ldconfig

cd libltdl/

./configure --enable-ltdl-install

make

make install

cd ../../

tar zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9/

./configure

make

make install

cd ../

ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la

ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so

ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4

ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8

ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a

ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la

ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so

ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2

ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8/

/sbin/ldconfig

./configure

make

make install

cd ../

php

========================================================================================================

tar zxvf php-5.3.2.tar.gz

cd php-5.3.2

./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-apxs2=/usr/local/wenserver/apache/bin/apxs --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --enable-ftp --with-gettext --enable-soap --enable-zend-multibyte --with-imap --with-imap-ssl

make ZEND_EXTRA_LIBS='-liconv'

make install

cp php.ini-production /usr/local/webserver/php/etc/php.ini

cd ../

tar zxvf memcache-2.2.5.tgz

cd memcache-2.2.5/

/usr/local/webserver/php/bin/phpize

./configure --with-php-config=/usr/local/webserver/php/bin/php-config

make

make install

cd ../

tar jxvf eaccelerator-0.9.5.3.tar.bz2

cd eaccelerator-0.9.5.3/

/usr/local/webserver/php/bin/phpize

./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config

make

make install

cd ../

tar zxvf PDO_MYSQL-1.0.2.tgz

cd PDO_MYSQL-1.0.2/

/usr/local/webserver/php/bin/phpize

./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-pdo-mysql=/usr/local/webserver/mysql

make

make install

cd ../

tar zxvf ImageMagick.tar.gz

cd ImageMagick-6.5.1-2/

./configure

make

make install

cd ../

tar zxvf imagick-2.2.2.tgz

cd imagick-2.2.2/

/usr/local/webserver/php/bin/phpize

./configure --with-php-config=/usr/local/webserver/php/bin/php-config

make

make install

cd ../

vi httpd.ini

AddType application/x-httpd-php .php

=======================================================================================================================

zend

tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz

cd ZendOptimizer-3.3.9-linux-glibc23-i386

cp data/5_2_x_comp/ZendOptimizer.so /usr/local/webserver/php/include/

修改 php.ini 在末尾添加以下内容

[zend]

zend_optimizer.optimization_level=15

zend_extension="/usr/local/webserver/php/include/ZendOptimizer.so"

=======================================================================================================================

配置php.ini

short_open_tag = Off

enable_dl = Off

display_errors = Off

magic_quotes_gpc = Off

asp_tags = Off

register_globals = Off

magic_quotes_runtime =off

register_argc_argv = Off

改成

short_open_tag = On

enable_dl = On

display_errors = On

magic_quotes_gpc = On

asp_tags = On

register_globals = On

magic_quotes_runtime =On

register_argc_argv = On

繼續閱讀