CentOS6编译安装Nginx 1.6.2 + PHP 5.5.20 + MySQL 5.6.10环境

1.系统预先配置

yum install wget
yum install pcre
yum install openssl*
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 make
yum -y install gd gd2 gd-devel gd2-devel
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
ulimit -SHn 65535
mkdir -p /ia/data/
cd /ia/data/
wget http://ftp.exim.llorien.org/pcre/pcre-8.32.tar.gz
tar -zxvf pcre-8.32.tar.gz
mkdir tgz
mv pcre-8.32* tgz/
mkdir installsoft
cd installsoft/
wget http://nginx.org/download/nginx-1.6.2.tar.gz
tar xzvf nginx-1.6.2.tar.gz
cd nginx-1.6.2
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/ia/data/tgz/pcre-8.32 --with-http_realip_module --with-http_image_filter_module
make
make install
/usr/local/webserver/nginx/sbin/nginx -V
 
2、安装 MySQL:

wget http://downloads.mysql.com/archives/mysql-5.6/mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
tar zxvf mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.10-linux-glibc2.5-x86_64 /usr/local/webserver/mysql
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
mkdir -p /Data/data/mysql/data
yum install libaio
/usr/local/webserver/mysql/scripts/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/ia/data/mysql/data --user=mysql
 
sed -i "s#/usr/local/mysql#/usr/local/webserver/mysql#g" /usr/local/webserver/mysql/bin/mysqld_safe
GRANT ALL PRIVILEGES ON *.* TO 'ia_admin'@'localhost' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'ia_admin'@'127.0.0.1' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'ia_admin'@'%' IDENTIFIED BY '12345678';
 
3、安装PHP依赖库

mkdir -p /usr/local/webserver/libs/
wget http://www.ijg.org/files/jpegsrc.v9.tar.gz    
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-9/
./configure --prefix=/usr/local/webserver/libs --enable-shared --enable-static --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.2.tar.gz
tar zxvf libpng-1.6.2.tar.gz
cd libpng-1.6.2/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
tar zxvf freetype-2.4.12.tar.gz
cd freetype-2.4.12/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
 
wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz"
wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz"
wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz"
 
 
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd libltdl/
./configure --prefix=/usr/local/webserver/libs --enable-ltdl-install
make
make install
cd ../../
 
 
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
vi /etc/ld.so.conf
 
添加:
/usr/local/webserver/libs/lib
 
然后:
ldconfig
 
 
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
export LDFLAGS="-L/usr/local/webserver/libs/lib -L/usr/lib"
export CFLAGS="-I/usr/local/webserver/libs/include -I/usr/include"
touch malloc.h
./configure --prefix=/usr/local/webserver/libs --with-libmcrypt-prefix=/usr/local/webserver/libs
make
make install
cd ../
 
4、编译安装PHP 5.5

wget http://cl1.php.net/get/php-5.5.20.tar.gz/from/this/mirror
tar zxvf php-5.5.20.tar.gz
cd php-5.5.20/
export LIBS="-lm -ltermcap -lresolv"
export DYLD_LIBRARY_PATH="/usr/local/webserver/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"
export LD_LIBRARY_PATH="/usr/local/webserver/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"
./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-iconv-dir --with-freetype-dir=/usr/local/webserver/libs --with-jpeg-dir=/usr/local/webserver/libs --with-png-dir=/usr/local/webserver/libs --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/usr/local/webserver/libs --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-zts
 
make
make install
cp php.ini-development /usr/local/webserver/php/etc/php.ini
cd ../
ln -s /usr/local/webserver/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
mv /usr/local/webserver/php/etc/php-fpm.conf.default /usr/local/webserver/php/etc/php-fpm.conf
 
 5、编译安装PHP扩展

wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar zxvf autoconf-latest.tar.gz
cd autoconf-2.69/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
wget http://pecl.php.net/get/memcache-2.2.7.tgz
tar zxvf memcache-2.2.7.tgz
cd memcache-2.2.7/
export PHP_AUTOCONF="/usr/local/webserver/libs/bin/autoconf"
export PHP_AUTOHEADER="/usr/local/webserver/libs/bin/autoheader"
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../
 
 
打开 /usr/local/webserver/php/etc/php.ini 查找 ; extension_dir = "ext"
在其后增加一行
extension = "memcache.so"

时间: 2024-10-14 11:28:09

CentOS6编译安装Nginx 1.6.2 + PHP 5.5.20 + MySQL 5.6.10环境的相关文章

CentOS6.6 32位 Minimal版本纯编译安装Nginx Mysql PHP Memcached

声明:部分编译指令在博客编辑器里好像被处理了,如双横线变成单横线了等等,于是在本地生成了一个pdf版本,在下面地址可以下载. LNMP+Memcached CentOS是红帽发行的免费的稳定Linux版本,在企业服务器应用中都会选用Minimal版本,因为Minimal是CentOS"最纯洁"的服务器系统,因为Minimal版本连vim编辑器都需要自己安装,Minimal组件最少,无桌面,扩展灵活,非常适合做服务器. 1.配置网卡 Minimal版本的CentOS被安装后,网卡驱动默认

centos系统编译安装nginx+php环境另加独立mysql教程

  前端(nginx+php)ip:192.168.10.8 后端(独立mysql)ip:192.168.10.5 软件版本:libiconv-1.14.tar.gz mysql-5.1.63.tar.gz php-5.2.17.tar.gz php-5.2.17-fpm-0.5.14.diff.gz php-5.2.17-max-input-vars.patch 1.先在后端安装mysql 在192.168.10.5上只安装mysql.方法可以去看centos编译安装nginx+php-fpm

CentOS上编译安装Nginx环境步骤

一.安装前准备 1.获取系统信息  代码如下 复制代码 # cat /etc/redhat-release CentOS release 6.5 (Final) # uname -p x86_64 由上可知,当前系统:64位CentOS 6.5. 2.安装基础包  代码如下 复制代码 # yum install gcc # yum install wget 二.安装Nginx模块基础库 1.安装HTTP rewrite(伪静态)模块需要的PCRE库.  代码如下 复制代码 # yum insta

Linux 6下安装编译安装Nginx

Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器.在高连接并发的情况下,Nginx是Apache服务器不错的替代品:Nginx在美国是做虚拟主机生意的老板们经常选择的软件平台之一.能够支持高达50,000个并发连接数的响应,而且内存开销极小.这也是Nginx广受欢迎的重要原因.本文演示了基于Linux 6下编译安装Nginx,供大家参考. 一.安装环境 # cat /etc/issue Red Hat Enterprise Linux Server r

Centos下编译安装Nginx教程详解_nginx

一.安装nginx时必须先安装相应的编译工具 yum -y install gcc gcc-c++ autoconf automake yum -y install zlib zlib-devel openssl openssl-devel pcre-devel 建立nginx 组 groupadd -r nginx useradd -s /sbin/nologin -g nginx -r nginx id nginx zlib:nginx提供gzip模块,需要zlib库支持 openssl:n

linux 编译安装nginx,配置自启动脚本

在公司的suse服务器装nginx,记录下安装过程: 参照这篇文章:Linux 从源码编译安装 Nginx: 1.1.准备 pcre 库 pere 是为了让 nginx 支持正则表达式.只是准备,并不安装,是为了避免在64位系统中出现错误.  代码如下 复制代码 wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.11.tar.gz  tar -zxf pcre-8.11.tar.gz 1.3.准备 zlib 库 同

Ubuntu14编译安装Nginx同时配置Google反向代理 + SSL 证书

在看这篇文章之前,首先你得准备一台墙外的服务器或 VPS,本文默认用 root 用户,并操作在系统的 /root 目录下,为了安全考虑,请自行更换目录. 一.编译安装 Nginx 1.首先更新下系统 sudo apt-get update && sudo apt-get upgrade 2.安装的 Nginx 需要的包以及 Git sudo apt-get install libpcre3 libpcre3-dev zlib1g-dev libssl-dev build-essential

CentOS6.3编译安装Nginx+ MySQL5+ PHP5环境教程

[准备工作] #在编译安装lnmp之前,首先先卸载已存在的rpm包.  代码如下 复制代码 rpm -e httpd rpm -e mysql rpm -e php yum -y remove httpd yum -y remove mysql-server mysql yum -y remove php yum -y remove php-mysql #禁用SeLinux,Selinux可能会致使编译安装失败,我们先禁用它. #sed -i 's/SELINUX=enforcing/SELIN

在Mac OS上编译安装Nginx+PHP+MariaDB开发环境的教程_php实例

因为甲骨文的尿性.mariadb应该要顶替mysql了.所以抛弃mysql 1,编译nginx分别下载nginx,openssl,pcre 编译openssl的时候会提示 WARNING! If you wish to build 64-bit library, then you have to invoke './Configure darwin64-x86_64-cc' *manually*. 如果你不停止编译就会出错.这个问题应该是 openssl/config脚本猜对你的系统是64位,但