Nginx服务安装配置
1、Nginx介绍
Nginx是一个高性能的HTTP和反向代理服务器,由俄罗斯人开发的,第一个版本发布于2004年10月4日。Nginx由于出色的性能,在世界范围内受到了越来越多人的关注,其特点是占有内存少,并发能力强,nginx的并发能力确实在同类型的网页服务器中是很强的,国内BAT、163、新浪等等都在使用nginx进行服务发布和管理。Nginx还对负载均衡等提供了非常方便的配置,同时Nginx众多的插件和功能集成更是让Nginx成为某些WEB应用场景的不二选择。以上的内容或许稍显夸张,只因为鄙人是Nginx的忠实粉丝,见仁见智吧,起码Nginx是一种非常好的选择。
Nginx官网地址:http://nginx.org/
2、Nginx服务安装
Nginx提供了对主流Linux操作系统的支持,Windwos下也有相应的版本,但由于操作系统的一些限制,在Windows操作系统上部分功能缺失,在性能上也也较大的差距。Nginx在windows上安装配置:http://nginx.org/en/docs/windows.html
Linux下Nginx也提供了标准的RPM包,直接安装后配置即可使用,非常方便。但标准包里的组件都是是固定的,对以后组件的扩展等不是很好,而且路径的配置也比较固定。
使用标准包安装地址:
命令如下:rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el6.ngx.noarch.rpm
这里我选择了源码编译安装。安装步骤如下:
1>安装依赖库
[root@rk /]#yum install gcc-c++
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
[root@rk /]#yum -y install gcc automake autoconf libtool make
2>创建安装目录,下载安装包
[root@rk /]#mkdir /usr/nginx
[root@rk /]#chmod /usr/nginx
[root@rk /]#cd /usr/nginx
[root@rk nginx]#cd wget http://nginx.org/download/nginx-1.9.4.tar.gz
3>解压配置
[root@rk nginx]#tar -zxvf nginx-1.9..tar.gz
[root@rk nginx]#cd nginx-1.9.
[root@rk nginx-1.9.]#./configure --prefix=/usr/webserver/nginx
--sbin-path=/usr/webserver/nginx
--conf-path=/usr/webserver/nginx/nginx.conf
--error-log-path=/home/databak/log/nginx/error.log
--http-log-path=/home/databak/log/nginx/access.log
--pid-path=/usr/webserver/nginx/run/nginx.pid
--lock-path=/usr/webserver/nginx/run/nginx.lock
--http-client-body-temp-path=/home/databak/cache/nginx/client_temp --http-proxy-temp-path=/home/databak/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/home/databak/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/home/databak/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/home/databak/cache/nginx/scgi_temp
--with-http_image_filter_module
--with-http_ssl_module
--with-http_realip_module
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module
--with-http_gzip_static_module
--with-http_random_index_module
--with-http_secure_link_module
--with-http_stub_status_module
--with-http_auth_request_module
--with-mail --with-mail_ssl_module
--with-file-aio
--with-http_spdy_module
--with-ipv6
--with-threads
--with-stream
--with-stream_ssl_module
4>编译
[root@rk nginx-1.9.4]#make && make install
编译成功后Nginx就安装好了。
5>重启服务
[root@rk nginx]#./nginx -c nginx.conf
6>测试
浏览器中输入Nginx地址,出现如下画面则安装启动完成

PS:
1、在某些服务器上openssl--devel可能需要单独下载安装 然后在编译的时候指定目录即可。命令请参考:
cd /usr/nginx
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar -zxvf openssl-1.0.1c.tar.gz 编译时指定目录:
--with-openssl=/usr/nginx/openssl-1.0.1c
2、如果编译时安装--with-http_image_filter_module,需要安装yum install gd-devel,请参考文章 http://www.cnblogs.com/tintin1926/archive/2012/07/11/2586624.html
3、在安装时如果出现如下错误:POD document had syntax errors at /usr/bin/pod2man line 69. make .
解决如下:
rm /usr/bin/pod2man
4、最新版本配置
./configure --prefix=/opt/nginx/webserver --sbin-path=/opt/nginx/webserver/nginx --conf-path=/opt/nginx/webserver/nginx.conf --error-log-path=/opt/nginx/webserver/log/error.log --http-log-path=/opt/nginx/webserver/log/access.log --pid-path=/opt/nginx/webserver/run/nginx.pid --lock-path=/opt/nginx/webserver/run/nginx.lock --http-client-body-temp-path=/opt/nginx/webserver/client_temp --http-proxy-temp-path=/opt/nginx/webserver/proxy_temp --http-fastcgi-temp-path=/opt/nginx/webserver/fastcgi_temp --http-uwsgi-temp-path=/opt/nginx/webserver/uwsgi_temp --http-scgi-temp-path=/opt/nginx/webserver/scgi_temp --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-threads --with-stream --with-stream_ssl_module
Nginx服务安装配置的更多相关文章
- Linux下的python3,virtualenv,Mysql、nginx、redis等常用服务安装配置
Linux下的python3,virtualenv,Mysql.nginx.redis等常用服务安装配置 学了前面的Linux基础,想必童鞋们是不是更感兴趣了?接下来就学习常用服务部署吧! 安装环 ...
- nginx+tomcat安装配置
nginx+tomcat安装配置 # nginx+tomcat安装配置 #创建网站目录 mkdir -p /www/wwwroot cd /www #安装配置 wget http://mirrors. ...
- Nginx的安装配置和tomcat负载均衡
Nginx简介 什么是nginx? Nginx是一款高性能的http 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器.由俄罗斯的程序设计师Igor Sysoev所开发,官方测试ngi ...
- nginx php-fpm安装配置 CentOS编译安装php7.2
CentOS编译安装php7.2 介绍: 久闻php7的速度以及性能那可是比php5系列的任何一版本都要快,具体性能有多好,建议还是先尝试下再说.如果你是升级或新安装,那你首先需要考虑php7和程序是 ...
- 吴裕雄--天生自然Django框架开发笔记:Django Nginx+uwsgi 安装配置
Django Nginx+uwsgi 安装配置 使用 python manage.py runserver 来运行服务器.这只适用测试环境中使用. 正式发布的服务,需要一个可以稳定而持续的服务器,比如 ...
- Asterisk服务安装配置和启动
Asterisk服务安装配置和启动 2014年11月4日 11:36 注意: 更新源的重要性 源的地址: http://fffo.blog.163.com/blog/static/2119130682 ...
- nginx初级安装配置
nginx初级安装配置 转自:(lykyl原创)http://www.cnblogs.com/lykyl/archive/2012/11/21/2781077.html 实验环境:系统 CENTOS5 ...
- gerrit+nginx+centos安装配置
安装环境 centos 6.8 gerrit-full-2.5.2.war 下载地址:https://gerrit-releases.storage.googleapis.com/gerrit-ful ...
- ubuntu14.04 server ftp 服务安装配置详解
ubuntu14.04 server ftp 服务安装配置详解 cheungmine 2016-01-27 http://wiki.ubuntu.com.cn/Vsftpd 0 安装好vsftpd服务 ...
随机推荐
- Centos6 yum安装openldap+phpldapadmin+TLS+双主配置
原文地址:http://54im.com/openldap/centos-6-yum-install-openldap-phpldapadmin-tls-%E5%8F%8C%E4%B8%BB%E9%8 ...
- CSS魔法堂:重拾Border之——不仅仅是圆角
前言 当CSS3推出border-radius属性时我们是那么欣喜若狂啊,一想到终于不用再添加额外元素来模拟圆角了,但发现border-radius还分水平半径和垂直半径,然后又发现border-t ...
- Spring Scope:Web项目中如何安全使用有状态的Bean对象?
Web系统是最常见的Java应用系统之一,现在流行的Web项目多使用ssm或ssh框架,使用spring进行bean的管理,这为我们编写web项目带来了很多方便,通常,我们的controler层使用注 ...
- AssetsManagerEx 组件使用说明
原因 在网络上找了一圈也没有找到一个像样的说明.如果不是我们技术组的大大说这个东西可以用我都快放弃了. 稍微阅读了一下这个组件的源代码.发现该有的功能都有(如下所列). 其实最初吸引我们用这个东西的功 ...
- LINQ to SQL语句(12)之Delete和使用Attach
1.简单形式 说明:调用DeleteOnSubmit方法即可. OrderDetail orderDetail = db.OrderDetails.First (c => c.OrderID = ...
- jQuery网页版五子棋小游戏源码下载
体验效果:http://hovertree.com/texiao/game/4/ 网页五子棋源代码: <!DOCTYPE html> <html> <head> & ...
- 转载:《TypeScript 中文入门教程》 15、可迭代性
版权 文章转载自:https://github.com/zhongsp 建议您直接跳转到上面的网址查看最新版本. 可迭代性 当一个对象实现了Symbol.iterator属性时,我们认为它是可迭代的. ...
- 从零开始学 Java - Spring MVC 统一异常处理
看到 Exception 这个单词都心慌 如果有一天你发现好久没有看到Exception这个单词了,那你会不会想念她?我是不会的.她如女孩一样的令人心动又心慌,又或者你已经练功到了孤独求败,等了半辈子 ...
- 【新年呈献】高性能 Socket 组件 HP-Socket v3.1.2 正式发布
HP-Socket 是一套通用的高性能 Windows Socket 组件包,包含服务端组件(IOCP 模型)和客户端组件(Event Select 模型),广泛适用于 Windows 平台的 TCP ...
- 【特别推荐】小伙伴们惊呆了!8个超炫的 Web 效果
CodePen 是一个在线的 HTML.CSS 和 JavaScript 代码编辑器,能够编写代码并即时预览效果.你在上面可以在线展示自己的作品,也可以看到其他人在网页中实现的各种令人惊奇的效果. 今 ...