Websites & apps
Web servers, WordPress, PHP, Node.js, SSL and app hosting.
83 guides · page 4 of 5
Rate limit requests in Nginx with limit_req
Slow down brute-force logins, scrapers and API abuse with Nginx limit_req and limit_conn, using burst and nodelay so real visitors are not affected.
Read and manage Nginx access and error logs
Find Nginx's access and error logs, understand each line, give every site its own log, set error_log levels, pull out top IPs and URLs, and keep logs rotated.
Redirect HTTP to HTTPS in Nginx
Send every plain HTTP visitor to the secure HTTPS version of your site with one return 301 in Nginx, while keeping Let's Encrypt renewals working and avoiding redirect loops.
Redirect www to non-www (or the reverse) in Nginx
Pick one hostname for your site and send every other version to it with a clean 301 redirect in Nginx, keeping HTTPS and the full request path.
Run PHP and WordPress with Caddy and PHP-FPM
Serve PHP sites and WordPress from Caddy using the php_fastcgi directive and PHP-FPM, with working permalinks, larger upload limits and wp-config.php kept private.
Run PHP-FPM with Apache using proxy_fcgi and mpm_event
Move Apache from mod_php and the prefork MPM to PHP-FPM with mpm_event and proxy_fcgi. Use less memory, serve more visitors and pick a PHP version per virtual host.
Secure Apache with a free Let's Encrypt certificate
Install certbot with its Apache plugin, issue free Let's Encrypt certificates for each virtual host, redirect HTTP to HTTPS and confirm that automatic renewal works.
Set browser caching headers (expires and Cache-Control) in Nginx
Tell browsers how long to keep images, CSS, JavaScript and fonts with expires and Cache-Control in Nginx, while making sure HTML stays fresh after every update.
Set browser caching in Apache with mod_expires and headers
Tell browsers how long to keep your files. Use mod_expires and Cache-Control headers in Apache to cache versioned assets for a year and keep HTML fresh.
Set up Apache virtual hosts for multiple websites
Host several websites on one Apache server with name-based virtual hosts. One config file per domain, its own document root and its own logs, on Ubuntu, Debian, AlmaLinux and Rocky Linux.
Set up Nginx as a reverse proxy for any backend app
Put Nginx in front of a Node.js, Python, Go or Java app running on a local port, forward the right headers, tune timeouts and buffering, and add free HTTPS.
Show real visitor IPs in Nginx behind Cloudflare or a proxy
Behind Cloudflare or a load balancer, Nginx sees the proxy's IP instead of your visitors'. Use the real_ip module to restore the real address for logs, rate limits and apps.
Tune Apache MPM settings to stop memory exhaustion
Size Apache's MaxRequestWorkers to the RAM you really have, choose between prefork and event, set ServerLimit and KeepAlive sensibly and spot the MaxRequestWorkers warning in your logs.
Tune PHP-FPM pools (pm.max_children) for your RAM
Size PHP-FPM to your server's memory. Choose between dynamic, ondemand and static, calculate pm.max_children from real per-process memory, set pm.max_requests, and act on the max_children warning.
Tune PHP-FPM pools: pm.max_children and process managers
Calculate pm.max_children from your RAM, choose dynamic, static or ondemand, enable the status page and slow log, and fix 'server reached max_children' warnings.
Upgrade PHP safely: a checklist for cPanel and VPS sites
Move a site to a newer PHP version without downtime: check compatibility, test on staging, match extensions and settings, switch per site and know how to roll back.
Upgrade PHP to a newer version on your VPS
Upgrade a site from PHP 8.1 to 8.3 or 8.4 safely. Install the new PHP-FPM and matching extensions, carry over php.ini changes, switch Nginx or Apache, test, and remove the old version.
Use a different PHP version per website in Nginx
Run each Nginx site on its own PHP version by pointing its server block at a different PHP-FPM socket, give each site a separate pool, and confirm the version without leaving phpinfo exposed.
Use Apache as a reverse proxy with mod_proxy
Put Apache in front of a Node.js, Python or Docker app with mod_proxy. Set ProxyPass and ProxyPassReverse, keep the original host, proxy WebSockets and serve the app over HTTPS.
Use Caddy as a reverse proxy for your apps
Put Caddy in front of Node.js, Python or Docker apps with the reverse_proxy directive, give each app its own subdomain with automatic HTTPS, and add load balancing and health checks.
Other topics
- Getting startedYour first hour with a new server: access, logins and basics.83 guides
- cPanelFiles, databases, email, domains and every cPanel tool, step by step.67 guides
- WHM & resellingWHM, packages, reseller accounts, WHMReseller and running a hosting brand.53 guides
- WordPressInstall, secure, speed up, migrate and fix WordPress sites.49 guides
- Email & webmailMailboxes, webmail, forwarders, spam filters and email delivery.67 guides
- DomainsRegistering, transferring and managing domains and nameservers.27 guides
- SSL certificatesFree AutoSSL, Let's Encrypt, paid certificates and HTTPS.41 guides
- CloudLinuxCloudLinux setup and use: LVE limits, CloudLinux Manager, CageFS and PHP/Node.js selectors.31 guides
- LiteSpeedLiteSpeed Web Server, LSCache and the LiteSpeed Cache plugin: install, settings and tuning.35 guides
- Imunify360Malware scanning, firewall and proactive defence with Imunify360.24 guides
- SoftaculousInstall, update, clone and back up apps with Softaculous.24 guides
- WP SquaredcPanel's WordPress platform: sites, plugins, staging and backups.9 guides
- SitePadBuild and publish websites with the SitePad builder.9 guides
- SitejetDesign, edit and publish sites with the Sitejet builder.9 guides
- WHMResellerAlpha and master resellers with WHMReseller: install, setup and use.12 guides
- VirtFusionInstall, set up and manage VirtFusion: hypervisors, packages, servers and WHMCS integration.28 guides
- VirtualizorManage your VPS with Virtualizor: power, OS reinstall, VNC, IPs and backups.44 guides
- PleskWebsites, email, databases and settings in the Plesk panel.53 guides
- DirectAdminUsers, domains, email and reseller tools in DirectAdmin.41 guides
- WHMCSBilling, automation, products and client management with WHMCS.52 guides
- Control panelscPanel & WHM, Plesk, DirectAdmin and other panels on your VPS.107 guides
- SecurityKeys, passwords, firewalls and keeping a server patched.138 guides
- Networking & DNSIP addresses, reverse DNS, ports and traffic.72 guides
- Websites & appsWeb servers, WordPress, PHP, Node.js, SSL and app hosting.83 guides
- DatabasesMySQL, MariaDB, PostgreSQL, Redis and MongoDB on a VPS.80 guides
- Billing & accountInvoices, renewals, the client area and your account.9 guides
- TroubleshootingWhen something is not working: checks and fixes.127 guides
- Linux VPSSSH, packages, services and everyday Linux administration.265 guides
- Windows VPS & RDPRemote Desktop, Windows Server settings and Admin RDP tips.73 guides
- Docker & DevOpsContainers, Git deploys, automation, monitoring and backups.82 guides
Still stuck?
Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.
