search
HomeBackend DevelopmentPHP Tutorialnginx+apache+mysql+php+memcached+squid cluster web environment (1/6)_PHP tutorial

Client | ===> |Load balancer| ===> |Reverse proxy/Cache| ===> |web Server| ===> |Database TutorialServer|
-------- ---------- ------------- ---------- ---------- --
nginx squid apache,php mysql tutorial
eaccelerator/memcache preparation:
Reference server: intel(r) xeon(tm) cpu 3.00ghz * 2, 2gb mem, scisc hard drive
Operating system : centos4.4, kernel version 2.6.9-22.elsmp, gcc version 3.4.4
Software: apache 2.2.3 (can use mpm mode)
php 5.2.0 (this version was chosen because the 5.2.0
engine is relatively more efficient) eaccelerator 0.9.5 (accelerates the php engine and can also encrypt the php source
program ) memcache 1.2.0 (for caching commonly used
data) libevent 1.2a (required for memcache working mechanism)
mysql 5.0.27 (use the binary version to save compilation work)
nginx 0.5.4 (used as a load balancer)
squid-2.6.stable6 (does reverse proxy while providing professional caching
function )

2. Compile and install 1.) Install nginx
1.) Install
nginx is pronounced [engine x] and is a
project established by the Russian igor sysoev, based on the BSD license. It is said that he was one of the members of f5. English homepage: http://nginx.net. Some of the largest websites in Russia have been using it for more than two years and it has been performing well. The compilation parameters of nginx are as follows:

[root@localhost]#./configure --prefix=/usr/local/server/nginx --with-openssl=/usr/include
--with-pcre=/usr/include/pcre/ --with-http_stub_status_module --without-http_memcached_module
--without-http_fastcgi_module --without-http_rewrite_module --without-http_map_module
--without-http_geo_module --without-http_autoindex_module
Here, it needs to be explained that since I want to use regular expressions in the nginx configuration
file , I need the support of the pcre module . I have installed the rpm packages of pcre and pcre-devel, but ngxin cannot correctly find the .h/.so/.a/.la file, so I made a slight modification:
[root@localhost]#mkdir /usr/include/pcre/.libs/
[root@localhost]#cp /usr/lib/libpcre.a /usr/include/pcre/.libs/libpcre.a
[root@localhost]#cp /usr/lib/libpcre.a /usr/include/pcre/.libs/libpcre.la
Then, modify objs/makefile at approximately line 908 and comment out the following:

./configure --disable-shared
Next, you can execute make and make install normally.

2.) Modify the configuration file /usr/local/server/nginx/conf/nginx.conf
Here are the contents of my nginx.conf for reference only:

#Run user
user nobody nobody;
#Start process
worker_processes 2;
#Global error
log and pid file error_log logs/error.log notice;
pid logs/nginx.pid;
#Working mode and maximum number of connections
events {
use epoll;
worker_connections 1024;
}
#Set up the http server and use its reverse proxy function to provide load balancing support
http {
#Set mime type
include conf/mime.types;
default_type application/octet-stream;
#Set log format
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
log_format download '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$http_range" "$sent_http_content_range"';
#Set request buffer
client_header_buffer_size 1k;
large_client_header_buffers 4 4k;
#Enable gzip module
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
output_buffers 1 32k;
postpone_output 1460;
#Set access log
access_log logs/access.log main;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
#Set load balancing server list
ups tutorial stream mysvr {
The #weigth parameter represents the weight. The higher the weight, the greater the chance of being assigned
#Squid on this machine opens port 3128
server 192.168.8.1:3128 weight=5;
server 192.168.8.2:80 weight=1;
server 192.168.8.3:80 weight=6;
} 1 2 3 4 5 6

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629849.htmlTechArticleClient| === |Load Balancer| === |Reverse Proxy/Cache| === |web server| === | Database tutorial server| -------- ---------- ------------- ------- -------------- nginx squ...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Web Speech API开发者指南:它是什么以及如何工作Web Speech API开发者指南:它是什么以及如何工作Apr 11, 2023 pm 07:22 PM

​译者 | 李睿审校 | 孙淑娟Web Speech API是一种Web技术,允许用户将语音数据合并到应用程序中。它可以通过浏览器将语音转换为文本,反之亦然。Web Speech API于2012年由W3C社区引入。而在十年之后,这个API仍在开发中,这是因为浏览器兼容性有限。该API既支持短时输入片段,例如一个口头命令,也支持长时连续的输入。广泛的听写能力使它非常适合与Applause应用程序集成,而简短的输入很适合语言翻译。语音识别对可访问性产生了巨大的影响。残疾用户可以使用语音更轻松地浏览

web端是什么意思web端是什么意思Apr 17, 2019 pm 04:01 PM

web端指的是电脑端的网页版。在网页设计中我们称web为网页,它表现为三种形式,分别是超文本(hypertext)、超媒体(hypermedia)和超文本传输协议(HTTP)。

节点从Proxmox VE彻底撤离及再次加入集群节点从Proxmox VE彻底撤离及再次加入集群Feb 21, 2024 pm 12:40 PM

节点从ProxmoxVE彻底撤离及再次加入集群场景描述当ProxmoxVE集群中有节点损坏无法快速修复时,需要将故障节点干净的从集群踢出,并把残留信息清理干净。否则,新的节点用故障节点曾使用用的IP的地址将不能正常加入集群;同样,从集群中脱离出来的故障节点修复后,虽然与集群已经毫无关系,但访问此单节点的Web管理后台,将出现原ProxmoxVE集群其它节点的信息,非常恼火。从集群中驱逐节点如果ProxmoxVE是Ceph超融合集群,需要登录集群任意节点(欲删除节点除外)宿主系统Debian,命令

web前端和后端开发有什么区别web前端和后端开发有什么区别Jan 29, 2023 am 10:27 AM

区别:1、前端指的是用户可见的界面,后端是指用户看不见的东西,考虑的是底层业务逻辑的实现,平台的稳定性与性能等。2、前端开发用到的技术包括html5、css3、js、jquery、Bootstrap、Node.js、Vue等;而后端开发用到的是java、php、Http协议等服务器技术。3、从应用范围来看,前端开发不仅被常人所知,且应用场景也要比后端广泛的太多太多。

PHP高并发环境下数据库的优化方法PHP高并发环境下数据库的优化方法Aug 11, 2023 pm 03:55 PM

PHP高并发环境下数据库的优化方法随着互联网的快速发展,越来越多的网站和应用程序需要面对高并发的挑战。在这种情况下,数据库的性能优化变得尤为重要,尤其是对于使用PHP作为后端开发语言的系统来说。本文将介绍一些在PHP高并发环境下数据库的优化方法,并给出相应的代码示例。使用连接池在高并发环境下,频繁地创建和销毁数据库连接可能会导致性能瓶颈。因此,使用连接池可以

深入探讨“高并发大流量”访问的解决思路和方案深入探讨“高并发大流量”访问的解决思路和方案May 11, 2022 pm 02:18 PM

怎么解决高并发大流量问题?下面本篇文章就来给大家分享下高并发大流量web解决思路及方案,希望对大家有所帮助!

web前端打包工具有哪些web前端打包工具有哪些Aug 23, 2022 pm 05:31 PM

web前端打包工具有:1、Webpack,是一个模块化管理工具和打包工具可以将不同模块的文件打包整合在一起,并且保证它们之间的引用正确,执行有序;2、Grunt,一个前端打包构建工具;3、Gulp,用代码方式来写打包脚本;4、Rollup,ES6模块化打包工具;5、Parcel,一款速度极快、零配置的web应用程序打包器;6、equireJS,是一个JS文件和模块加载器。

Python轻量级Web框架:Bottle库!Python轻量级Web框架:Bottle库!Apr 13, 2023 pm 02:10 PM

和它本身的轻便一样,Bottle库的使用也十分简单。相信在看到本文前,读者对python也已经有了简单的了解。那么究竟何种神秘的操作,才能用百行代码完成一个服务器的功能?让我们拭目以待。1. Bottle库安装1)使用pip安装2)下载Bottle文件https://github.com/bottlepy/bottle/blob/master/bottle.py2.“HelloWorld!”所谓万事功成先HelloWorld,从这个简单的示例中,了解Bottle的基本机制。先上代码:首先我们从b

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.