首页 / NGINX / nginx 高性能服务器
nginx 高性能服务器
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nginx 高性能服务器,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2834字,纯文字阅读大概需要5分钟。
内容图文
![nginx 高性能服务器](/upload/InfoBanner/zyjiaocheng/1184/743eceaaf09d4fb284254f7e3d94b0d4.jpg)
Nginx
高性能HTTP,反向代理
========================================================================================================
基本安装
pcre
支持正则表达式,地址重写rewrite
[root@node3 ~]# tar xvf pcre-8.10.tar.gz
[root@node3 pcre-8.10]# ./configure && make && make install
[root@node3 pcre-8.10]# echo $?
0
nginx
[root@node3 ~]# useradd www
[root@node3 nginx-1.2.0]# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module
[root@node3 nginx-1.2.0]# make && make install
[root@node3 ~]# tree /usr/local/nginx/
/usr/local/nginx/
|-- conf
| |-- fastcgi.conf
| |-- fastcgi.conf.default
| |-- fastcgi_params
| |-- fastcgi_params.default
| |-- koi-utf
| |-- koi-win
| |-- mime.types
| |-- mime.types.default
| |-- nginx.conf
| |-- nginx.conf.default
| |-- scgi_params
| |-- scgi_params.default
| |-- uwsgi_params
| |-- uwsgi_params.default
| `-- win-utf
|-- html
| |-- 50x.html
| `-- index.html
|-- logs
`-- sbin
`-- nginx
4 directories, 18 files
========================================================================================================
启动nginx
[root@node3 ~]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
[root@node3 ~]# ps -ef | grep nginx
root 20721 1 0 14:14 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
www 20722 20721 0 14:14 ? 00:00:00 nginx: worker process
root 20738 5923 0 14:19 pts/1 00:00:00 grep nginx
[root@node3 ~]# netstat -tnlp |grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 13888/nginx
[root@node3 ~]# echo "/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf" >> /etc/rc.local
[root@node3 ~]# links --dump http://192.168.122.103
Welcome to nginx!
===========================================================================================================
配置Nginx
[root@node3 ~]# vim /usr/local/nginx/conf/nginx.conf
worker_processes 5;初始启动的进程数
worker_connections 1024;最大的连接数
==========================================================================================================
语法检查
[root@node3 ~]# /usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
===========================================================================================================
重启nginx
[root@station02 ~]# pgrep nginx
13888
13889
[root@station02 ~]# kill 13888
[root@station02 ~]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
本文出自 “cisco” 博客,请务必保留此出处http://1585654.blog.51cto.com/1575654/1386515
原文:http://1585654.blog.51cto.com/1575654/1386515
内容总结
以上是互联网集市为您收集整理的nginx 高性能服务器全部内容,希望文章能够帮你解决nginx 高性能服务器所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。