various types of files, and for those static files such as Picture/flash always cache up, can be adjusted according to their needs.2, modify the php.ini configuration, as follows:Session.cache_limiter = NoCacheThe function of the above configuration is to cancel the cache function in PHP by default and avoid the abnormal cache generation.3, modify the application for example, there is a PHP program page static.php, it holds some query database results, and the data update is not frequent, so we
is also different
Save it and then reload the Nginx configuration,
sudo php5-fpm stop;
sudo php5-fpm start;
sudo service nginx reload;
After a few steps, you can basically make sure there's nothing wrong with running PHP.
Then install memcached
sudo apt-get install memcached
After installing the Memcache server, we
Set up the php development environment in ubuntu, nginx + (cgi) php5fpm + memcached + xdebug. Because it is only a development environment, we chose the simple apt-get installation method, but we also encountered some problems. First, the installation and configuration of nginxnginx is actually very simple. ngin is only a development environment, so it is a simple apt-get installation method, but there are
, in seconds. This is set to 300 (5 minutes), and in practice you can set different expiration times for different content depending on the situation. Finally, the cache is configured for the location "~ \.php$", which means that all requests ending with ". PHP" will be cached . The test is divided into three groups: the first group does not open the cache in Nginx and PHP, the second group uses only PHP memcache cache, and the third group uses only
ServerThe bigUserThe load of the quantitySchemeFirst, the prefaceTwoCompileInstallationThird, install mySql, MemcacheFour, install Apache, PHP, Eaccelerator,Php-memcacheV. Installation of SquidSix, PostScriptFirst, preface, preparation workCurrently, LAMPDevelopmentModeis the first choice for web development, how to build an efficient, reliable, stable webServicehas always been a hot topic, this article is an attempt at this topic.We use theArchitectureThe figure is as follows:Reference---------
max_fails=2fail_timeout=600s;server 192.168.101.243:18081weight=1max_fails=2fail_timeout=600s; #ip_hash; Identifies the IP fixed access server based on the first access,IP and client ip fixed #还有第二种配置方法就是 tomcatserver.xml based on access Two Tomcat configurations Modify Server.xml configuration information TOMCAT1 engine label add jvmroute= "TOMCAT1" tomcat2 Engine label Add jvmroute= "TOMCAT2" to modify connector label Port number port= "18081" protocol= "http/1.1" port= "19091" protocol= "
Nginx+tomcat7+memcached Cluster session SharingPrinciple:The main use of Memcached-session-manager (hereinafter referred to as MSM) Open source Tomcat plugin changes Tomcat original session storage mechanism, the session storage into the distributed cache memcache, Thus, the session can be shared.Download1. Download Nginx2. Download TOMCAT7 (This article describe
be noted, and the other information on the Internet is also different
Once you've saved it, it's better to load the Nginx configuration.
Copy Code code as follows:
sudo php5-fpm stop;
sudo php5-fpm start;
sudo service nginx reload;
After a few steps, you can basically make sure that running PHP is fine.
Then install memcached
.jar1234512345Create a directory and add the required index.jsp files for easy testing]# Mkdir-pv/usr/share/tomcat/webapps/test/{classes,lib,meta-inf,web-inf}]# vim/usr/share/tomcat/webapps/test/index.jsp12345678910111213141516171819201234567891011121314151617181920Configuring the D,e HostInstall memcached and start [Do not configure too much]/etc/sysconfig www.kuuucai.cn/memcacedPort= "11211"User= "Memcached
Session sharingWe are doing site testing, usually need to save some basic user information, such as login will use the session, when the use of Nginx load balancing, when users browse the site will be assigned to a different server, at this time if the session after login on different servers, A remember the user's login status, but the next time the user request was assigned to b what to do? It is not possible for users to log in again. So to achieve
requires updated URL, add #refresh配置成自动触发更新to URLTest results:
DEMO:1. Installing memcachedUnzip, run memcached.exe-d install in CMD after running successfully installed the memcached service in the Windows service , start it. You can determine if the installation started successfully by Telnet 127.0.0.1 112112. Run a ASPNET Web siteThe URL of the /report path under the page we will cache thes 3. Run ngin
How to install is not introduced, their own online search.
Configure Nginx. This is then configured on a CAS single sign-on.
[Java] view plain copy upstream 127.0.0.1 {server 127.0.0.1:18080 weight=2; Server 127.0.0.1:28080 weight=2; Server 127.0.0.1:8080 weight=3; }Weight is the weight value, the larger the number, the greater the chance of being visited.
Modify apache-tomcat-6.0.37\conf and apache-tomcat1\conf and apache-tomcat2\ separately conf
nginx+tomcat+memcached for load Balancing
Error when logging into project
Nginx
Tomcat
memcached
Load Balancing
Cluster Configuration
share to:
more
------Solution--------------------Come to the wrong place, here is PHP, over the Java section to ask it.------Solution--------------------
Refe
Operating Environment:
IP address
Role
Install software
10.43.2.135
Proxy for nginxMemcached Server
Nginx memcached
10.43.2.134
Tomcat server
Two Tomcat servers (ports: 8080 and 8081 respectively)
The software used in the experiment is as follows:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/41/24/wKioL1PRI8HD20B4AAByvE7H8v4738.jpg "Title
Nginx + tomcat + memcached: error nginxtomcatmemcach nginx + tomcat + memcached when you log on to the project to achieve load balancing
An error occurred while logging on to the project.
Nginx tomcat memcached server load balan
Nginx Tomcat memcached Load Balancer cluster configuration
Error when logging into project
Reply to discussion (solution)
This is the configuration in Tomcat 6.0
Come to the wrong place, here is PHP, over the Java section to ask it.
Come to the wrong place, here is PHP, over the Java section to ask it. A lot of PHP has been used memcached so only to the
The 1.nginx configuration is as follows:location ^~ /images/ {set $memcached_key "$uri"; #用URI作为key去memcached中去读取内容memcached_pass 127.0.0.1:11211;memcached_connect_timeout 5s;memcached_read_timeout 5s;memcached_send_timeout 5s;memcached_buffer_size 32k;error_page 404 502 504 = @fallback;}location @fallback {proxy_pass http://backend;}2. Use PHP to write a picture to mem
Transferred from: bytes/
Many new users who have just learned how to build a website have such troubles: PHPProgramMore and more, and most of them are open-source. If you want to learn PHP or use a PHP program to build a site, you can look at the settings of the PHP runtime environment and do not know where to start. It is different from the IIS settings, PHP runtime environment software such as Apache and MySQL are all in English. Today we will introduce
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.