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,即使重新 ...
随机推荐
- 解决https协议服务器内部无法跳转的问题
<!-- 定义视图文件解析{视图解析器} --> <bean class="org.springframework.web.servlet.view.InternalRes ...
- 安装openstack 时 遇见的一些问题及解决方法!
感谢朋友支持本博客,欢迎共同探讨交流.因为能力和时间有限,错误之处在所难免.欢迎指正! 假设转载.请保留作者信息. 博客地址:http://blog.csdn.net/qq_21398167 原博文地 ...
- Win7删除虚拟机新建的用户怎么恢复
11月3日 VMware Workstation 7 Installed in Windows 7 AutoLogon Problem 安装VMware Workstation 7 在Windows ...
- File:方法(具体)
File方法: Name()方法:获取File的名称. getPath()方法:获取File的路径. getAbsolutePath()方法:获取文件或文件夹的绝对路径名称. getParent()方 ...
- #淘宝#复制分享宝贝内容,打开淘宝APP,自己主动弹出宝贝提示信息
场景描写叙述: 淘宝复制连接,分享出去,比方拷贝到QQ好友.微信好友,一个宝贝信息.然后你朋友长按复制你分享它了的这个宝贝.当然打开手机淘宝时.自己主动会跳出宝贝的信息,点击确定能够直接进入宝贝详情 ...
- Android Asynchronous Http Client 中文教程
本文为译文,原文链接https://loopj.com/android-async-http/ 安卓异步httpclient 概述 这是一个异步的基于回调的Android http客户端,构建于Apa ...
- ubuntu+tomcat,多环境、自动化部署脚本,git+maven+tomcat+ubuntu
1.切换到/opt/code目录,没有利用mkdir code创建code目录,新建deploy.sh 脚本文件,内容如下 projectName=""; #默认tomcat目录 ...
- react-native 组件默认属性(defaultProps) 及 属性类型验证(PropTypes)
1.所有的属性类型 2.代码 import PropTypes from 'prop-types'; type Props = {}; export default class App extends ...
- 【Android开发-6】了解内情,我们须要一些调试和測试手段
前言:人生不可能十全十美,总会有些遗憾存在,经历过遗憾,我们才懂的什么是生活. 程序也一样.追求完美,就必定会有经历bug存在的时候. 经历过不断的bug磨练.我们技术才会不断的成长.对于调试bug, ...
- linux标准输入输出错误输出
Linux Shell 环境中支持输入输出重定向,用符号"<"和">"来表示.0.1和2分别表示标准输入.标准输出和标准错误信息输出,可以用来指定需 ...