CentOs6.5下独立安装Nginx篇
一、检查系统是否安装了Nginx
[root@localhost local]# find -name nginx
[root@localhost local]#
(如果已经安装了nginx就卸载掉原来的)
[root@localhost local]# yum remove nginx
注意:下麵是安裝依賴包(linux源碼安裝的時候需要安裝依賴包,如果安裝了就跳過)
[root@localhost /]# yum install -y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*
二、将安装包文件上传到/usr/local中执行以下操作
[root@localhost local]# cd /usr/local
[root@localhost local]# tar -zxv -f nginx-1.6.0.tar.gz
[root@localhost local]# rm -rf nginx-1.6.0.tar.gz
[root@localhost local]# mv nginx-1.6.0 nginx
[root@localhost local]# cd /usr/local/nginx-1.6.0
[root@localhost nginx-1.6.0]# ./configure --prefix=/usr/local/nginx
[root@localhost nginx-1.6.0]# make
[root@localhost nginx-1.6.0]# make install
提示错误时:
./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library. You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=<path> options.
这个因为第一次安装nginx,缺少了依赖包,需要安装:
[root@localhost nginx-1.6.0]# yum -y install pcre-devel openssl openssl-deve
....
[root@localhost nginx-1.6.0]# ./configure --prefix=/usr/local/nginx
....
[root@localhost nginx-1.6.0]#make && make install
....
三、配置
#修改防火墙配置:
[root@localhost nginx-1.6.0]# vi + /etc/sysconfig/iptables
#添加配置项
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
#重启防火墙
[root@localhost nginx-1.6.0]# service iptables restart
四、启动
#方法1
[root@localhost nginx-1.6.0]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#方法2
[root@localhost nginx-1.6.0]# cd /usr/local/nginx/sbin
[root@localhost sbin]# ./nginx
重启:
[root@localhost local]#/usr/local/nginx/sbin/nginx -t
[root@localhost local]#/usr/local/nginx/sbin/nginx -s reload
五、测试是否安装成功
1、查看nginx的进程:
[root@localhost conf]# ps -ef | grep nginx
2、 在浏览器中输入:http://ip:端口 如果看到nginx的欢迎页面表示安装成功,如果页面大不开,请关闭防火墙继续测试
3、 关闭防火墙
(1) 重启后永久性生效:
开启:chkconfig iptables on
关闭:chkconfig iptables off
(2) 即时生效,重启后失效:
开启:service iptables start
关闭:service iptables stop
nginx安装好后如果需要开机重启nginx请看 》》 linux下安装nginx后开机启动篇
CentOs6.5下独立安装Nginx篇的更多相关文章
- CentOs6.5下独立安装mysql篇
1.安装包:Mysql: mysql-5.6.13.tar 一.源码包准备 (1)mysql-5.6.13.tar.gz 源码包.去www.mysql.com下载最新的mysql-5.6.13.tar ...
- Linux(CentOS6.5)下编译安装Nginx官方最新稳定版(nginx-1.10.0)
注:此文已经更新为新版:http://comexchan.cnblogs.com/p/5815753.html ,请直接查看新版,谢谢! 本文地址http://comexchan.cnblogs.co ...
- centos6.7下编译安装lnmp
很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y g ...
- CentOS6.5下Oracle11G-R2安装、卸载
CentOS6.5下Oracle11G-R2安装.卸载 资源下载地址(包含本人全部安装过程中,系统备份文件):http://download.csdn.net/detail/attagain/7700 ...
- centos6.7下 编译安装MySQL5.7
centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ...
- Linux(CentOS6.5)下编译安装PHP5.6.22时报错”configure: error: ZLIB extension requires gzgets in zlib”的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)
本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢! 今天在CentOS6.5下编译安装PHP时,一直报错 confi ...
- 在CentOS 7下编译安装Nginx+PHP+MySQL环境
本文转载自:http://www.softeng.cn/?p=156,本文已获得作者授权,未经作者同意,不可转载. 1.前言 本文适合于已经对Linux操作系统具有基本操作经验,并且能够在Linux或 ...
- CentOS6.5_64bit下编译安装MySQL-5.6.23
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************** ...
- CentOS6.5下编译安装LAMP环境
LAMP(Linux-Apache-MySQL-PHP)网站架构是目前国际流行的Web框架.该框架能够满足大流量.大并发量的网站需求:当然.也可以直接使用高性能的服务器.高性能的负载均衡硬件以及CDN ...
随机推荐
- s3c2440 test 里面的一些用法
#define REQ_INFO 0x60U U代表无符号,unsignchar
- Android--Retrofit的简单使用(一)
1,如果不太了解retrofit的同学可以先去官网学习一下简单使用:http://square.github.io/retrofit/,这里我们以一个简单的Get请求的例子来练习一下 2,https: ...
- 利用jquery获取html中被选中的input的值
单个按钮 <div id="wrap"> <input type="radio" name="payMethod" val ...
- 【001:转载 ubuntu下: 建立本地SVN服务器】
1.安装 svn 工具 $sudo apt-get install subversion 2. 创建工程文件夹,用于存放工程 $mkdir ~/localsvn $mkdir ~/localsvn/ ...
- flask学习资源
1.flask快速入门(视频) http://www.pythoner.cn/course/topic/flask-web-development/ 2.flask教程,开源中国 http://www ...
- Main.C时钟设定
void Main(void) 时钟设定:400M 100M 50M 得到 1:4:8 进而需要得到 hdivn=2 : pdivn=1: i = 2 ; //用于选择CUP核的频率 ...
- Python之控制台输入密码的方法
一.raw_input()或input(): for python 2.x [root@master test]# /usr/local/python2.7/bin/python test.py Pl ...
- RegExp类型,单体内置对象
1.RegExp类型: 1)什么是正则表达式:RegExp --是一种规则,模式 --强大的字符串匹配工具 --创建: --使用RegExp构造函数创建:var re=new ...
- laravel框架总结(五) -- 服务提供者(提及契约Contracts)
首先理解两个概念 1.契约:一组定义了框架核心服务的接口 2.服务提供者:所有 Laravel 应用程序启动的中心所在. 包括你自己的应用程序,以及所有的 Laravel 核心服务,都是通过服务提供者 ...
- VC++6.0在Win7以上系统上Open或Add to Project files崩溃问题 解决新办法
崩溃原因是和office高版本冲突,比如我64位win7装了64位office2013及visio就遇到了这个问题(我很纳闷,记得重装系统前装的是32位office2013及visio就未曾遇到该问题 ...