Nginx安装详解
来源:互联网 发布:origin转换为矩阵 编辑:程序博客网 时间:2024/06/08 06:17
首先关闭防火墙和selinux
CentOS 7.0默认使用的是firewall作为防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
我使用的环境是64位 centos7 nginx依赖以下模块:
gzip模块需要 zlib 库
rewrite模块需要 pcre 库
ssl 功能需要openssl库
1.1.安装pcre
系统一般都自带了pcre但还需要安装devel包引入头文件才能用
但是还要
yum -y install pcre-devel
devel包含普通包,只比普通包多了头文件。动态链接库的话两种包都有。编译的时候如果需要用到这个库,那么需要安装这个库的devel,因为需要头文件
不安装pcre的话安装nginx时候会报错
1.2.安装openssl
1. 获取openssl编译安装包,在http://www.openssl.org/source/上可以获取当前最新的版本。
2. 解压缩openssl-xx.tar.gz包。
3. 进入解压缩目录,执行./config。
4. make & make install
1.3.安装zlib
1. 获取zlib编译安装包,在http://www.zlib.net/上可以获取当前最新的版本。
2. 解压缩openssl-xx.tar.gz包。
3. 进入解压缩目录,执行./configure。
4. make & make install
1.4.安装nginx
1. 获取nginx,在http://nginx.org/en/download.html上可以获取当前最新的版本。
2. 解压缩nginx-xx.tar.gz包。
3. 进入解压缩目录,执行./configure
4. make & make install
./configure --help查看编译选项
nginx -t -c /etc/nginx/nginx.conf检测配置文件是否有语法错误
/usr/local/nginx/sbin
./nginx启动
Nginx 运行 停止 重启命令
http://www.360doc.com/content/10/1214/10/4382110_77941467.shtml
Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
使用命令关闭占用80端口的程序
sudo fuser -k 80/tcp
参考文章:
http://www.cnblogs.com/skynet/p/4146083.html
本文出自 “点滴积累” 博客,请务必保留此出处http://tianxingzhe.blog.51cto.com/3390077/1684642
- fastdfs+nginx安装详解
- Nginx安装配置详解
- yum安装nginx详解
- Nginx安装详解
- fastdfs+nginx安装详解
- linux安装nginx详解
- Nginx安装配置详解
- Nginx安装配置详解
- nginx 安装详解
- Nginx安装及配置文件nginx.conf详解
- Nginx安装及配置文件nginx.conf详解
- Nginx安装及配置文件nginx.conf详解
- Nginx安装及配置文件nginx.conf详解
- Nginx安装及配置文件nginx.conf详解
- Nginx安装及配置文件nginx.conf详解
- Nginx安装及配置文件nginx.conf详解
- Nginx的安装目录详解
- nginx详解之安装与配置文件详解
- 网站注册图形验证码
- Dom对象和Jquery对象区别详解
- HttpSessionListener接口监听网站在线人数
- InitializingBean,FactoryBean详解
- jedis连接池详解(Redis)
- Nginx安装详解
- nginx反向代理入门
- ckeditor手动同步textarea
- ckeditor换kama皮肤
- redis队列处理文件并发(日志处理)
- ActiveMQ消息中间件Producer和Consumer
- 用户浏览器禁用了cookie,SessionID如何传递
- java和javascript双引号嵌套的问题
- LLD3学习笔记(2) hello world