centos6安装nginx最详细步骤
第一步:在centos下面下载 nginx
wget http://nginx.org/download/nginx-1.2.9.tar.gz
解压 tar zxf nginx-1.2.9.tar.gz
第二部:新建一个用户nginx在安装操作
useradd nginx
passwd nginx
第三步、解压和测试安装环境 ./configure --prefix=/var/nginx
安装过程中报错
checking for OS
+ Linux 2.6.32-220.el6.x86_64 x86_64
checking for C compiler ... not found
./configure: error: C compiler gcc is not found
解决方法:安装gcc
yum install gcc
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
需要安装
安装pcre-devel解决问题 (root用户下安装)
yum -y install pcre-devel
继续报错误
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
需要安装 yum install -y zlib-devel
在继续执行 ./configure --prefix=/opt/nginx 安装编译成功
第四步:
make && make install
第五步:
cd /var/nginx/sbin
./nginx
如果报错:
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
那说明80端口被占用,用命令netstat -ltunp查看一下是哪个服务占用了端口
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1547/mysqld
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 1247/vsftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1233/sshd
tcp 0 0 :::80 :::* LISTEN 1258/httpd
tcp 0 0 :::22 :::* LISTEN 1233/ssh
可以看出需要把httpd服务关掉
service httpd stop
然后再运行./nginx就行了
然后打开浏览器输入IP地址 显示
Welcome to nginx!
xxxxxxxxx
安装成功
centos6安装nginx最详细步骤的更多相关文章
- 转载《centos6安装nginx最详细步骤》
出处:https://www.cnblogs.com/hltswd/p/6956264.html 第一步:在centos下面下载 nginx wget http://nginx.or ...
- CentOS7中使用yum安装Nginx的详细步骤
1.添加源 rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarc ...
- windows10用WMware安装Linux虚拟机详细步骤
windows10用WMware安装Linux虚拟机详细步骤 一.安装环境 windows10操作系统物理机VMware Workstation 软件(可以在网上下载)CentOS6.9镜像文件( ...
- 安装WebLogic的详细步骤
安装WebLogic的详细步骤 1.在官网上下载WebLogic,详细地址如下 WebLogic 2.将WebLogic从官网上下载后wls1036_generic.jar 3.双击"wls ...
- bootcamp安装win7的详细步骤 (光盘安装)
bootcamp安装win7的详细步骤 首先是要您确定以下内容(1)您的Mac系统下是一个盘符,也就是“macintosh hd”一个磁盘.如果不是的话,首先您需要做的是备份您分区下面的资料,让磁 ...
- Linux安装ftp服务-详细步骤
最近项目中用到了FTP服务器,于是整理了一份在Linux服务器上安装FTP的详细步骤供大家分享. 1.首先连接上自己的Linux服务器.我的Linux是CentOS 6 2.检查Linux服务器上是否 ...
- Linux上centOs6+安装mysql5.7详细教程 - 前端小鱼塘
https://coyhom.github.io/ 人类的本质是复读机,作为一个非linux专业人员学习linux最好的办法是重复 环境centos6.5 版本5.7 1: 检测系统是否自带安装mys ...
- 完全卸载nginx的详细步骤
一个执着于技术的公众号 前言 在开局配置Nginx时有可能会配置错误,报各种错误代码.看不懂或者懒得去看这个报错时,其实最简单的方式是卸载并重装咯.今天就带大家一起学习下,如何彻底卸载nginx程序. ...
- MATLAB 安装使用libsvm详细步骤
根据本文后面部分博友提出的在配置过程中出现的问题,其中需要特别强调的一点:整个过程,都是在 libsvm-3.12\matlab目录下操作的.如果这一点你忽视了,你不可能解决配置中报的Bug,即使重新 ...
随机推荐
- 2017.4.26 慕课网--Java 高并发秒杀API(一)
Java高并发秒杀API系列(一) -----------------业务分析及Dao层 第一章 课程介绍 1.1 内容介绍及业务分析 (1)课程内容 SSM框架的整合使用 秒杀类系统需求理解和实现 ...
- C#基于Socket的CS模式的完整例子
基于Socket服务器端实现本例主要是建立多客户端与服务器之间的数据传输,首先设计服务器.打开VS2008,在D:\C#\ch17目录下建立名为SocketServer的Windows应用程序.打开工 ...
- notepad++ 在每一行最后加上逗号
1.全选缩进对齐 2.替换功能,入下全部替换 3.在入下替换 4.结果 完成!
- 遍历修改django bootstrap form 为 django bootstrap3
#!/usr/bin/env python # encoding: utf-8 import re import os fname = '' bt_pattern = re.compile(r'{% ...
- ionic准备之angular基础——继承(3)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- react-native 扫一扫功能(二维码扫描)功能开发
1.安装插件 yarn add react-native-smart-barcode 2.关联 react-native link react-native-smart-barcode 3.修改 an ...
- 【Android开发-6】了解内情,我们须要一些调试和測试手段
前言:人生不可能十全十美,总会有些遗憾存在,经历过遗憾,我们才懂的什么是生活. 程序也一样.追求完美,就必定会有经历bug存在的时候. 经历过不断的bug磨练.我们技术才会不断的成长.对于调试bug, ...
- Android 开发 Eclipse使用SVN
1 help--->install new software--->add 2 name自定义 location填入内容见3 3 http://subclipse.tigris.org/s ...
- 防止Spinner初始化加载
spinner在初始化的时候会自动调用一次OnItemSelectedListener,我们很多时候需要他不加载这一次,使用下面的代码spinner.setSelection(0, true);
- windows和linux下目录分隔符兼容问题(换行回车兼容)
windows和linux下目录分隔符兼容 DIRECTORY_SEPARATOR 换行回车兼容 PHP_EOF