欢迎来到 黑吧安全网 聚焦网络安全前沿资讯,精华内容,交流技术心得!

Ubuntu 13.04 编译安装最新版本的Nginx

来源:本站转载 作者:佚名 时间:2014-01-22 TAG:Ubuntu Nginx 我要投稿

 下面描述如何获取最新的安装包:

1.添加key

wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key

2.创建/etc/apt/sources.list.d/nginx.list文件,内容如下:

deb http://nginx.org/packages/mainline/ubuntu/ raring nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ raring nginx

3.更新及安装:

apt-get update
apt-get install nginx

4.检查一下版本

nginx -v
nginx version: nginx/1.5.0

5. 命令行

前面的安装在/etc/init.d/目录下创建了nginx脚本,该脚本支持几个命令参数:

echo “Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload|upgrade|configtest}” >&2

非常好用。比如测试配置的参数:

service nginx configtest
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

6. 进程id

官方文档说:http://nginx.org/en/docs/control.html

进程id文件默认在

/usr/local/nginx/logs/nginx.pid

但实际上在nginx脚本文件中将其放在了

/var/run/nginx.pid

7. 编译选项,用-V可以查看编译nginx程序编译时的选项:

nginx -V
nginx version: nginx/1.5.0
built by gcc 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)
TLS SNI support enabled
configure arguments: –prefix=/etc/nginx –sbin-path=/usr/sbin/nginx –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –pid-path=/var/run/nginx.pid –lock-path=/var/run/nginx.lock –http-client-body-temp-path=/var/cache/nginx/client_temp –http-proxy-temp-path=/var/cache/nginx/proxy_temp –http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp –http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp –http-scgi-temp-path=/var/cache/nginx/scgi_temp –user=nginx –group=nginx –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-mail –with-mail_ssl_module –with-file-aio –with-http_spdy_module –with-ipv6

[1] [2]  下一页

【声明】:黑吧安全网(http://www.myhack58.com)登载此文出于传递更多信息之目的,并不代表本站赞同其观点和对其真实性负责,仅适于网络安全技术爱好者学习研究使用,学习中请遵循国家相关法律法规。如有问题请联系我们,联系邮箱admin@myhack58.com,我们会在最短的时间内进行处理。
  • 最新更新
    • 相关阅读
      • 本类热门
        • 最近下载