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 ...
随机推荐
- dotnetnuke peek. glance.
/**** 15:59:39.05 ***/ use dotnetnuke to create websites: 1. install 2. create webpage template 3. c ...
- Python数据
读取文件中数据的最高分数 highest_score=0 result_f=open("results.txt") for line in result_f: (name,scor ...
- Git 一些关于 Git、Github 的学习资源
一些关于 Git.Github 的学习资源 昨天浏览 Github 的是时候发现了 Githug 这个游戏,这个游戏用来帮助菜鸟们学习使用 Git 的. Githug is designed to g ...
- CPU cache
cache是一种小而快的缓冲器,用在CPU和main memory之间进行数据读写. 在processor访问主memory时,首先检查cache中是不是有一份copy,如果cache hit,则直接 ...
- xcode8集成百度地图(framwork包) archive是bitcode问题
(1)问题描述:真机和模拟器测试都能编译安装,但是需要打包archive的时候 总是编译出错,眼看就要上线了,还出现这问题,纠结啊.... 打印出来的错误: ld: bitcode bundle co ...
- js页面刷新之实现定时刷新(定时器,meta)
测试页面的代码见上一篇博客 接下来进入正题-定时不断刷新页面的方法: 1.看到定时,很容易想到js的定时器: //第一种方法 //由于我们已经有了一个定时器,所以只要在定时器test中加入一句刷新页面 ...
- c#邮箱发送和接收
简洁版发送: //web.config ---文件 <?xml version="1.0" encoding="utf-8"?> <!-- 有 ...
- 2016 ACM/ICPC Asia Regional Dalian Online
1009 Sparse Graph(hdu5876) 由于每条边的权值都为1,所以最短路bfs就够了,只是要求转置图的最短路,所以得用两个set来维护,一个用来存储上次扩散还没访问的点,一个用来存储这 ...
- Intent 匹配规则
1.在AndroidManifest.xml中可以为 每个 Activity,Service 设置多个Intent-Filter; 在系统启动和程序安装之后,android会收集AndroidMani ...
- 统计单词个数及词频(C++实现)
#include<iostream> #include<fstream> #include<string> using namespace std; struct ...