最近配置了几台Web服务器,将安装笔记贴出来吧。没时间像以前那样,将文章写的那样系统了,请见谅。详细配置,可以看以前的旧文章:

  http://blog.zyan.cc/nginx_php_v6

  1、安装Nginx:
mkdir -p /Data/tgz
cd /Data/tgz
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
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.gz
tar zxvf pcre-8.32.tar.gz
cd pcre-8.32
./configure --prefix=/Data/apps/pcre
make && make install
cd ../

wget http://nginx.org/download/nginx-1.5.2.tar.gz
tar zxvf nginx-1.5.2.tar.gz
cd nginx-1.5.2
./configure --user=www --group=www --prefix=/Data/apps/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/Data/tgz/pcre-8.32 --with-http_realip_module --with-http_image_filter_module
make
make install
cd ../


  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 /Data/apps/mysql
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
mkdir -p /Data/data/mysql/data
yum install libaio
/Data/apps/mysql/scripts/mysql_install_db --basedir=/Data/apps/mysql --datadir=/Data/data/mysql/data --user=mysql

sed -i "s#/usr/local/mysql#/Data/apps/mysql#g" /Data/apps/mysql/bin/mysqld_safe


  3、安装PHP依赖库
mkdir -p /Data/apps/libs/
wget http://www.ijg.org/files/jpegsrc.v9.tar.gz    
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-9/
./configure --prefix=/Data/apps/libs --enable-shared --enable-static --prefix=/Data/apps/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=/Data/apps/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=/Data/apps/libs
make
make install
cd ../


wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?big_mirror=0"
wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?big_mirror=0"
wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?big_mirror=0"


tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure --prefix=/Data/apps/libs
make
make install
cd libltdl/
./configure --prefix=/Data/apps/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=/Data/apps/libs
make
make install
cd ../


vi /etc/ld.so.conf

添加:
/Data/apps/libs/lib

然后:
ldconfig


tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
export LDFLAGS="-L/Data/apps/libs/lib -L/usr/lib"
export CFLAGS="-I/Data/apps/libs/include -I/usr/include"
touch malloc.h
./configure --prefix=/Data/apps/libs --with-libmcrypt-prefix=/Data/apps/libs
make
make install
cd ../


  4、编译安装PHP 5.5
wget http://www.php.net/get/php-5.5.1.tar.gz/from/tw2.php.net/mirror
tar zxvf php-5.5.1.tar.gz
cd php-5.5.1/
export LIBS="-lm -ltermcap -lresolv"
export DYLD_LIBRARY_PATH="/Data/apps/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"
export LD_LIBRARY_PATH="/Data/apps/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"
./configure --prefix=/Data/apps/php --with-config-file-path=/Data/apps/php/etc --with-mysql=/Data/apps/mysql --with-mysqli=/Data/apps/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir=/Data/apps/libs --with-jpeg-dir=/Data/apps/libs --with-png-dir=/Data/apps/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=/Data/apps/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 /Data/apps/php/etc/php.ini
cd ../


ln -s /Data/apps/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
mv /Data/apps/php/etc/php-fpm.conf.default /Data/apps/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=/Data/apps/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="/Data/apps/libs/bin/autoconf"
export PHP_AUTOHEADER="/Data/apps/libs/bin/autoheader"
/Data/apps/php/bin/phpize
./configure --with-php-config=/Data/apps/php/bin/php-config
make
make install
cd ../


  打开 /Data/apps/php/etc/php.ini 查找 ; extension_dir = "ext"
  在其后增加一行:
extension = "memcache.so"


Tags: , , , ,



技术大类 » Web服务器 | 评论(295) | 引用(0) | 阅读(252113)
天津搬家公司 Homepage
2013-8-10 09:36
确实很有压力哦
nginx
2013-8-12 13:16
为什么安装nginx的时候提示有错误???错误如下:make -f objs/Makefilemake[1]: Entering directory `/usr/local/installsort/nginx-1.5.2'cd /usr/local/sort/pcre \        && if [ -f Makefile ]; then make distclean; fi \        && CC="cc" CFLAGS="-O2 -fomit-frame-pointer -pipe " \        ./configure --disable-shared /bin/sh: line 2: ./configure: 没有那个文件或目录make[1]: *** [/usr/local/sort/pcre/Makefile] 错误 127make[1]: Leaving directory `/usr/local/installsort/nginx-1.5.2'make: *** [build] 错误 2
hello Email Homepage
2013-8-25 22:47
编译mcrypt-2.6.8是出错,在网上查了下也有朋友遇到类似情况http://zhidao.baidu.com/link?url=zBe5u7gDK410ODQG5BXJQ3zBWZ0Wm3KZ_sMYjZBpxPEYr-HbL_NvONpnD0AaLXsibBDnoyfesFrQ9iU4IdwG8q,张兄请赐教,谢谢
奇才哥 Email Homepage
2013-8-28 17:45
宴哥,php 编译参数中关于 mysql, mysqli 的为啥不用PHP v5.3 就支持的mysqlnd 呢?有讲究吗?--with-mysql=mysqlnd \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd
kn007 Email Homepage
2013-9-7 23:10
装了很多支持啊,我自己配,没配那么多功能
test Homepage
2013-9-10 08:56
Windows下的Nginx+PHP+MySQL绿色包:http://code.ysq.me/p/wempserver/cn/
kali
2013-9-10 19:52
php5.3之后编译就不用像以前那样指定mysql了
yiwu Homepage
2013-10-14 10:17
还有详细点的没?
nginxx Homepage
2013-10-14 10:17
不错,学习下了
geng Email
2013-10-19 11:25
谢谢你的教程,我想请问我建的网站如何才能在任何电脑都恩呢个访问呢?十分感谢。
磨延城 Email Homepage
2013-10-21 17:50
学习了,谢谢张老师.
jookie Homepage
2013-10-30 16:25
使用集成包 安装就行了 手工很麻烦的
ddd
2013-11-7 12:41
问几个问题:
1、/Data/apps/mysql/scripts/mysql_install_db   是不是把前面编译安装的步骤省了,直接安装示例数据库?
2、PHP编译时为mysql的驱动为啥不用mysqlnd??
开房吧 Homepage
2013-11-22 16:47
apmserv看来是不再更新了
guchenfly Email
2013-12-20 19:01
启动php-fpm时报错:
./php-fpm: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

ld.so.conf中增加一行:
/Data/apps/mysql/lib

宴哥是我哪里弄错了还是你忘了啥了。。
dd
2013-12-30 13:56
本来不想评论,错误百出,徒有虚名。
ss
2014-2-25 14:26
Great blog. All posts have something to learn. Your work is very good and i appreciate you and hopping for some more informative posts.
IDRpoker.com Agen Texas Poker Online Indonesia Terpercaya | IDRpoker.com Agen Texas Poker Online Indonesia Terpercaya | Alfamart official partner merchandise FIFA piala dunia Brazil 2014
大叔 Email Homepage
2014-4-3 08:57
對於架設網站來說,真的可以學到很多,謝謝
福利工口姬 Email Homepage
2014-4-16 16:45
一句注释都没有吗?
分页: 4/15 第一页 上页 1 2 3 4 5 6 7 8 9 10 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]