RedHat/CentOs系統搭建lnmp環境
1、用yum安裝系統lib庫
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
2、所需要的件包
libiconv-1.13.1.tar.gz
mcrypt-2.6.8.tar.gz
mysql-5.1.31.tar.gz
pcre-7.9.tar.gz
php-5.2.13-fpm-0.5.13.diff.gz
php-5.2.13.tar.gz
libmcrypt-2.5.8.tar.gz
mhash-0.9.9.9.tar.gz
nginx-1.0.4.tar.gz
pcre-8.01.tar.gz
memcache-2.2.5.tgz
eaccelerator-0.9.6.1.tar.bz2
PDO_MYSQL-1.0.2.tgz
ImageMagick.tar.gz
imagick-2.3.0.tgz
3、安裝mysql
軟體包位置/usr/local/src/mysql-5.1.31.tar.gz
在/usr/local/src中建立安裝指令碼
#vim install_mysql.sh cd /usr/local/src echo `install mysql...` sleep 3 cd /usr/local/src groupadd mysql useradd -g mysql -s /sbin/nologin mysql tar xzvf mysql-5.1.31.tar.gz cd mysql-5.1.31/ ./configure --prefix=/usr/local/mysql --with-extra-charsets=all --exec-prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/var --sysconfdir=/usr/local/mysql/etc --with-tcp-port=3306 --with-plugins=`heap,innobase,blackhole,partition` make -j8 make install cd /usr/local/mysql/ chown -R mysql . chgrp -R mysql . cd /usr/local/src/mysql-5.1.31/support-files cp my-medium.cnf /etc/my.cnf sed -i `s/skip-federated/#skip-federated/g` /etc/my.cnf chown -R mysql:mysql var chmod 755 var cd /usr/local/src/sql-5.1.31/support-files/ cp mysql.server /etc/init.d/mysqld chmod 755 /etc/init.d/mysqld chkconfig --add mysqld chkconfig mysqld on rm -rf /usr/local/mysql/var/* /usr/local/mysql/bin/mysql_install_db --user=mysql service mysqld restart echo `mysql install suecc!`
執行sh instal_mysql.sh mysql就安裝好了。
4、安裝php-5.2.13所需要的庫
#cd /usr/local/src
#vim install_phplib.sh
#!/bin/bash
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./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
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
cd ../
5、安裝nginx
#tar xzvf pcre-8.01.tar.gz
#cd pcre-8.01
#./configure
#make
#make install
#cd ../
#tar xzvf nginx-1.0.4.tar.gz
#cd nginx-1.0.4
#./configure –user=www –group=www –prefix=/usr/local/nginx –with- http_stub_status_module –with-http_ssl_module –with-http_gzip_static_module
#make
#make install
6、安裝php-5.2.13
#tar xzvf php-5.2.13.tar.gz
#gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1
#cd /usr/local/src/php-5.2.13
#vim config.nice
#! /bin/sh
#
# Created by configure
`./configure`
`–prefix=/usr/local/php`
`–with-config-file-path=/usr/local/php/etc`
`–with-mysql=/usr/local/mysql`
`–with-mysqli=/usr/local/mysql/bin/mysql_config`
`–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-discard-path`
`–enable-safe-mode`
`–enable-bcmath`
`–enable-shmop`
`–enable-sysvsem`
`–enable-inline-optimization`
`–with-curl`
`–with-curlwrappers`
`–enable-mbregex`
`–enable-fastcgi`
`–enable-fpm`
`–enable-force-cgi-redirect`
`–enable-mbstring`
`–with-mcrypt`
`–with-gd`
`–enable-gd-native-ttf`
`–with-openssl`
`–with-mhash`
`–enable-pcntl`
`–enable-sockets`
`–enable-zip`
`–enable-soap`
`–with-pdo-mysql=/usr/local/mysql`
“$@”
#chmod u+x config.nice
#source config.nice
#make ZEND_EXTRA_LIBS=`-liconv`
#make install
#cp php.ini-dist /usr/local/php/etc/php.ini
#cd ../
7、安裝php擴充套件
#tar zxvf memcache-2.2.5.tgz
#cd memcache-2.2.5/
#/usr/local/php/bin/phpize
#./configure –with-php-config=/usr/local/php/bin/php-config
#make
#make install
#cd ../
#tar jxvf eaccelerator-0.9.6.1.tar.bz2
#cd eaccelerator-0.9.6.1/
#/usr/local/php/bin/phpize
#./configure –enable-eaccelerator=shared –with-php-config=/usr/local/php/bin/php-config
#make
#make install
#cd ../
#tar zxvf PDO_MYSQL-1.0.2.tgz
#cd PDO_MYSQL-1.0.2/
#/usr/local/php/bin/phpize
#./configure –with-php-config=/usr/local/php/bin/php-config –with-pdo-mysql=/usr/local/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.3.0.tgz
#cd imagick-2.3.0/
#/usr/local/php/bin/phpize
#./configure –with-php-config=/usr/local/php/bin/php-config
#make
#make install
#cd ../
本文轉自yuangang_love 51CTO部落格,原文連結:http://blog.51cto.com/linux008/593405,如需轉載請自行聯絡原作者
相關文章
- 學習centos之快速搭建LNMP環境CentOSLNMP
- redhat 6 / centos 6 搭建Django環境RedhatCentOSDjango
- LNMP 環境搭建LNMP
- 搭建lnmp環境LNMP
- lnmp環境搭建LNMP
- CentOS 7 使用 docker 搭建基本的 lnmp 環境CentOSDockerLNMP
- docker搭建lnmp環境DockerLNMP
- docker 搭建 lnmp 環境DockerLNMP
- 如何搭建LNMP環境LNMP
- ubuntu lnmp環境搭建UbuntuLNMP
- CentOS7下LNMP環境搭建Discuz論壇CentOSLNMP
- CentOS7系統手動部署LNMP環境操作演示CentOSLNMP
- PHP-lnmp 環境搭建PHPLNMP
- Docker LNMP Redis 環境搭建DockerLNMPRedis
- Windows 下搭建 lnmp 環境WindowsLNMP
- LNMP環境搭建(二):NginxLNMPNginx
- LNMP環境搭建——Nginx篇LNMPNginx
- docker下LNMP環境搭建DockerLNMP
- centos下編譯lnmp環境CentOS編譯LNMP
- CentOS6系統原始碼安裝LNMP環境詳解CentOS原始碼LNMP
- 搭建 lnmp 環境之 nginx 篇LNMPNginx
- Deepin 15 搭建 LNMP 環境 + swooleLNMP
- Dockfile搭建極簡LNMP環境LNMP
- 基於Docker搭建LNMP環境DockerLNMP
- docker 學習筆記之實戰 lnmp 環境搭建系列 (2) ------ 手動搭建 lnmp 環境Docker筆記LNMP
- 利用 Docker 一鍵搭建 LNMP 環境DockerLNMP
- docker搭建laravel開發環境lnmpDockerLaravel開發環境LNMP
- centos6.2LNMP環境安裝(yum)CentOSLNMP
- Vagrant 搭建 CentOS 環境CentOS
- centos 前端環境搭建CentOS前端
- centos搭建virtualenv環境CentOS
- CentOS7系統搭建web環境 php&nginx&pgsqlCentOSWebPHPNginxSQL
- 搭建 LNMP + CodeIgniter 開發環境LNMP開發環境
- CentOS7 配置 LNMP 伺服器環境CentOSLNMP伺服器
- centos7使用yum安裝lnmp環境CentOSLNMP
- Centos下搭建golang環境CentOSGolang
- Linux系統環境搭建Linux
- EAS系統環境的搭建