标签:style c class blog code java
系统环境:CentOS-6.3
软件:nginx-1.2.6.tar.gz
安装方式:源码编译安装
安装位置:/usr/local/nginx
下载地址:http://nginx.org/en/download.html
在安装nginx前,需要确保系统安装了g++、gcc、openssl-devel、pcre-devel和zlib-devel软件。安装必须软件:
[root@admin /]#yum install gcc-c++ yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel |
检查系统安装的Nginx:
[root@admin local]# find -name
nginx ./nginx ./nginx/sbin/nginx ./nginx-1.2.6/objs/nginx |
卸载原有的Nginx
[root@admin /]# yum remove nginx |
将安装包文件上传到/usr/local中执行以下操作:
[root@admin local]# cd
/usr/local [root@admin local]# tar -zxv -f nginx-1.2.6.tar.gz [root@admin local]# rm -rf nginx-1.2.6.tar.gz [root@admin local]# mv nginx-1.2.6 nginx [root@admin local]# cd /usr/local/nginx [root@admin nginx]# ./configure --prefix=/usr/local/nginx [root@admin nginx]# make [root@admin nginx]# make install |
配置
#修改防火墙配置: [root@admin nginx-1.2.6]# vi + /etc/sysconfig/iptables #添加配置项 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #重启防火墙 [root@admin nginx-1.2.6]# service iptables restart |
#方法1 |
#查询nginx主进程号 |
[root@admin local]# /usr/local/nginx/sbin/nginx -s reload |
#测试端口 |
# rpm -ivh nginx.rpm
# yum install nginx
# chkconfig nginx on
# service nginx start
# service nginx stop
# service nginx restart
# service nginx status
# service nginx reload
# yum install gcc
# yum install gcc-c++
tar -zxvf name.tar.gz
tar -jxvf name.tar.bz2
yum install libxml2
yum install libxml2-deve
PHP Setup
./configure --prefix=/usr/local/php --enable-fpm --enable-sockets --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-gd --with-jpeg
make
make install
centos setup nginx,布布扣,bubuko.com
标签:style c class blog code java
原文地址:http://www.cnblogs.com/ytjjyy/p/3755275.html