centos6.3安装nginx
一般使用linux系统的不少网友可能都是直接使用一键安装包进行安装的,以前作者也这样,但是很多时候这些一键安装方便是方便但是可能在升级及其他很多地方不是很好,本文就说下在centos6.3安装nginx1.2的步骤。
安装说明
操作系统:centos6.3
软件:nginx-1.2.6.tar.gz
安装方式:源码编码安装
安装位置:/usr/local/nginx
nginx下载地址:http://nginx.org/en/download.html
准备工具
在安装nginx衫,需要确保系统已经安装了g++、gcc、openssl-devel、pcre-devel和zlib-devel软件。
- yum install gcc-c++
- yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
检查系统安装的ningx
- find -name nginx
- ./nginx
- ./nginx/sbin/nginx
- ./nginx-1.2.6/objs/nginx
卸载系统原有的nginx
- yum remove nginx
centos安装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
配置防火墙
配置防火墙开启80端口,不开启的话,有时防火墙会不让外网访问80端口我们就无法访问nginx配置的网站了。
- #修改防火墙配置:
- [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
启用nginx命令
- #方法1
- [root@admin nginx-1.2.6]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
- #方法2
- [root@admin nginx-1.2.6]# cd /usr/local/nginx/sbin
- [root@admin sbin]# ./nginx
停止nginx命令
- #查询nginx主进程号
- ps -ef | grep nginx
- #停止进程
- kill -QUIT 主进程号
- #快速停止
- kill -TERM 主进程号
- #强制停止
- pkill -9 nginx
重启nginx命令
- [root@admin local]# /usr/local/nginx/sbin/nginx -s reload
centos6.3安装nginx的更多相关文章
- Centos6 下安装Nginx+Mysql+PHP
安装nginx https://segmentfault.com/a/1190000007928556 添加源 $ wget http://nginx.org/packages/centos/6/no ...
- centos6.5 安装nginx
安装之前先安装VMware tools(方便于从windows上拷贝文件到linux) 1. nginx安装环境 nginx是C语言开发,建议在linux上运行,本次使用Centos6.5作为安装环境 ...
- Centos6 yum安装nginx
1.Centos6系统库中默认是没有nginx的rpn包的,所以我们需要先更新下rpm依赖库 (1):使用yum安装nginx,安装nginx库 rpm -Uvh http://nginx.org/p ...
- CentOS6.5安装nginx及负载均衡配置
所有的安装包可以去以下地址下载,或者自行去官网下载,下面都有介绍. 所有安装包地址:http://download.csdn.net/detail/carboncomputer/9238037 原文地 ...
- Centos6.6安装Nginx
1.在安装nginx之前,需要先安装该模块需要依赖包 yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel 2.安 ...
- centos6.5安装nginx+python+uwsgi+django
nginx+uwsgi+django环境部署及测试 默认系统自带的python2.6.6 第一步(安装setuptools) wget https://pypi.python.org/packages ...
- CentOS6.5安装Nginx
1.安装prce(重定向支持)和openssl(https支持,如果不需要https可以不安装.) yum -y install pcre* yum -y install openssl* 2.下载n ...
- Linux.Centos6编译安装nginx
环境 系统环境:CentOS release 6.7 (Final) 需求 centos6.7编译安装nginx1.x 准备 安装依赖 yum install -y gcc gcc-c++ autoc ...
- CentOS-6 yum安装nginx php53 mysql55 搭建LNMP环境
1.导入外部软件库 01.rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noa ...
随机推荐
- SQL 获取各表记录数的最快方法
select distinct o.name,i.rows from sysobjects o,sysindexes i where o.id=i.id and o.Xtype= 'U' and i ...
- Winista.Text.HtmlParser; 获取html
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using Sy ...
- Rolling Cursor Invalidations with DBMS_STATS.AUTO_INVALIDATE (文档 ID 557661.1)
Rolling Cursor Invalidations with DBMS_STATS.AUTO_INVALIDATE (文档 ID 557661.1) 转到底部 In this Documen ...
- namespace用法
1.在WCF.Controller中定义了一个UserModel,标记为① 2.在WCF.Controller.Model中定义了一个UserModel(同上,namespace不同),标记为② 3. ...
- Functions类,一个Javascript的函数加法类,将两个函数加起来,顺序执行
以下是类的代码: var Functions = { oFunctions: null, add: function (oFunc, oNewFunc) { var oNew = function ( ...
- vc调用dll 示例
其实,调用dll文件的方法很多,不一定要使用LoadLibrary函数.如果使用的话,你就要预先声明dll中的函数,很麻烦. 下面是我使用dll时的一点技巧,就是引入lib文件,可以参考: 一.Win ...
- 带你快速了解CODESOFT 2015
CODESOFT是知名的条码标签设计打印软件,现在又推出了最新版CODESOFT 2015,其新功能.大改进让人为之一振.下面跟随小编的脚步,走进CODESOFT 2015,看一看CODESOFT 2 ...
- Social networks and health: Communicable but not infectious
Harvard Men’s Health Watch Poet and pastor John Donne famously proclaimed “No man is an island.” It ...
- [神器推荐]node-webkit:跨平台桌面web应用的神器,非常有用(转)
11月8号在清华拍的银杏树 http://finalshares.com/read-931
- Change screensaver through registry
If you wanna change the screensaver, you can update registry as follows{autoit script}: RegWrite(&qu ...