Nginx installation configuration under linux (centos7)

First talk about linux version: CentOS7 64 Wei

Next, the installation process:

Before you install nginx first determine whether the system has been installed gcc, PCRE-devel, zlib-devel, OpenSSL-devel .

You can use: yum List Installed | grep "or the name of the software package name"  to check whether the installation of a software package:

Example:

  Check whether the installed gcc

yum list installed | grep "gcc"

If the installation are mounting operation is performed: a key mounted thereon four dependency:

yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

Wait for the installation to complete.

After installation is complete, download and extract the installation package nginx:

First switch the directory to local:

cd /usr/local

Then create a folder nginx:

mkdir nginx

Then enter the nginx folder:

cd nginx

Then download and extract the compressed nginx: (tar command is not: yum install -y tar)

1 wget http: // nginx.org/download/nginx-1.13.7.tar.gz 
2 tar -xvf nginx-1.13.7.tar.gz

Then after entering the decompression nginx-1.13.7:

cd nginx-1.13.7

Nginx be installed: Perform the following command:

// execute the command 
./ the configure
 // execute the command make install 
make install

Then configure nginx.config:

cd /usr/local/nginx/nginx-1.13.7/conf

Then edit the config file:

vim nginx.conf

Press i to enter edit mode:

Try not to use the listening port 80; the server_name to access the address of your server;

Then edit the default esc exit,: mq save and exit;

Last start nginx:

/usr/local/nginx/sbin/nginx -s reload

You can turn off the firewall access server address:

The successful launch!

Guess you like

Origin www.cnblogs.com/ka-bu-qi-nuo/p/11843867.html