1、下载nginx的源代码
/Install  -->linux
download nginx-1.0.
2、下载nginx的依赖库源代码
/  --> ftp
download pcre-8.30.zip
3、安装pcre的依赖库
apt -get install gcc g++
4、安装pcre
unzip pcre-8.30.zip
./configure
make
sudo make install
5、安装nginx
tar -zxvf nginx-1.0.
./configure
sudo make
sudo make install
6、如果启动时报libpcre.so.1。。。不到,就执行下面这句话
sudo ln -s ./libpcre.so.1 /lib/libpcre.so --ok
-------------------------------
FAQ启动、关闭、重启等命令
linux离线安装nginx详细教程/CommandLine ::::
Starting Nginx
Nginx is invoked from the command line, usually from /usr/bin/nginx.
Basic Example of Starting Nginx
/usr/bin/nginx
Advanced Example of Starting Nginx
/usr/bin/nginx -t -c ~/f -g "pid /var/run/nginx.pid; worker_processes 2;"
Options
Nginx has only a few command-line parameters. Unlike many other software systems, the configuration is done entirely via the configuration file (imagine that).
-c </path/to/config> Specify which configuration file Nginx should use instead of the default.
-g Set global directives. (version >=0.7.4)
-t Don't run, just test the configuration file. nginx checks configuration for correct syntax and then try to open files referred in configuration.
-s signal Send signal to a master process: stop, quit, reopen, reload. (version >= 0.7.53)
-v Print version.
-V Print nginx version, compiler version and configure parameters.
-p prefix Set prefix path (default: /usr/local/nginx/). (version >= 0.7.53)
-h,-? Print help.
-------------------------------
Stopping or Restarting Nginx
There are two ways to control Nginx once it's already running. The first is to call Nginx again with the -s command line parameter. For example,
/usr/bin/nginx -s stop
will stop the Nginx server. (other '-s' options are given in the previous section)
The second way to control Nginx is to send a signal to the Nginx master process.. By default nginx writes its master process id to /usr/local/nginx/logs/nginx.pid. You can change this by passing parameter with ./configure at compile-time or by using pid directive in the configuration file. Here's how to send the 'QUIT' (Graceful Shutdown) signal to the Nginx master process:
kill -QUIT $( cat /usr/local/nginx/logs/nginx.pid )
-------------------------------

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。