- Nginx (engine x) 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器。Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Rambler.ru站点(俄文:Рамблер)开发的,第一个公开版本0.1.0发布于2004年10月4日。
- 其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。2011年6月1日,nginx 1.0.4发布。
- Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行。其特点是占有内存少,并发能力强,事实上nginx的并发能力确实在同类型的网页服务器中表现较好,中国大陆使用nginx网站用户有:百度、京东、新浪、网易、腾讯、淘宝等。
安装Nginx
|
打开浏览器,访问127.0.0.1,如过你是远程访问的服务器或者虚拟机,使用对应的IP地址。nginx默认的端口号设置就是80。
- nginx path prefix: "/usr/local/nginx"
- nginx binary file: "/usr/local/nginx/sbin/nginx"
- nginx modules path: "/usr/local/nginx/modules"
- nginx configuration prefix: "/usr/local/nginx/conf"
- nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
- nginx pid file: "/usr/local/nginx/logs/nginx.pid"
- nginx error log file: "/usr/local/nginx/logs/error.log"
- nginx http access log file: "/usr/local/nginx/logs/access.log"
- nginx http client request body temporary files: "client_body_temp"
- nginx http proxy temporary files: "proxy_temp"
- nginx http fastcgi temporary files: "fastcgi_temp"
- nginx http uwsgi temporary files: "uwsgi_temp"
- nginx http scgi temporary files: "scgi_temp"
http://www.tiejiang.org/system/linux-operation/page/2
[root@panyu001 nginx]# ./sbin/nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
[root@panyu001 ~]# yum install -y net-tools
[root@panyu001 ~]# netstat -antp | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 877/nginx: master p
[root@panyu001 ~]# yum install -y procps procps-ng
[root@panyu001 ~]# ps aux |grep nginx
root 2618 0.0 0.0 20548 624 ? Ss 21:35 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody 2619 0.0 0.3 22992 3208 ? S 21:35 0:00 nginx: worker process
nobody 2620 0.0 0.3 22992 3208 ? S 21:35 0:00 nginx: worker process
root 2660 0.0 0.0 112720 980 pts/0 S+ 21:39 0:00 grep --color=auto nginx
[root@panyu001 ~]# /etc/init.d/nginx restart
Restarting nginx (via systemctl): [ 确定 ]
[root@panyu001 html]# curl 127.0.0.1/test.php -I
HTTP/1.1 200 OK
Server: nginx/1.14.0
Date: Fri, 07 Dec 2018 14:36:06 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/5.6.32
systemctl stop firewalld #或者直接 disable systemctl disable firewalld