For more information about how to compile and install, see my other blog: http://blog.csdn.net/sheismylife/article/details/6744394
For how to use the default nginx version of ubuntu directly, see: http://blog.csdn.net/sheismylife/article/details/8140591
However, the nginx version installed under ubuntu13.04 by default is 1.2.x, which is too low.
The following describes how to obtain the latest installation package:
1. Add key
Wget http://nginx.org/keys/nginx_signing.keyapt-key add nginx_signing.key
2. Create the/etc/APT/sources. List. d/nginx. list file with the following content:
Deb http://nginx.org/packages/mainline/ubuntu/ raring nginxdeb-Src http://nginx.org/packages/mainline/ubuntu/ raring nginxdeb
3. Update and install:
Apt-Get updateapt-Get install nginx
4. Check the version.
Nginx-vnginx version: nginx/1.5.0
5. Command Line
The nginx script is created in the/etc/init. d/directory. The script supports several command parameters:
Echo "Usage: $ scriptname {START | stop | status | restart | reload | force-Reload | upgrade | configtest}"> & 2
Very easy to use. For example, test the configuration parameters:
Service nginx configtestnginx: the configuration file/etc/nginx. conf syntax is oknginx: configuration file/etc/nginx. conf test is successful
6. process ID
Http://nginx.org/en/docs/control.html, according to official documents
The process ID file is in
/Usr/local/nginx/logs/nginx. PID
However, in the nginx script file
/Var/run/nginx. PID
7. compile options. Use-V to view and compile nginx.ProgramCompilation options:
Nginx-vnginx version: nginx/1.5.0built by GCC 4.7.3 (Ubuntu/linaro 4.7.3-1ubuntu1) tls sni support enabledconfigure arguments: -- prefix =/etc/nginx -- sbin-Path =/usr/sbin/nginx -- conf-Path =/etc/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-mail -- with-mail_ssl_module -- With-file-AIO -- with-http_spdy_module -- with-ipv6
It is basically enough. If you want to enable the debug log, this version does not exist. You need to compile nginx and use the following parameters:
-- With-Debug
Reference official documents: http://nginx.org/en/docs/debugging_log.html