{"id":12795,"date":"2025-12-18T17:09:58","date_gmt":"2025-12-18T11:39:58","guid":{"rendered":"https:\/\/www.youstable.com\/blog\/?p=12795"},"modified":"2025-12-18T17:10:00","modified_gmt":"2025-12-18T11:40:00","slug":"how-to-configure-apache-on-linux","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/how-to-configure-apache-on-linux","title":{"rendered":"How to Configure Apache on Linux Server &#8211; (Step-by-Step Guide 2026)"},"content":{"rendered":"\n<p><strong>To configure Apache on a Linux server in 2026<\/strong>, install the Apache package (apache2\/httpd), start and enable the service, allow firewall ports 80\/443, create a document root, add a virtual host, enable SSL with Let\u2019s Encrypt, and apply performance and security tuning. <\/p>\n\n\n\n<p>Follow this step-by-step guide for Ubuntu\/Debian and RHEL-based systems. Configuring Apache on a Linux server is straightforward once you know the layout and best practices. <\/p>\n\n\n\n<p>In this guide, I\u2019ll show you how to configure Apache on Linux server distributions like Ubuntu 24.04\/22.04 and Rocky\/AlmaLinux 9, including virtual hosts, free SSL, PHP-FPM, performance tuning, and security hardening that align with 2026 best practices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"what-youll-need\"><strong>What You\u2019ll Need<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Linux server (Ubuntu 24.04\/22.04, Debian 12, Rocky\/AlmaLinux 9, RHEL 9)<\/li>\n\n\n\n<li>Root or sudo access<\/li>\n\n\n\n<li>Registered domain pointing to your server\u2019s public IP (A\/AAAA record)<\/li>\n\n\n\n<li>Open ports: 22 (SSH), 80 (HTTP), 443 (HTTPS)<\/li>\n\n\n\n<li>Optional: PHP-FPM, MySQL\/MariaDB for dynamic apps (WordPress, etc.)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-1-update-the-server-and-install-apache\"><strong>Step 1: Update the Server and Install Apache<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"ubuntu-debian\"><strong>Ubuntu\/Debian<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt -y upgrade\nsudo apt -y install apache2\napache2 -v\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"rocky-almalinux-rhel\"><strong>Rocky\/AlmaLinux\/RHEL<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf -y update\nsudo dnf -y install httpd\nhttpd -v\n<\/code><\/pre>\n\n\n\n<p>You should see Apache HTTP Server 2.4.x, which uses the performant \u201cevent\u201d MPM by default on most modern distros.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-2-start-enable-and-open-the-firewall\"><strong>Step 2: Start, Enable, and Open the Firewall<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># Start and enable\nsudo systemctl enable --now apache2    # Ubuntu\/Debian\nsudo systemctl enable --now httpd      # RHEL\/Rocky\/Alma\n\n# Firewall (choose the tool your distro uses)\n# UFW (Ubuntu)\nsudo ufw allow OpenSSH\nsudo ufw allow \"Apache Full\"           # 80,443\nsudo ufw enable\n\n# firewalld (RHEL family)\nsudo firewall-cmd --permanent --add-service=http\nsudo firewall-cmd --permanent --add-service=https\nsudo firewall-cmd --reload\n<\/code><\/pre>\n\n\n\n<p>Visit http:\/\/your_server_ip to confirm the default Apache page loads.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-3-know-the-apache-file-layout\"><strong>Step 3: Know the Apache File Layout<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ubuntu\/Debian:<\/strong> configs in <code>\/etc\/apache2\/<\/code> with <code>sites-available<\/code>, <code>sites-enabled<\/code>, <code>mods-available<\/code>, <code>mods-enabled<\/code><\/li>\n\n\n\n<li><strong>RHEL\/Rocky\/Alma: <\/strong>main config <code>\/etc\/httpd\/conf\/httpd.conf<\/code>, include directory <code>\/etc\/httpd\/conf.d\/<\/code>, modules in <code>\/etc\/httpd\/modules<\/code><\/li>\n\n\n\n<li>Document roots usually <code>\/var\/www\/<\/code><\/li>\n\n\n\n<li><strong>Logs: <code>\/<\/code><\/strong><code>var\/log\/apache2\/<\/code> (Debian) or <code>\/var\/log\/httpd\/<\/code> (RHEL)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-4-create-a-document-root-and-permissions\"><strong>Step 4: Create a Document Root and Permissions<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/var\/www\/example.com\/public_html\necho \"&lt;h1&gt;Apache is working for example.com&lt;\/h1&gt;\" | sudo tee \/var\/www\/example.com\/public_html\/index.html\n\n# Ownership: use your Linux user (replace $USER) and www-data\/apache as needed\n# Ubuntu\/Debian:\nsudo chown -R $USER:www-data \/var\/www\/example.com\n# RHEL family (group is 'apache'):\nsudo chown -R $USER:apache \/var\/www\/example.com\n\nsudo find \/var\/www\/example.com -type d -exec chmod 755 {} \\;\nsudo find \/var\/www\/example.com -type f -exec chmod 644 {} \\;\n<\/code><\/pre>\n\n\n\n<p>If SELinux is enforcing (RHEL family), label the content directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo semanage fcontext -a -t httpd_sys_content_t \"\/var\/www\/example.com(\/.*)?\"\nsudo restorecon -Rv \/var\/www\/example.com\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-5-create-a-name-based-virtual-host-http\"><strong>Step 5: Create a Name-Based Virtual Host (HTTP)<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"ubuntu-debian-vhost\"><strong>Ubuntu\/Debian vHost<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/sites-available\/example.com.conf\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80&gt;\n    ServerName example.com\n    ServerAlias www.example.com\n    DocumentRoot \/var\/www\/example.com\/public_html\n\n    ErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n    CustomLog ${APACHE_LOG_DIR}\/example.com_access.log combined\n\n    &lt;Directory \/var\/www\/example.com\/public_html&gt;\n        Options Indexes FollowSymLinks\n        AllowOverride All\n        Require all granted\n    &lt;\/Directory&gt;\n&lt;\/VirtualHost&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2ensite example.com.conf\nsudo a2enmod rewrite headers\nsudo apache2ctl configtest\nsudo systemctl reload apache2\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"rhel-rocky-alma-vhost\"><strong>RHEL\/Rocky\/Alma vHost<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/httpd\/conf.d\/example.com.conf\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80&gt;\n    ServerName example.com\n    ServerAlias www.example.com\n    DocumentRoot \/var\/www\/example.com\/public_html\n\n    ErrorLog logs\/example.com_error.log\n    CustomLog logs\/example.com_access.log combined\n\n    &lt;Directory \/var\/www\/example.com\/public_html&gt;\n        Options Indexes FollowSymLinks\n        AllowOverride All\n        Require all granted\n    &lt;\/Directory&gt;\n&lt;\/VirtualHost&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo httpd -t\nsudo systemctl reload httpd\n<\/code><\/pre>\n\n\n\n<p>Point your domain\u2019s A record to the server IP. Browsing http:\/\/example.com should show your index page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-6-enable-https-with-lets-encrypt-free-ssl\"><strong>Step 6: Enable HTTPS with Let\u2019s Encrypt (Free SSL)<\/strong><\/h2>\n\n\n\n<p>Use Certbot\u2019s Apache plugin to automatically issue and install SSL certificates, plus set up HTTP\u2192HTTPS redirects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"ubuntu-debian-certbot\"><strong>Ubuntu\/Debian (Certbot)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt -y install certbot python3-certbot-apache\nsudo certbot --apache -d example.com -d www.example.com\n# Auto-renew check\nsudo systemctl status certbot.timer\nsudo certbot renew --dry-run\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"rhel-rocky-alma-certbot\"><strong>RHEL\/Rocky\/Alma (Certbot)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf -y install certbot python3-certbot-apache\nsudo certbot --apache -d example.com -d www.example.com\nsudo certbot renew --dry-run\n<\/code><\/pre>\n\n\n\n<p>Certbot will configure your SSL vHost with strong defaults and set up automatic renewals. For HTTP\/2, ensure the http2 module is enabled.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-7-enable-essential-modules-and-http-2\"><strong>Step 7: Enable Essential Modules and HTTP\/2<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>mod_rewrite: <\/strong>pretty URLs and redirects<\/li>\n\n\n\n<li><strong>mod_headers: <\/strong>security and caching headers<\/li>\n\n\n\n<li><strong>mod_http2: <\/strong>HTTP\/2 for faster parallelization<\/li>\n\n\n\n<li><strong>Compression: <\/strong>mod_deflate or mod_brotli (if available)<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Ubuntu\/Debian\nsudo a2enmod http2 deflate headers rewrite ssl\n# Optional (if available): sudo a2enmod brotli\nsudo apache2ctl configtest &amp;&amp; sudo systemctl reload apache2\n\n# RHEL family\nsudo sed -i 's\/^#LoadModule http2_module\/LoadModule http2_module\/' \/etc\/httpd\/conf.modules.d\/00-base.conf 2&gt;\/dev\/null || true\necho \"Protocols h2 h2c http\/1.1\" | sudo tee \/etc\/httpd\/conf.d\/http2.conf\nsudo httpd -t &amp;&amp; sudo systemctl reload httpd\n<\/code><\/pre>\n\n\n\n<p>Note: For HTTP\/3 in 2026, most teams use a CDN or a reverse proxy with QUIC (e.g., Nginx\/HAProxy) in front of Apache. Apache\u2019s HTTP\/2 remains stable and widely deployed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-8-configure-php-fpm-optional-for-dynamic-sites\"><strong>Step 8: Configure PHP-FPM (Optional for Dynamic Sites)<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"install-php-fpm\"><strong>Install PHP-FPM<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Ubuntu\/Debian (PHP 8.x)\nsudo apt -y install php-fpm php-mysql\n# RHEL family\nsudo dnf -y install php php-fpm php-mysqlnd\nsudo systemctl enable --now php-fpm\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"enable-proxy-to-php-fpm\"><strong>Enable Proxy to PHP-FPM<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Ubuntu\/Debian\nsudo a2enmod proxy_fcgi setenvif\nsudo a2enconf php*-fpm\nsudo systemctl reload apache2\n\n# RHEL family: add to vHost or conf.d\/php-fpm.conf\nsudo nano \/etc\/httpd\/conf.d\/php-fpm.conf\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;FilesMatch \\.php$&gt;\n    SetHandler \"proxy:unix:\/run\/php-fpm\/www.sock|fcgi:\/\/localhost\/\"\n&lt;\/FilesMatch&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo httpd -t &amp;&amp; sudo systemctl reload httpd\n<\/code><\/pre>\n\n\n\n<p>Place a phpinfo() test file in the document root to verify PHP is served via FPM. Remove the file after testing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-9-performance-tuning-for-2026\"><strong>Step 9: Performance Tuning for 2026<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep the Event MPM (default). Avoid prefork unless required by legacy modules.<\/li>\n\n\n\n<li>Tune MaxRequestWorkers based on RAM\/CPU and site workload.<\/li>\n\n\n\n<li>Enable compression (Brotli or Deflate) and caching headers.<\/li>\n\n\n\n<li>Use HTTP\/2 and persistent connections.<\/li>\n\n\n\n<li>Serve static assets from a CDN for global speed.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Example MPM Event tuning snippet\n# Ubuntu\/Debian: \/etc\/apache2\/mods-available\/mpm_event.conf\n# RHEL: \/etc\/httpd\/conf.modules.d\/00-mpm.conf or conf.d\/mpm_event.conf\n&lt;IfModule mpm_event_module&gt;\n   StartServers             2\n   ServerLimit              32\n   ThreadsPerChild          64\n   ThreadLimit              128\n   MaxRequestWorkers        2048\n   MaxConnectionsPerChild   10000\n&lt;\/IfModule&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Caching and compression example (add inside vHost or global)\nHeader always set X-Content-Type-Options \"nosniff\"\nHeader always set X-Frame-Options \"SAMEORIGIN\"\nHeader always set Referrer-Policy \"strict-origin-when-cross-origin\"\n\n# Static asset caching\n&lt;FilesMatch \"\\.(ico|jpg|jpeg|png|gif|css|js|woff2?)$\"&gt;\n  Header set Cache-Control \"public, max-age=31536000, immutable\"\n&lt;\/FilesMatch&gt;\n\n# Deflate compression\nAddOutputFilterByType DEFLATE text\/plain text\/html text\/css application\/javascript application\/json image\/svg+xml\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-10-security-hardening\"><strong>Step 10: Security Hardening<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Hide version info: <\/strong><code>ServerTokens Prod<\/code> and <code>ServerSignature Off<\/code><\/li>\n\n\n\n<li>Principle of least privilege for files\/dirs; avoid 777 permissions<\/li>\n\n\n\n<li>Enable SELinux\/AppArmor policies properly<\/li>\n\n\n\n<li>Install a WAF like <strong>ModSecurity<\/strong> with OWASP CRS<\/li>\n\n\n\n<li>Rate limit with <strong>mod_evasive<\/strong> or use a CDN WAF<\/li>\n\n\n\n<li>Use strong TLS (TLSv1.2\/1.3) and modern ciphers<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Global security (Ubuntu: \/etc\/apache2\/conf-available\/security.conf)\n# (RHEL: \/etc\/httpd\/conf.d\/security.conf)\nServerTokens Prod\nServerSignature Off\nTraceEnable Off\n\n# Limit methods (example)\n&lt;LimitExcept GET POST HEAD&gt;\n  Require all denied\n&lt;\/LimitExcept&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># ModSecurity (example install)\n# Ubuntu\/Debian:\nsudo apt -y install libapache2-mod-security2\nsudo a2enmod security2\n# RHEL family:\nsudo dnf -y install mod_security\n# Add OWASP CRS and restart Apache (follow CRS docs)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"step-11-logs-monitoring-and-maintenance\"><strong>Step 11: Logs, Monitoring, and Maintenance<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Config test: <\/strong><code>apache2ctl -t<\/code> (Debian) or <code>httpd -t<\/code> (RHEL)<\/li>\n\n\n\n<li><strong>Service: <\/strong><code>systemctl status apache2|httpd<\/code><\/li>\n\n\n\n<li><strong>Logs: <\/strong>access\/error logs in <code>\/var\/log\/apache2<\/code> or <code>\/var\/log\/httpd<\/code><\/li>\n\n\n\n<li><strong>Journal: <\/strong><code>journalctl -u apache2 -f<\/code> or <code>journalctl -u httpd -f<\/code><\/li>\n\n\n\n<li><strong>Log rotation:<\/strong> handled by logrotate; verify <code>\/etc\/logrotate.d\/apache2|httpd<\/code><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Quick checks\napache2ctl -S    # Debian: vHosts overview\nhttpd -S         # RHEL\napache2ctl -M    # Loaded modules\nhttpd -M\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"troubleshooting-common-apache-errors\"><strong>Troubleshooting: Common Apache Errors<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>403 Forbidden: <\/strong>wrong permissions or missing <code>Require all granted<\/code>; on RHEL, fix SELinux contexts.<\/li>\n\n\n\n<li><strong>404 Not Found: <\/strong>document root or vHost mismatch; check <code>apache2ctl -S<\/code>.<\/li>\n\n\n\n<li><strong>Port already in use: <\/strong>stop conflicting service or change Listen ports.<\/li>\n\n\n\n<li><strong>AH00558 (ServerName): <\/strong>set a global <code>ServerName<\/code> in main config to silence the warning.<\/li>\n\n\n\n<li><strong>Let\u2019s Encrypt failure: <\/strong>confirm DNS A\/AAAA records point to your server and port 80 is open.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"when-to-choose-managed-hosting-save-time-and-risk\"><strong>When to Choose Managed Hosting (Save Time and Risk)<\/strong><\/h2>\n\n\n\n<p>If you\u2019d rather not handle SSL renewals, tuning, and security patches yourself, a managed plan is safer. At YouStable, our Linux experts pre-optimize Apache (HTTP\/2, PHP-FPM, caching, WAF) and monitor 24\u00d77, so you can focus on your site or app while we keep your stack fast, secure, and up-to-date.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"final-checklist\"><strong>Final Checklist<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Installed Apache and opened firewall ports 80\/443<\/li>\n\n\n\n<li>Configured a document root and correct permissions<\/li>\n\n\n\n<li>Created virtual hosts for your domains<\/li>\n\n\n\n<li>Issued Let\u2019s Encrypt SSL and forced HTTPS<\/li>\n\n\n\n<li>Enabled HTTP\/2, compression, caching headers<\/li>\n\n\n\n<li>Hardened security (tokens, WAF, least privilege)<\/li>\n\n\n\n<li>Tuned MPM event and verified logs\/monitoring<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"faqs-configure-apache-on-linux-server-2026\"><strong>FAQ&#8217;s &#8211; Configure Apache on Linux Server (2026)<\/strong><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1765604336053\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"where-are-apache-configuration-files-on-ubuntu-vs-centos-rocky\"><strong>Where are Apache configuration files on Ubuntu vs. CentOS\/Rocky?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Ubuntu\/Debian store configs in \/etc\/apache2 with sites-available\/sites-enabled and mods-available\/mods-enabled. RHEL\/Rocky\/AlmaLinux use \/etc\/httpd, with the main file at \/etc\/httpd\/conf\/httpd.conf and additional vHosts in \/etc\/httpd\/conf.d\/*.conf.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765604347248\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"how-do-i-host-multiple-websites-on-one-server\"><strong>How do I host multiple websites on one server?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Create a separate document root and virtual host for each domain. On Ubuntu, place vHosts in \/etc\/apache2\/sites-available and run a2ensite. On RHEL family, create one .conf per site in \/etc\/httpd\/conf.d. Reload Apache after config tests.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765604353988\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"how-do-i-redirect-http-to-https-in-apache\"><strong>How do I redirect HTTP to HTTPS in Apache?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>The Certbot Apache installer can add redirects automatically. Manually, use RewriteRule in the port 80 vHost or set VirtualHost:80 to redirect to https:\/\/ with mod_rewrite and a 301 rule, then reload Apache.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765604359415\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"how-do-i-restart-or-reload-apache-safely\"><strong>How do I restart or reload Apache safely?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Use systemctl reload apache2|httpd to apply config changes without dropping connections. Use systemctl restart for module changes or after crashes. Always test configs first with apache2ctl -t or httpd -t.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765604376022\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"is-apache-or-nginx-better-for-wordpress-in-2026\"><strong>Is Apache or Nginx better for WordPress in 2026?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Both perform excellently. Apache is flexible with .htaccess and rich modules; Nginx excels as a reverse proxy and for high-concurrency static delivery. Many teams use Nginx in front of Apache+PHP-FPM. If you prefer hands-off performance, a managed YouStable stack is optimized for WordPress either way.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<p>With the steps above, you can confidently configure Apache on Linux server environments, deploy secure virtual hosts with free SSL, and keep performance high. Bookmark this guide for 2026 best practices and updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To configure Apache on a Linux server in 2026, install the Apache package (apache2\/httpd), start and enable the service, allow [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":15133,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[350],"tags":[],"class_list":["post-12795","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase"],"acf":[],"featured_image_src":"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/12\/How-to-Configure-Apache-on-Linux-Server.jpg","author_info":{"display_name":"Prahlad Prajapati","author_link":"https:\/\/www.youstable.com\/blog\/author\/prahladblog"},"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/12795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/comments?post=12795"}],"version-history":[{"count":4,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/12795\/revisions"}],"predecessor-version":[{"id":15136,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/12795\/revisions\/15136"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/15133"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=12795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=12795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=12795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}