最新lamp搭建 mysql5.5-php5.3-http2.2

时间:2022-02-01 20:34:15

#yum install
yum -y install make apr* autoconf automake gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel gd  kernel keyutils  patch  perl kernel-headers compat* mpfr cpp glibc libgomp libstdc++-devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype libjpeg* libpng* php-common php-gd ncurses* libtool* libxml2 libxml2-devel patch

##httpd install
tar zxf httpd-2.2.22.tar.gz 
cd httpd-2.2.22
./configure \
--prefix=/application/httpd2.2.22 \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--enable-so \
--with-mpm=worker \
--enable-rewrite 
make && make install
ln -s /application/httpd2.2.22 /application/httpd
ll /application/
/application/httpd/bin/apachectl start
cd /home/wan/tools

#mysql install
###编译安装cmake###
yum install ncurses-devel -y
tar zxf cmake-2.8.3.tar.gz
cd cmake-2.8.3
 ./configure
gmake
gmake install
cd ..

####编译安装mysql####
groupadd mysql
useradd -s /sbin/nologin -g mysql mysql -M
tar zxf mysql-5.5.32.tar.gz 
cd mysql-5.5.32
-DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/mysql/mysql -DCOMMUNITY_BUILD:BOOL=ON -DENABLED_PROFILING:BOOL=ON -DENABLE_DEBUG_SYNC:BOOL=OFF -DINSTALL_LAYOUT:STRING=STANDALONE -DMYSQL_DATADIR:PATH=/mysql/mysql/data -DMYSQL_MAINTAINER_MODE:BOOL=OFF -DWITH_EMBEDDED_SERVER:BOOL=ON -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_SSL:STRING=bundled -DWITH_UNIT_TESTS:BOOL=OFF -DWITH_ZLIB:STRING=bundled -LH
cmake  .  -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5.32 -DMYSQL_DATADIR=/application/mysql-5.5.32/data -DMYSQL_UNIX_ADDR=/application/mysql-5.5.32/tmp/mysql.sock -DDEFAULT_CHARSET=gbk -DDEFAULT_COLLATION=gbk_chinese_ci -DENABLED_LOCAL_INFILE=ON -DWITH_INNOBASE_STOPAGE_ENGINE=1 -DWITH_FEDERATED_STOPRAGE_ENGINE=1 -DWITH_BLACKHOLE_STOPRAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STOPRAGE_ENGINE=1 -DWITHOUT_PARTITION_STOPRAGE_ENGINE=1
make && make install
 ln -s /application/mysql-5.5.32 /application/mysql
 /bin/cp support-files/my-small.cnf /etc/my.cnf
 mkdir -p /application/mysql/data
chown -R mysql /application/mysql

###初始化数据库###
/application/mysql/scripts/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data --user=mysql
tree /application/mysql/data/
cp support-files/my-small.cnf /etc/my.cnf 
cp support-files/mysql.server /etc/init.d/mysqld
 chmod 700 /etc/init.d/mysqld 
/etc/init.d/mysqld start

#####配置环境变量######
echo 'export PATH=/application/mysql/bin:$PATH' >>/etc/profile
tail -1 /etc/profile
source /etc/profile
echo $PATH 
cd /home/wan/tools

#php install
yum install zlib libxml libjpeg freetype libpng gd  curl libiconv  zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel �Cy
yum -y install curl-devel
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make
make install
cd ../

tar zxf 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 zxf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ../


rm -f /usr/lib64/libmcrypt.*
rm -f /usr/lib64/libmhash*
ln -s /usr/local/lib64/libmcrypt.la /usr/lib64/libmcrypt.la
ln -s /usr/local/lib64/libmcrypt.so /usr/lib64/libmcrypt.so
ln -s /usr/local/lib64/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4
ln -s /usr/local/lib64/libmcrypt.so.4.4.8 /usr/lib64/libmcrypt.so.4.4.8
ln -s /usr/local/lib64/libmhash.a /usr/lib64/libmhash.a
ln -s /usr/local/lib64/libmhash.la /usr/lib64/libmhash.la
ln -s /usr/local/lib64/libmhash.so /usr/lib64/libmhash.so
ln -s /usr/local/lib64/libmhash.so.2 /usr/lib64/libmhash.so.2
ln -s /usr/local/lib64/libmhash.so.2.0.1 /usr/lib64/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
ln -s /application/mysql-5.5.32/lib/libmysqlclient.so.18 /usr/lib64/
tar zxf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../

#####php install####
yum install libxslt libxslt-devel -y
tar zxf php-5.3.27.tar.gz 
cd php-5.3.27 
./configure \
--prefix=/application/php5.3.27 \
--with-mysql=/application/mysql \
--with-iconv-dir=/usr/local/libiconv \
--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-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-zend-multibyte \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp

make
make install
ln -s /application/php-5.3.27 /application/php
cp php.ini-production /application/php5.3.27/lib/php.ini

 

本文出自 “liunx系统” 博客,谢绝转载!