Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the LNMP server environment

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to configure the LNMP server environment". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

I. brief introduction

Nginx is a very lightweight HTTP server written by Russians, Nginx, pronounced "engine X", is a high-performance HTTP and reverse proxy server, and is also an IMAP/POP3/SMTP proxy server. Nginx was developed by Russian Igor Sysoev for the second most visited Rambler.ru site in Russia, and it has been running on this site for more than three years. Igor Sysoev uses a BSD-based license when building a project.

In the case of high concurrent connections, Nginx is a good alternative to Apache servers. Nginx can also be used as a 7-tier load balancing server. Nginx 0.8.46 + PHP 5.2.14 (FastCGI) can withstand more than 30, 000 concurrent connections, which is 10 times that of Apache in the same environment.

Nginx surpasses Apache's high performance and stability, making more and more domestic websites using Nginx as Web server, including Sina blog, Sina podcast, NetEase News, QQ.com, Sohu blog and other portal channels, six rooms, 56.com and other video sharing sites, Discuz! Official forums, Shuimu Community and other well-known forums, Shanda online, Jinshan Xiaoyao Network and other online game sites, Douban, Renren, YUPOO photo album, Kingsoft ICIBA, Xunlei online and other emerging Web 2.0 websites.

Why is the performance of Nginx much better than Apache? This is due to the fact that Nginx uses the latest epoll (Linux 2.6kernel) and kqueue (freebsd) network Icano model, while Apache uses the traditional select model. At present, Squid and Memcached, which can withstand high concurrency access under Linux, adopt the epoll network Imax O model.

To deal with the read and write of a large number of connections, the select network Icano model adopted by Apache is very inefficient. Here is a metaphor to analyze the difference between the select model adopted by Apache and the epoll model adopted by Nginx:

Suppose you are studying in a university and there are many rooms in the dormitory building where you live. Your friends will come to see you. The select version of the hostel aunt will take your friends from room to room until they find you. The epoll version of the hostel aunt will first write down the room number of each classmate. When your friend comes, just tell your friend which room you are staying in. You don't have to take your friend all over the building to find someone. If 10000 people come to find their own classmates living in this building, it is self-evident who is more efficient than the select version or the epoll version of the hostel aunt. By the same token, polling Imax O is one of the most time-consuming operations in highly concurrent servers, and it is also clear which performance of select or epoll is higher.

Nginx's official Chinese wiki: http://wiki.nginx.org/NginxChs/http://www.bbqmw.net/

II. System environment

System platform: RHEL 5.4 (system requirements: Linux 2.6 + kernel)

Nginx version: nginx/1.0.15

Mysql version: 5.1.35-log Source distribution

Php version: php-5.2.10

Third, installation preparation

1. Obtain relevant open source programs and install them

Other Linux distributions such as RedHat can find the RPM package of these libraries on the installation CD. RedHat can be installed directly using CentOS's RPM package.

You can use rpm to install the following packages, such as related packages, along with the installation.

Gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

If the above packages are installed, there is no need to install them.

2. RPM package search website

Http://rpm.pbone.net/

Http://www.rpmfind.net/

Http://code.google.com/p/zed-lnmp/

This is the end of "how to configure the LNMP server environment". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report