Linux下Nginx服务安装配置
2017-03-21 15:34
549 查看
Linux下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
777 /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.4.tar.gz[root@rk
nginx]#cd nginx-1.9.4[root@rk
nginx-1.9.4]#./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地址,出现如下画面则安装启动完成
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
777 /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.4.tar.gz[root@rk
nginx]#cd nginx-1.9.4[root@rk
nginx-1.9.4]#./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地址,出现如下画面则安装启动完成
相关文章推荐
- linux之Rhel7的软件包管理及nginx服务的安装配置
- Linux服务中Nginx安装及配置
- LINUX 第四章 Linux(RHEL 5)中Bind服务的安装与配置全过程
- CentOS 5.2,Linux 2.6+ 内核 ,Apache+MySQL+PHP 安装及基本配置过程记录 && 将apache安装为系统服务
- linux 下 nginx 安装 配置
- 在linux中配置安装telnet服务
- linux/unix 安装配置DHCP服务
- linux环境下安装及配置sendmail服务(邮件服务)
- Linux环境VNC服务安装、配置与使用
- linux下FTP服务的安装与配置
- 转载备忘:【实验】【VNC】Linux环境VNC服务安装、配置与使用
- 【Linux系统和服务管理】MySQL服务器安装与配置(二)
- linux 下nginx安装与配置
- Linux(RHEL 5)中Bind服务的安装与配置全过程
- Linux环境VNC服务安装、配置与使用
- Linux学习笔记:REHL AS4的上网配置,Http服务安装及配置,ftp服务的安装及配置
- linux/unix 安装配置DHCP服务
- 【VNC】Linux环境VNC服务安装、配置与使用
- Linux与Windows 共享文件Samba 服务的安装于配置
- Linux环境VNC服务安装、配置、图文版