linux install and run nginx

installation:

Copy the download link to the official website: http: //nginx.org/download/nginx-1.17.5.tar.gz

Download: wget http://nginx.org/download/nginx-1.17.5.tar.gz

Mobile (watching professional): mv * .gz / usr / local / scr

Src directory into decompression: tar zxf nginx-1.17.5.tar.gz

Into the unpacked directory, create user without creating home directory: useradd -s / sbin / nologin -M www

直接编译安装:./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-pcre=/usr/local/src/pcre-8.37

然后:make & make install

 

run:

Every container up and running nginx:

nginx needs to be placed foreground, modify nginx configuration file:

vi /usr/local/nginx/conf/nginx.conf added: daemon off;

Exit container view, nginx has been running

 

Nginx do the base image, upload docker hub: Details, refer to: https: //www.cnblogs.com/yangyangming/p/11646666.html

docker commit -m "my nginx v1" container warehouse id name / my-nginx: v1

..........

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/yangyangming/p/11834096.html