linux 安装nginx
2016-07-27 22:33
686 查看
一、
wget http://nginx.org/download/nginx-1.5.9.tar.gz直接在Linux上用命令下载[/code]
二、解压 tar -zxvf nginx-1.5.9.tar.gz
三、设置一下配置信息 ./configure --prefix=/usr/local/nginx
四、make 编译
五、make install 安装
在配置信息的时候,也就是在第三步,出现了一下错误:错误为:./configure: error: the HTTP rewrite module requires the PCRE library. 安装pcre-devel解决问题 yum -y install pcre-devel错误提示:./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. 解决办法: yum -y install openssl openssl-devel
./nginx -v 先打开/usr/local/nginx/sbin 再执行命令
安装成功后,只能本地访问,还需要设置防火墙vim /etc/sysconfig/iptables 编辑防火墙文件 新增 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT //--防火墙不拦截80端口 保存退出 :wq service iptables restart 重启防火墙
卸载方式:
直接删除安装目录//启动 ./nginx //关闭 pkill nginx
还有些其他方式关闭启动,网上搜就可以
相关文章推荐
- Apache与Nginx的优缺点比较
- nginx 菜鸟入门一
- windows下使用nginx
- Nginx 项目部署和配置
- nginx Address already in use 解决方案
- Centos 下安装 Nginx
- awstats 分析nginx 日志
- nginx配置优化+负载均衡+动静分离(附带参数解析)
- 开启nginx状态监控
- Nginx之location 匹配规则详解
- Nginx安装upstream-fair模块(第三方模块)
- Nginx源码编译安装
- 正向代理服务器暴露访问者ip的选项
- nginx基本配置与参数
- nginx配置location总结及rewrite规则写法
- nginx 改变标题 ngx_setproctitle
- Nginx + Lua
- **NGINX简单access日志查询分析**
- 处理一起IIS的FastCGI解析漏洞
- Nginx Location语法规则