Nginx 是一款轻量级的 Web 服务器/方向代理服务器及电子邮箱(IMAP/POP3)代理服务器,其特点是占内存少,并发能力强。
Nginx 以事件驱动的方式编写,所以有非常好的性能,同时也是一个非常高效的反向代理、负载平衡。
官网提供三个下载版本: Mainline version; Stable version; Legacy versions
官方文档: [http://nginx.org/en/docs/]也可按照官方文档提供的方法进行安装,选择自己对应的Linux系统,本示例为CentOS7系统
安装依赖$ sudo yum install yum-utils
docker-ce-stable | 3.5 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 2.9 kB 00:00:00
gitlab_gitlab-ce/x86_64/signature | 836 B 00:00:00
...
软件包 yum-utils-1.1.31-52.el7.noarch 已安装并且是最新版本
无须任何处理
安装nginx
$ sudo yum install nginx
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
gitlab_gitlab-ce/x86_64/signature | 836 B 00:00:00
gitlab_gitlab-ce/x86_64/signature | 1.0 kB 00:00:00 !!!
...
验证中 : gd-2.0.35-26.el7.x86_64 10/12
验证中 : 1:nginx-mod-http-xslt-filter-1.16.1-1.el7.x86_64 11/12
验证中 : 1:nginx-mod-http-image-filter-1.16.1-1.el7.x86_64 12/12
启动
$ nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]: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 [::]:80 failed (98: Address already in use)