Find the supported information on the official nginx website:
Currently, nginx packages are available for the following distributions and versions:
RHEL/CentOS:
Version |
Supported Platforms |
5.x |
X86_64, i386 |
6.x |
X86_64, i386 |
7. x |
X86_64 |
Debian:
Version |
Codename |
Supported Platforms |
6.x |
Squeeze |
X86_64, i386 |
7. x |
Wheezy |
X86_64, i386 |
8. x |
Jessie |
X86_64, i386 |
Ubuntu:
Version |
Codename |
Supported Platforms |
10.04 |
Lucid |
X86_64, i386 |
12.04 |
Precise |
X86_64, i386 |
14.04 |
Trusty |
X86_64, i386, aarch64/arm64 |
14.10 |
Utopic |
X86_64, i386 |
SLES:
To enable automatic update of Linux packages set up the yum repository for the RHEL/CentOS distributions, the apt repository for the Debian/Ubuntu distributions, or the zypper repository for SLES.
We can see that CentOS is installed through yum. Run the following command:
# Rpm-ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
# Yum-y install nginx
The installation is successful, and then the service is enabled, and a port conflict is reported. (Because apache is installed with Port 80 in advance)
# Service nginx start
Starting nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] bind () to 0.0.0.0: 80 failed (98: Address already in use)
Nginx: [emerg] still cocould not bind ()
[FAILED]
Find the nginx configuration file.
# Vim/etc/nginx. conf
There is a "include/etc/nginx/conf. d/*. conf;", and the file/etc/nginx/conf. d/default. conf is found again.
Vim/etc/nginx/conf. d/default. conf
Change listen 80 to listen 8080, and then start nginx.
1
# Service nginx restart
Open the browser and enter http: // localhost: 8080/. The following content is displayed.
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Specified cial support is available at nginx.com.