nginx-1.11.10 download, install, start and stop

Environment:(CentOS 7)

1 [[email protected]_x1 nginx-1.11.10]$ uname -a
2 Linux netlab_x1 3.10.0-327.28.2.el7.x86_64 #1 SMP Wed Aug 3 11:11:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Download:

1 # download and uncompress
2 wget http://nginx.org/download/nginx-1.11.10.tar.gz
3 tar -zxvf nginx-1.11.10.tar.gz
4 cd nginx-1.11.10/

Installation: (tree command can help you understand the construction of the directory)

1 # configuration
2 ./configure
3 # compile
4 make
5 # install, permission needed. Default installation path: /usr/local/nginx
6 sudo make install
 1 [[email protected]_x1 nginx]$ pwd
 2 /usr/local/nginx
 3 [[email protected]_x1 nginx]$ ls
 4 client_body_temp  conf  fastcgi_temp  html  logs  proxy_temp  sbin  scgi_temp  uwsgi_temp
 5 [[email protected]_x1 nginx]$ ll
 6 total 8.0K
 7 drwxr-xr-x  11 root   root  142 Feb 17 13:13 .
 8 drwxr-xr-x. 15 root   root 4.0K Feb 17 12:27 ..
 9 drwx------   2 nobody root    6 Feb 17 13:13 client_body_temp
10 drwxr-xr-x   2 root   root 4.0K Feb 17 12:27 conf
11 drwx------   2 nobody root    6 Feb 17 13:13 fastcgi_temp
12 drwxr-xr-x   2 root   root   38 Feb 17 12:27 html
13 drwxr-xr-x   2 root   root   55 Feb 17 16:48 logs
14 drwx------   2 nobody root    6 Feb 17 13:13 proxy_temp
15 drwxr-xr-x   2 root   root   18 Feb 17 12:27 sbin
16 drwx------   2 nobody root    6 Feb 17 13:13 scgi_temp
17 drwx------   2 nobody root    6 Feb 17 13:13 uwsgi_temp
18 [[email protected]_x1 nginx]$ tree
19 .
20 ├── client_body_temp [error opening dir]
21 ├── conf
22 │   ├── fastcgi.conf
23 │   ├── fastcgi.conf.default
24 │   ├── fastcgi_params
25 │   ├── fastcgi_params.default
26 │   ├── koi-utf
27 │   ├── koi-win
28 │   ├── mime.types
29 │   ├── mime.types.default
30 │   ├── nginx.conf
31 │   ├── nginx.conf.default
32 │   ├── scgi_params
33 │   ├── scgi_params.default
34 │   ├── uwsgi_params
35 │   ├── uwsgi_params.default
36 │   └── win-utf
37 ├── fastcgi_temp [error opening dir]
38 ├── html
39 │   ├── 50x.html
40 │   └── index.html
41 ├── logs
42 │   ├── access.log
43 │   ├── error.log
44 │   └── nginx.pid
45 ├── proxy_temp [error opening dir]
46 ├── sbin
47 │   └── nginx
48 ├── scgi_temp [error opening dir]
49 └── uwsgi_temp [error opening dir]
50
51 9 directories, 21 files

Start:

1 [[email protected]_x1 nginx]$ sudo sbin/nginx
2 [[email protected]_x1 nginx]$ ps -ef | grep nginx
3 root      3285     1  0 16:48 ?        00:00:00 nginx: master process sbin/nginx
4 nobody    3286  3285  0 16:48 ?        00:00:00 nginx: worker process
5 leaf      4514 41344  0 18:04 pts/1    00:00:00 grep --color=auto nginx

Default Pages:(or http://localhost:80)

Simple Pages (Hello World!)

revise html:(html/index.html)

<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Hello World!</h1>
<p><em>Start your journey on nginx!</em></p>
</body>
</html>

New pages:

Stop:

1 # Two ways
2 # In this way, the server would stop immediately.
3 sudo sbin/nginx -s stop
4 # In this way, the server would process the current tasks and exit
5 sudo sbin/nginx -s quit
6 # using ps command, the worker and master processes are quited
7 ps -ef | grep nginx
时间: 2024-12-28 23:21:18

nginx-1.11.10 download, install, start and stop的相关文章

ubuntu 11.10 (64bit) install opencv 2.4.8 and run in Qtcreator

install gtk2+ sudo apt-get install libgtk2.0*sudo apt-get install cmake-qt-gui tar xzvf opencv-2.4.8.tar.gz mkdir build in the ~ dir the opencv-2.4.8 in the same ~ dir run cmake-qt-gui cd to the build dir run make if the error (2.4.8)error:   /opencv

Install odoo 11(10) on centos7

https://www.odoo.com/documentation/11.0/setup/install.html https://nightly.odoo.com/ https://www.odoo.com/zh_CN/forum/help-1/question/installing-odoo-11-in-centos-6-9-and-in-a-virtual-environment-for-python-3-6-126207 https://linuxize.com/post/instal

centos 1.7 安装nginx 1.9.10

可以参考以前安装成功的案例 centos 7.0 nginx 1.7.9成功安装过程 官网下载 http://nginx.org/en/download.html nginx下载位置 /usr/local/ nginx 安装目录 /usr/etc/nginx1910 nginx path prefix: "/usr/etc/nginx1910" nginx binary file: "/usr/etc/nginx1910/sbin/nginx" nginx conf

centos 7 安装 nginx-1.11.10(腾讯云)

在centos 7 下安装 nginx-1.11 前需要先切换到root环境,通过命令 su root 切换,然后再输入密码, 如果不能切换需要把下载的nginx文件夹给予777的权限 bash#su root 密码输入 下载nginx-1.11.10的压缩包文件到根目录,官网下载地址:nginx.org/download/nginx-1.11.10.tar.gz #yum update #wget nginx.org/download/nginx-1.11.10.tar.gz 解压tar.gz

Centos6.7安装nginx-1.11.10

yum grouplist #查看已经安装的组 Installed Groups:  #已经安装的组 Available Groups:    #可以安装的组 同步系统时间 编译安装nginx 安装#yum -y groupinstall "Development Tools" "Server Platform Libraries" #tar xf nginx-1.10.2.tar.gz #cd nginx-1.10.2 #groupadd -r -g 108 ng

Nginx系列-11.配置Nginx反向代理和负载均衡

Nginx系列-11.配置Nginx反向代理和负载均衡 目录 - Nginx系列 Nginx系列-1.Linux下安装Nginx Nginx系列-2.配置LNMP(Linux.Nginx.MySQL.PHP)架构 Nginx系列-3.配置Nginx虚拟主机 Nginx系列-4.Nginx日志配置及日志切割 Nginx系列-5.配置Nginx的防盗链 Nginx系列-6.配置Nginx的HTTPS Nginx系列-7.配置Nginx使用uwsgi支持web.py框架 Nginx系列-8.配置Ngi

ubuntu 11.10 安装apache2 tomcat6

ubuntu 11.10 安装apache2 tomcat6 导读 Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache.Sun 和其他一些公司及个人共同开发而成.由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat 中得到体现,Tomcat 5支持最新的Servlet 2.4 和JSP 2.0 规范.因为Tomcat 技术先进.性能稳定,而且免费,因而深受Java

Ubuntu 11.10 (Oneiric)上编译带utrace补丁的内核 转

Ubuntu 11.10 (Oneiric)上编译带utrace补丁的内核 首先准备linux内核编译环境: sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge kernel-package sudo apt-get build-dep linux sudo apt-get install git-core libncurses5 libncurses5-dev lib

Ubuntu 11.10 安装GMONE3,卸载 UNITY和UNITY 2D

Ubuntu 11.10安装GNOME3: 1)sudo apt-get install gnome-shell sudo apt-get install gnome-themes* (或者简单的选择 sudo apt-get install gnome-themes-standard) sudo apt-get install gnome-tweak-tool 2)sudo apt-get install gnome-session-fallback 卸载 UNITY和UNITY 2D: su