Install nginx-1.10.2 under Linux (RHEL7.0), nginx1.10linux Installation
Check whether the current system version is supported
Currently, the nginx release package supports the following Linux operating system versions:
RHEL/CentOS:
Version |
Supported Platforms |
5.x |
x86_64, i386 |
6.x |
x86_64, i386 |
7.x |
x86_64, ppc64le |
Debian:
Version |
Codename |
Supported Platforms |
7.x |
wheezy |
x86_64, i386 |
8.x |
jessie |
x86_64, i386 |
Ubuntu:
Version |
Codename |
Supported Platforms |
12.04 |
precise |
x86_64, i386 |
14.04 |
trusty |
x86_64, i386, aarch64/arm64 |
16.04 |
xenial |
x86_64, i386, ppc64el |
SLES:
Version |
Supported Platforms |
12 |
x86_64 |
You can enter the command "cat/etc/OS-release" on the command line to view the current operating system version, as shown below:
[Root @ localhost local] # cat/etc/OS-release
NAME = "Red Hat Enterprise Linux Server"
VERSION = "7.0 (Maipo )"
ID = "rhel"
ID_LIKE = "fedora"
VERSION_ID = "7.0"
PRETTY_NAME = "Red Hat Enterprise Linux Server 7.0 (Maipo )"
ANSI_COLOR = "0; 31"
CPE_NAME = "cpe:/o: redhat: enterprise_linux: 7.0: GA: server"
HOME_URL = "https://www.redhat.com /"
BUG_REPORT_URL = "https://bugzilla.redhat.com /"
REDHAT_BUGZILLA_PRODUCT = "Red Hat Enterprise Linux 7"
Redhat_buckets gzilla_product_version = 7.0
REDHAT_SUPPORT_PRODUCT = "Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION = 7.0
It can be seen that the operating system belongs to RHEL7.X and meets the requirements.
Download
You can enter the wget http://nginx.org/download/nginx-1.10.2.tar.gz command to get the resource package directly from the Internet, you can also download.
I downloaded the nginx-1.10.2.tar.gz package from the official network and put it in the/usr/local directory;
Enter the tar-zxvf nginx-1.10.2.tar.gz command to decompress the package.
Configuration
Enter the decompressed directory:
cd /usr/local/nginx-1.10.2
Start configuration. You can configure various parameters and whether to enable certain modules. For detailed configuration parameters, refer to the official website for detailed instructions,
Http://nginx.org/en/docs/configure.html
My configuration is as follows:
./configure --prefix=/usr/local/nginx-1.10.2 --conf-path=/usr/local/nginx-1.10.2/nginx.conf --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-mail --with-mail_ssl_module
Compile
Run the following command:
make && make install
Start the service
Enter the sbin directory, enter the nginx command, and restart the command nginx-s reload.
Verify whether the service is started
Check the process. The following is my nginx service process.
Root 20646 1 0 :04? 00:00:00 nginx: master process nginx
Nobody 20647 20646 0? 00:00:00 nginx: Problems with worker process
1. "conf/koi-win" and "/usr/local/nginx/conf/koi-win" are the same files"
Add the -- conf-path parameter to the configuration.
2. nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
If the port is in use, modify the port number. Here I have a tomcat port configured to 80 and changed it to another one.