Category: Web

Apache (16)
GlassFish (0)
HAProxy (2)
IIS (20)
Nginx (55)
Other (4)
Tomcat (17)

Apache Prefork vs Worker MPM Mode

prefork MPM
This Multi-Processing Module (MPM) implements a non-threaded, pre-forking web server that works similarly to Apache 1.3. It is suitable for systems that lack thread-safe libraries and need to avoid thread compatibility issues. It is the best choice when each request needs to be handled independently of others …

Summary and Notes on Configuring Apache httpd-vhosts Virtual Hosts

I often use Apache virtual hosts for development and testing, but each time I need to configure a virtual host, I habitually copy and paste. This time, after reinstalling the system, I needed to configure a new PHP development environment virtual host, so I’m summarizing the methods and steps for configuring Apache httpd-vhosts virtual hosts for easy reference…

Nginx Tuning: A Performance Optimization Guide

Most Nginx installation guides cover the basics——install via apt-get, tweak a few lines of config here and there, and boom, you’ve got a web server! And, in most cases, a conventional Nginx install already works just fine for your website …

How to Hide the Nginx Version Number

How to Hide Nginx Version Number for Security

Nginx displays its version number prominently in the HTTP header or on error pages. For security reasons, it is generally recommended to hide this information.

The method is quite simple. Just add the server_tokens parameter inside the http { block of nginx.conf.
For example:
http { include mime.ty …

How to Implement 301 Permanent Redirects in Apache

How to 301 Redirect 123.com to www.123.com (Server-Side). Following Google’s recommendation, use a server-side 301 redirect to ensure users and search engines are directed to the correct page. The 301 status code indicates that a page has been permanently moved to a new location. Below is …

How to Handle Session Sharing with Nginx Load Balancer

1) Replace Sessions with Cookies

By replacing sessions with cookies, you can avoid some of the downsides of sessions. A J2EE book I once read also indicated that sessions should not be used in clustered systems, or else they can cause serious problems. If your system is not complex, first consider whether you can drop sessions …

Optimizing Nginx for High Traffic Loads

I’ve already covered some common questions about Nginx, including a few on how to optimize Nginx. Many new Nginx users have migrated from Apache, so they’re accustomed to tweaking configurations and performing magic tricks to keep their servers running efficiently. I have some bad news for you—you don’t …

Apache 301 Redirect

Apache 301 redirects are SEO-friendly, so using Apache’s configuration file to implement 301 redirects is very useful. To modify the Apache configuration file, for example, my website domain on the server is www.mytwo.com, and I also want www.myone.com to open www.mytwo.com. The code is as follows 1 2 3 …