Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)安装步骤:
(系统要求:Linux 2.6+ 内核,本文中的Linux操作系统为CentOS 5.3,另在RedHat AS4上也安装成功)
一、获取相关开源程序:
1、【适用CentOS操作系统】利用CentOS Linux系统自带的yum命令安装、升级所需的程序库(RedHat 等其他Linux发行版可从安装光盘中找到这些程序库的RPM包,进行安装):
sudo -s
LANG=C
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、【适用RedHat操作系统】RedHat等其他Linux发行版可从安装光盘中找到这些程序库的RPM包(事先可通过类似“rpm -qa | grep libjpeg”的命令查看所需的RPM包是否存在,通常是“xxx-devel”不存在,需要安装)。RedHat可以直接利用CentOS的RPM包安装,以下是RPM包下载网址:
①、RedHat AS4 & CentOS 4
/centos/4/os/i386/CentOS/RPMS/
/centos/4/os/x86_64/CentOS/RPMS/
②、RedHat AS5 & CentOS 5
/centos/5/os/i386/CentOS/
/centos/5/os/x86_64/CentOS/
③、RPM包搜索网站
/
/
④、RedHat AS4 系统环境,通常情况下缺少的支持包安装:
Ⅰ、i386 系统
wget /soft/linux/nginx_php/rpm/i386/libjpeg-devel-6b-33.i386.rpm
rpm -ivh libjpeg-devel-6b-33.i386.rpm
wget /soft/linux/nginx_php/rpm/i386/freetype-devel-2.1.9-1.i386.rpm
rpm -ivh freetype-devel-2.1.9-1.i386.rpm
wget /soft/linux/nginx_php/rpm/i386/libpng-devel-1.2.7-1.i386.rpm
rpm -ivh libpng-devel-1.2.7-1.i386.rpm
Ⅱ、x86_64 系统
wget /soft/linux/nginx_php/rpm/x86_64/libjpeg-devel-6b-33.x86_64.rpm
rpm -ivh libjpeg-devel-6b-33.x86_64.rpm
wget /soft/linux/nginx_php/rpm/x86_64/freetype-devel-2.1.9-1.x86_64.rpm
rpm -ivh freetype-devel-2.1.9-1.x86_64.rpm
wget /soft/linux/nginx_php/rpm/x86_64/libpng-devel-1.2.7-1.x86_64.rpm
rpm -ivh libpng-devel-1.2.7-1.x86_64.rpm
3、【适用CentOS、RedHat及其它Linux操作系统】下载程序源码包:
本文中提到的所有开源软件为截止到2009年09月18日的最新稳定版。
①、从软件的官方网站下载:
mkdir -p /data0/software
cd /data0/software
wget http://sysoev.ru/nginx/nginx-0.8.15.tar.gz
wget /get/php-5.2.10.tar.gz/from/this/mirror
wget /soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz
wget /get/Downloads/MySQL-5.1/mysql-5.1.38.tar.gz/from// wget /pub/gnu/libiconv/libiconv-1.13.tar.gz
wget
"/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460&big_mirror=0" wget
"/mcrypt/mcrypt-2.6.8.tar.gz?modtime=1194463373&big_mirror=0" wget /get/memcache-2.2.5.tgz
wget
"/mhash/mhash-0.9.9.9.tar.gz?modtime=1175740843&big_mirror=0" wget ftp:///pub/software/programming/pcre/pcre-7.9.tar.gz
wget /source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2
wget /get/PDO_MYSQL-1.0.2.tgz
wget /soft/linux/nginx_php/imagick/ImageMagick.tar.gz
wget /get/imagick-2.2.2.tgz
②、从下载(比较稳定,只允许在本站,或者在Linux/Unix下通过Wget、Curl等命令下载以下软件):
mkdir -p /data0/software
cd /data0/software
wget /soft/linux/nginx_php/nginx/nginx-0.8.15.tar.gz
wget /soft/linux/nginx_php/php/php-5.2.10.tar.gz
wget /soft/linux/nginx_php/phpfpm/php-5.2.10-fpm-0.5.11.diff.gz
wget /soft/linux/nginx_php/mysql/mysql-5.1.38.tar.gz
wget /soft/linux/nginx_php/libiconv/libiconv-1.13.tar.gz
wget /soft/linux/nginx_php/mcrypt/libmcrypt-2.5.8.tar.gz
wget /soft/linux/nginx_php/mcrypt/mcrypt-2.6.8.tar.gz
wget /soft/linux/nginx_php/memcache/memcache-2.2.5.tgz
wget /soft/linux/nginx_php/mhash/mhash-0.9.9.9.tar.gz
wget /soft/linux/nginx_php/pcre/pcre-7.9.tar.gz
wget /soft/linux/nginx_php/eaccelerator/eaccelerator-0.9.5.3.tar.bz2
wget /soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz