liukuan.net

liukuan.net,发现,记录,分享

443

contos下编译安装nginx&&tengine

快速安装nginx依赖包

1
yum -y install gcc automake autoconf libtool make gcc gcc-c++

编译和安装 PCRE 包:
1
2
3
4
5
6
7
8
9
10
cd /usr/local/src
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
tar -zxvf pcre-8.37.tar.gz
cd pcre-8.37
./configure
make
make install
//如果安装失败,有时候,我们可以尝试访问
//ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/这个路径,一般是因为软件升级,
//删除掉了旧版本所以我们可以尝试访问该路径,寻找一个新版本的安装包

3.安装zlib库

1
2
3
4
5
6
7
cd /usr/local/src
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install

4.安装ssl

1
2
3
4
5
6
7
cd /usr/local/src
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar -zxvf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c
./config --prefix=/usr/local/openssl
make
make install

5.安装nginx

1
2
3
4
5
6
7
8
9
10
11
12
13
cd /usr/local/src
wget http://nginx.org/download/nginx-1.5.7.tar.gz
tar -zxvf nginx-1.5.7.tar.gz
cd nginx-1.5.7
./configure --sbin-path=/usr/local/nginx/nginx \
--conf-path=/usr/local/nginx/nginx.conf \
--pid-path=/usr/local/nginx/nginx.pid \
--with-http_ssl_module \
--with-pcre=/usr/local/src/pcre-8.37 \
--with-zlib=/usr/local/src/zlib-1.2.8 \
--with-openssl=/usr/local/src/openssl-1.0.1c
make
make install

或安装tengine
1
2
3
4
5
6
7
8
9
10
11
12
13
cd /usr/local/src
wget http://tengine.taobao.org/download/tengine-1.5.2.tar.gz
tar zxvf tengine-1.5.2.tar.gz
cd tengine-1.5.2
./configure --sbin-path=/usr/local/tengine/tengine \
--conf-path=/usr/local/tengine/tengine.conf \
--pid-path=/usr/local/tengine/tengine.pid \
--with-http_ssl_module \
--with-pcre=/usr/local/src/pcre-8.37 \
--with-zlib=/usr/local/src/zlib-1.2.8 \
--with-openssl=/usr/local/src/openssl-1.0.1c
make
make install

运行

1
/usr/local/nginx/nginx

启动nginx

可以用

1
ln -s /usr/local/nginx/nginx /bin/nginx

设为系统全局变量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#安装php########
#php依赖包
yum -y install libmcrypt-devel mhash-devel libxslt-devel \
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
 
-----------5.5
wget http://down.liukuan.net/web/tar/php-5.5.37.tar.gz
tar php-5.5.37.tar.gz;
cd php-5.5.37;
 
./configure --prefix=/usr/local/php --with-config-file-scan-dir=/usr/local/php/php.d --with-config-file-path=/usr/local/php/etc --enable-mbstring=all --with-mysql --with-mysqli --with-pdo-mysql --with-curl  --enable-fpm --with-openssl  --enable-pcntl --with-mcrypt --enable-sockets --enable-mbregex --with-pcre-regex --with-gd --enable-sysvsem --enable-sysvshm --enable-zip
----------以后要安装新扩展,可以去php-5.5.37/ext/扩展名,用phpize安装了
 cp ./php.ini-development /usr/local/php/etc/php.ini
 
php-fpm 启动:
/usr/local/php/sbin/php-fpm
php-fpm 关闭:
kill -INT `cat /var/run/php-fpm/php-fpm.pid`
php-fpm 重启:
kill -USR2 `cat /var/run/php-fpm/php-fpm.pid`
 
查看php-fpm进程数:
ps aux | grep -c php-fpm
原文地址 : https://liukuan.net/share/17.html
本站遵循 : 知识共享署名-非商业性使用-相同方式共享 3.0 版权协议
版权声明 : 原创文章转载时,请务必以超链接形式标明 文章原始出处
作者:admin | 分类:网络分享,个人原创,服务器,linux | 标签: nginx, 服务器, contos