Skip to content
Home
Dev Convert Generate Finance Calc Design Security Media

More categories

Productivity 23 SEO Tools 18 Network Tools 17 Text Tools 16 Education Tools 15 PDF Tools 11 Mockups 9

Learn and build

GuidesBlogAPI & MCPCheatsheetsChangelog All categories

Browse

439 tools · 15 categories

Start here

Popular tools New this week 11 All tools 439

Categories

Developer Tools 91 Converters 65 Calculators 32 Finance Tools 32 Generators 31 Media Tools 27 Design Tools 25 Security Tools 25 Productivity 23 SEO Tools 18 Network Tools 17 Text Tools 16 Education Tools 15 PDF Tools 11 Mockups 9

Learn and build

Guides Cheatsheets Blog REST API MCP server Changelog

No matches here.

Keep FindUtils free Sponsors fund new tools
  1. Cheatsheets
Guides Blog API & MCP
Sponsor
FindUtils
Sponsor
  1. Home
  2. Cheatsheets
  3. DevOps & Cloud
  4. Apache HTTP Server

DevOps & Cloud · Cheatsheet

Apache HTTP Server Cheatsheet

Virtual hosts, modules, SSL, .htaccess, reverse proxy, and performance tuning

64 commands 9 sections

On this sheet

Service Management 10 Virtual Hosts 8 Modules 9 SSL / HTTPS 7 .htaccess & Rewrite Rules 8 Reverse Proxy 6 Security & Access Control 7 Logging & Performance 8 Sources 1

No entry matches that filter.

Service Management

  • sudo systemctl start apache2 Start Apache service
  • sudo systemctl stop apache2 Stop Apache service
  • sudo systemctl restart apache2 Restart Apache (drops connections)
  • sudo systemctl reload apache2 Graceful reload (no downtime)
  • sudo systemctl enable apache2 Enable Apache on boot
  • sudo systemctl status apache2 Check Apache service status
  • apachectl configtest Test configuration syntax
  • apachectl -V Show version and build parameters
  • apachectl -t -D DUMP_MODULES List all loaded modules
  • apachectl -S Show parsed virtual host settings

Virtual Hosts

  • <VirtualHost *:80> Define a virtual host on port 80
  • ServerName example.com Set primary domain for vhost
  • ServerAlias www.example.com Add alternate domain name
  • DocumentRoot /var/www/html Set root directory for content
  • ErrorLog ${APACHE_LOG_DIR}/error.log Set error log path
  • CustomLog ${APACHE_LOG_DIR}/access.log combined Set access log with format
  • sudo a2ensite example.conf Enable a virtual host config
  • sudo a2dissite example.conf Disable a virtual host config

Modules

  • sudo a2enmod rewrite Enable mod_rewrite for URL rewriting
  • sudo a2dismod autoindex Disable directory listing module
  • sudo a2enmod ssl Enable SSL/TLS module
  • sudo a2enmod headers Enable HTTP headers module
  • sudo a2enmod proxy Enable reverse proxy module
  • sudo a2enmod proxy_http Enable HTTP proxy support
  • sudo a2enmod expires Enable cache expiry headers
  • sudo a2enmod deflate Enable gzip compression
  • apache2ctl -M List all enabled modules

SSL / HTTPS

  • sudo a2enmod ssl Enable SSL module
  • SSLEngine on Enable SSL for a virtual host
  • SSLCertificateFile /path/cert.pem Set SSL certificate path
  • SSLCertificateKeyFile /path/key.pem Set SSL private key path
  • SSLCertificateChainFile /path/chain.pem Set certificate chain file
  • sudo certbot --apache -d example.com Install Let's Encrypt cert
  • Header always set Strict-Transport-Security "max-age=31536000" Enable HSTS header

.htaccess & Rewrite Rules

  • RewriteEngine On Enable URL rewriting in .htaccess
  • RewriteCond %{HTTPS} off Condition: if not HTTPS
  • RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] Redirect HTTP to HTTPS
  • RewriteRule ^old-page$ /new-page [R=301,L] Permanent redirect (301)
  • RewriteRule ^api/(.*)$ index.php?route=$1 [QSA,L] Route API requests to index.php
  • Options -Indexes Disable directory listing
  • AllowOverride All Allow .htaccess to override config
  • ErrorDocument 404 /404.html Custom 404 error page

Reverse Proxy

  • ProxyPass / http://localhost:3000/ Forward all requests to backend
  • ProxyPassReverse / http://localhost:3000/ Adjust response headers for proxy
  • ProxyPreserveHost On Pass original Host header to backend
  • ProxyPass /ws ws://localhost:3000/ws Proxy WebSocket connections
  • <Proxy balancer://mycluster> Define a load balancer cluster
  • BalancerMember http://server1:8080 Add backend server to balancer

Security & Access Control

  • Require all denied Deny access to directory (2.4+)
  • Require ip 192.168.1.0/24 Allow access from IP range
  • Require all granted Allow access to all
  • ServerTokens Prod Hide Apache version in headers
  • ServerSignature Off Remove server info from error pages
  • Header set X-Content-Type-Options "nosniff" Prevent MIME type sniffing
  • Header set X-Frame-Options "SAMEORIGIN" Prevent clickjacking

Logging & Performance

  • LogLevel warn Set log verbosity (emerg to trace8)
  • tail -f /var/log/apache2/error.log Stream error log in real-time
  • ExpiresActive On Enable cache expiry headers
  • ExpiresByType image/png "access plus 1 month" Cache images for 1 month
  • AddOutputFilterByType DEFLATE text/html text/css Enable gzip for HTML/CSS
  • KeepAlive On Enable persistent connections
  • MaxKeepAliveRequests 100 Max requests per connection
  • KeepAliveTimeout 5 Timeout for keep-alive (seconds)

Sources

  • https://httpd.apache.org/docs/2.4/ Apache HTTP Server 2.4 manual: directive contexts, modules, TLS, and proxy configuration.

Related cheatsheets

  • Docker Commands54 commands
  • Kubernetes Commands72 commands
  • Nginx Server69 commands

From FindUtils

More to explore

Products and services from the team behind FindUtils.

Promote your tool
Featured product seeranks.com SeeRanks — transparent product discovery A public ranking board where paid placement is always labeled and every product keeps its earned position. View SeeRanks Public rank board #1 Sponsored #2 #3 #4 Paid placement is always labeled Free favicon tool emojifavicons.com Emoji Favicons Turn any emoji into a favicon with one HTML line. SVG, PNG or ICO, no sign-up. <link rel="icon" href=".../🦊.svg"> Create a favicon
FindUtils service findutils.com Articles for software tools A sourced article for your channels, or a sponsored FindUtils publication with editorial review. Compare packages Domain portfolio findutils.com Domain names for sale .com.dev.sh.app.io Unused names across dev tools, AI, PDF and commerce. Make an offer. Browse the list Playable ranking towerscore.io TowerScore — stack the skyline Play to climb, or buy a floor. Paid floors are labeled. Open TowerScore

Missing a tool you need?

Tell us what to build next. Most requests ship as a free browser tool, an API endpoint and an MCP tool.

Request a tool
FindUtils

Free, fast utilities. Most tools process your files in the browser; lookup tools say what they send, and pages load analytics and ads.

  • No sign-up for free tools
  • Most tools run in your browser
  • 369 tools on the REST API, 369 on MCP

Tools

DevelopersConvertPDFDesignSecurityAll tools →

Learn

GuidesBlogCheatsheetsChangelog

Build

REST APIMCP serverAPI referenceWorkflowsStatus

FindUtils

AboutLibraries we useSponsorRequest a toolDomains for saleContact
© 2026 FindUtils PrivacyTermsSitemap
Service status
FindUtils

Free, fast utilities that respect your data. Most tools run in your browser.

Build with it

REST APIMCP serverGuidesChangelog

FindUtils

AboutSponsorPrivacyContact
Theme
© 2026 FindUtils Terms
FindUtils
Guides Blog REST API MCP server Changelog

Categories

Developers 91 Convert 65 Calculate 32 Finance 32 Generate 31 Media 27
All 15 categories →

Keep it free

Sponsorship keeps every tool free and funds the new ones we ship each week.

Sponsor Back the project
Tools API Sponsor