Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,090 of 9,090 pages
About the help in other languages
All help pages

Module 1: Serving the site

The first module of Hosting and operations, how a request is served, Apache and nginx with PHP-FPM, PHP-FPM pools and tuning, OPcache and APCu. Four lessons, 2 hours 45 minutes.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/trainers/hosting-operations/module-01-serving-the-site/README.md

On this page

Module 1: Serving the site

Before anyone can run an Exponential site well, they need to know what serves it. This module gives the map (four ways to serve a site and one shared routing list), then teaches the traditional setup with Apache or nginx and PHP-FPM, the PHP values and timeouts of a pool, and the opcode cache that makes PHP fast. Velocity, the recommended server, has its own module next.

Warning

.htaccess slows down every request. When .htaccess files are enabled (AllowOverride anything but None), let alone used, Apache looks for them and reads and evaluates them on every request, in every directory of the path, and page loading times go up drastically (measured). The only real fix is to switch the feature off for the virtual host: AllowOverride None in the HTTPS virtual host, and the rules in the virtual host's own configuration as mod_rewrite rules. That is far faster in production speed tests and well worth the time it takes to optimize a production configuration. Switch over right away: copy the rules of the example HTTPS virtual host into your virtual host (with the static cache, also staticcache_offload.conf), set AllowOverride None, run apachectl configtest, reload Apache and test the site. The same rules for other servers: nginx, LiteSpeed, Caddy, IIS, Velocity (built in); where virtual host rules go in a control panel: Plesk, cPanel, DirectAdmin, ISPConfig. On LiteSpeed or OpenLiteSpeed, the server's own page cache can also answer anonymous visitors and crawlers without PHP: Page caching with LiteSpeed and OpenLiteSpeed.

At a glance

CourseHosting and operations
Duration2 hours 45 minutes (four lessons)
Lessons4
LevelIntermediate
FormatHands-on; one Linux virtual machine with root per learner

Lessons

LessonDurationWhat learners do
1.1 How a request is served40 minCompare the servers and prove the routing rules with four requests
1.2 Apache and nginx with PHP-FPM45 minWrite a virtual host, reload safely, fix file ownership
1.3 PHP-FPM pools and tuning45 minSet pool values, check timeouts and APCu, preview a reload
1.4 OPcache and APCu35 minCheck OPcache settings and read the opcode cache profile

Preparing this module

  • One Linux virtual machine per learner with root, Apache (or nginx), PHP-FPM, curl and a training installation made with exp:install (The console install).
  • Both command lists ready for Debian style (apache2, a2enmod) and Red Hat style (httpd) systems if the class mixes them.
  • Rehearse every exercise on the same operating system and PHP version the learners use.
  • Check that ./console exp:setup:status runs on each training installation: lesson 1.2 copies .htaccess with exp:setup:htaccess (Setting up .htaccess and config.php from the console).
  • Print the routing diagram of Chapter 8, section 8.2 as a handout.

Timing plan

TimeItem
0:00Lesson 1.1 (40 min)
0:40Lesson 1.2 (45 min)
1:25Break (15 min)
1:40Lesson 1.3 (45 min)
2:25Lesson 1.4 (35 min)
3:00End (2 h 45 min of lessons plus one break)

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x