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 ...
随机推荐
- 旋转toast 自定义toast方向,支持多个方向的显示,自定义View
package com.example.canvasdemo; import java.security.InvalidAlgorithmParameterException; import andr ...
- Openstack安全规则说明
openstack的安全规则,主要是在网络控制器,nova-network中进行的端口限制,所以我们需要对规则进行定制. 定制通用安全组规则 通用安全组规则主要包括2个,1是支持ping的icmp协议 ...
- c#委托、事件、Observer
委托和事件在.NET Framework[1] 中的应用非常广泛,然而,较好地理解委托和事件对很多接触C#时间不长的人来说并不容易. 中文名 委托 外文名 Delegate 编程语言 C# 作 ...
- Qt报表控件NCReport教程:添加报表字段
NCReport是一款轻量级.快速.多平台.简单易用的基于Qt toolkit的C++编写的报表解决方案,目前主要包括报表渲染库和报表设计器GUI应用程序. 在前面的文章<报表控件NCRepor ...
- win32 公用对话框
## 公用对话框 ## 公用对话框:打开文件.保存文件.选择字体.选择颜色.查找.查找替换... 等等.(我就用过这几个其他的可以猜测用法,给出部分代码,这里我就不一一贴代码了,用到了在完善吧) 用到 ...
- Web_add_header
如果你发现所有的HTTP send请求都缺少头数据包,在脚本中的开头添加web_add_auto_header(”XXXXX“,”yyyy“);随着web_add_auto_header的添加,你不需 ...
- noi 8780 拦截导弹
题目链接: http://noi.openjudge.cn/ch0206/8780/ LDS http://paste.ubuntu.com/23402528/
- Intellij IDEA 快捷键介绍
ctrl-w 使所选表达式逐步增大直到选取整个文件 ctrl+shft+w 逐步减少选中 ctrl-n 可以通过键入类名查找一个类 ctrl-shift-n 可以查找文件 ctrl-e 得到 ...
- 使用ajax登录格式
登录页面: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w ...
- C#中的多线程 - 基础知识
原文:http://www.albahari.com/threading/ 文章来源:http://blog.gkarch.com/threading/part1.html 1简介及概念 C# 支持通 ...