install nginx
nginx help documentation: http: //nginx.org/en/docs/
Embodiment 1:
Source Package mounted
respectively and extracting nginx-1.9.8.tar.gz-2.3.tar.gz ngx_cache_purge
the tar -xvf nginx-1.9.8.tar.gz -C / usr / local / the src
the tar -xvf ngx_cache_purge- 2.3.tar.gz -C / usr / local / src
Entering the nginx nginx-1.9.8 compile mounted installation directory:
./configure --prefix = / usr / local / nginx --user = WebLogic WebLogic --group = --with-http_stub_status_module --with-PCRE - add-module = /usr/local/src/ngx_cache_purge-2.3 --with-http_gzip_static_module --with-stream
Compile and install will need to rely on a lot, if it is found at compile time missing one of its dependencies when you can execute
yum install zlib zlib-devel gcc- c ++ libtool openssl openssl-devel
Compile and install the compiler:
the make the make install &&
启动nginx
/usr/local/nginx/sbin/nginx
Embodiment 2:
Configure nginx yum source mounting version 1.16.1
Reference document: http: //nginx.org/en/linux_packages.html#RHEL-CentOS
RedHat 7.4 nginx rpm corresponding packet (packet contain other modules) Download: http : //nginx.org/packages/centos/7/
配置yum源
vim /etc/yum.repos.d/nginx.repo,加入:
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/releasever/ releasever/releasever/basearch/ 此行需要改为baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
Description
$ releasever system version, such as 7
$ basearch as cpu architectures such as x86_64, this may not change
yum clean all
yum repolist
View source nginx yum info:
yum info nginx
Installation:
yum install nginx
nginx usage:
view a list of files nginx:
RPM -ql nginx
know the main configuration file for the /etc/nginx/nginx.conf
Source installation default save location: / usr / local / nginx
we are using yum install source, direct input: nginx to start
View help documentation nginx: nginx -h
Stop nginx: nginx -s stop
nginx configuration check: nginx -t
nginx version query: -v nginx
nginx view the version and compilation options: nginx -V
Mangcang suitable person, three meals a day and anti-belly still really; suitable Barry, Chung food places; suitable Trinidad who gather food in March.