分享

nginx在Linux环境下面的安装介绍

 昵称17690251 2015-06-28
           今天我们这篇关于web服务器nginx的介绍,主要是这个nginx系列技术文章的开始,所以我们来介绍一下关于Linux环境下面的nginx的安装方面的知识。下面进入我们今天的nginx的课程,介绍一下关于nginx的安装。

1.为了让nginx的可以顺利安装,我们需要做一些准备的工作。为了支持rewrite功能,我们需要安装pcre


#如过你已经装了,请跳过这一步
yum install pcre*

需要ssl的支持,如果不需要ssl支持,请跳过这一步

yum install openssl*


接下来是我们正在安装nginx的方式,可以通过下面的方式进行安装nginx哦

# ./configure --prefix=/usr/local/nginx-1.5.1 \
--with-http_ssl_module --with-http_spdy_module \
--with-http_stub_status_module --with-pcre

当然下载和解压,这里我们就没有过多的介绍了,大家可以使用wget和tar进行分别的下载和解压哦,我们下面对参数进行相关的介绍,让大家大致明白生成配置文件的介绍

–with-http_stub_status_module:支持nginx状态查询
–with-http_ssl_module:支持https
–with-http_spdy_module:支持google的spdy,想了解请百度spdy,这个必须有ssl的支持
–with-pcre:为了支持rewrite重写功能,必须制定pcre

最后输出如下内容,表示configure OK了。


checking for zlib library ... found
creating objs/Makefile
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
nginx path prefix: "/usr/local/nginx-1.5.1"
nginx binary file: "/usr/local/nginx-1.5.1/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx-1.5.1/conf"
nginx configuration file: "/usr/local/nginx-1.5.1/conf/nginx.conf"
nginx pid file: "/usr/local/nginx-1.5.1/logs/nginx.pid"
nginx error log file: "/usr/local/nginx-1.5.1/logs/error.log"
nginx http access log file: "/usr/local/nginx-1.5.1/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
# make //确定你的服务器有安装make,如果没有安装请执行yum install make
# make install


好了,nginx的安装还是非常的简单的,当然这里没有过多的介绍关于nginx遇到的问题。因为问题可能类型会非常的多,大家可以根据具体的错误的提示的内容,直接Google或者百度一下就可以了。下面我们来说说关于nginx的启动、关闭、重置nginx的内容。

启动:直接执行以下命令,nginx就启动了,不需要改任何配置文件,nginx配置多域名虚拟主机请参考后续文章.


/usr/local/nginx-1.5.1/sbin/nginx

测试一下我们的nginx是否可以成功的启动了

[root@ns conf]# curl -s http://localhost | grep nginx.com
nginx.com.

接下来说说如何进行把nginx的服务关闭掉,我们可以通过下面的方式

/usr/local/nginx-1.5.1/sbin/nginx -s stop

当然,在我们的nginx运行过程中,可能你需要修改nginx的相关配置,可以重置加载配置信息

/usr/local/nginx-1.5.1/sbin/nginx -s reload

整个nginx的安装就到这里结束了。不知道对于使用nginx的初学者朋友们是否有帮助呢        

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多