{"id":2102,"date":"2017-10-12T18:01:12","date_gmt":"2017-10-12T12:31:12","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2102"},"modified":"2026-09-17T16:35:39","modified_gmt":"2026-09-17T11:05:39","slug":"client-denied-server-configuration-apache-2-4","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/client-denied-server-configuration-apache-2-4\/","title":{"rendered":"How to Fix \u201cClient Denied by Server Configuration\u201d in Apache 2.4"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Post Date: October 12, 2017<br>Last Updated: September 17, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While configuring Apache 2.4 on a Linux server, you may encounter the following error in the Apache error log:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Client denied by server configuration<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This error generally indicates that Apache is preventing access to the requested directory because the document root has not been explicitly allowed in the Apache configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if a website uses the following document root:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/home\/domain\/public_html<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Apache may deny access unless the directory is permitted in the VirtualHost configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to allow access to the document root and resolve the error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before making the changes, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A Linux server.<\/li>\n\n\n\n<li>Apache 2.4 installed and running.<\/li>\n\n\n\n<li>Root or sudo access.<\/li>\n\n\n\n<li>An existing Apache VirtualHost configuration.<\/li>\n\n\n\n<li>The document root path used by the website.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For this example, we use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/home\/domain\/public_html<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and assume the Apache VirtualHost configuration is:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/etc\/apache2\/sites-enabled\/domain.conf<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding the Error<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The error:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Client denied by server configuration<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">usually occurs when Apache&#8217;s access-control rules do not permit access to the directory being requested.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Apache 2.4 uses the <code>Require<\/code> directive for access control. Therefore, the document root needs an appropriate <code>&lt;Directory&gt;<\/code> configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Open the Apache VirtualHost Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open the VirtualHost configuration file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi \/etc\/apache2\/sites-enabled\/domain.conf<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Locate the existing VirtualHost configuration and add a <code>&lt;Directory&gt;<\/code> block for the website&#8217;s document root.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Allow Access to the Document Root<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;Directory \"\/home\/domain\/public_html\">\n    Require all granted\n&lt;\/Directory><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The complete VirtualHost configuration may look similar to:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;VirtualHost *:80>\n\n    ServerName domain.tld\n    ServerAlias www.domain.tld\n    DocumentRoot \/home\/domain\/public_html\n\n    &lt;Directory \"\/home\/domain\/public_html\">\n        Require all granted\n    &lt;\/Directory>\n\n&lt;\/VirtualHost><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>Require all granted<\/code> directive allows Apache to serve content from the specified directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Verify the Apache Configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before restarting Apache, check the configuration for syntax errors:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apachectl -t<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the configuration is correct, you should see:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Syntax OK<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If an error is reported, correct the configuration before applying the changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Restart Apache<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Restart Apache to apply the configuration:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">service apache2 restart<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On systems using <code>systemd<\/code>, you can also use:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">systemctl restart apache2<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Test the Website<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open the website in a browser:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">http:\/\/domain.tld<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the <code>&lt;Directory&gt;<\/code> configuration was the cause of the issue, Apache should now be able to serve the website content from:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/home\/domain\/public_html<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the error continues after adding <code>Require all granted<\/code>, check the following:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check the Document Root<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the configured <code>DocumentRoot<\/code> matches the actual website directory:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DocumentRoot \/home\/domain\/public_html<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Check the Directory Path<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the <code>&lt;Directory&gt;<\/code> path matches the document root exactly:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;Directory \"\/home\/domain\/public_html\">\n    Require all granted\n&lt;\/Directory><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Check Apache Configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apachectl -t<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Check Apache Error Logs<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Review the Apache error log for additional information:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">tail -f \/var\/log\/apache2\/error.log<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on the VirtualHost configuration, the website may also have its own error log.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Apache 2.4 error <strong>\u201cClient denied by server configuration\u201d<\/strong> commonly occurs when Apache&#8217;s access-control configuration does not allow access to the website&#8217;s document root.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Adding an appropriate <code>&lt;Directory&gt;<\/code> block with:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;Directory \"\/home\/domain\/public_html\">\n    Require all granted\n&lt;\/Directory><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">allows Apache to serve content from the specified document root.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Always validate the configuration with <code>apachectl -t<\/code> before restarting Apache.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What does \u201cClient denied by server configuration\u201d mean in Apache?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It means Apache&#8217;s configuration is preventing the client from accessing the requested resource. One possible cause is that the website&#8217;s document root has not been allowed through a suitable <code>&lt;Directory&gt;<\/code> rule.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. What directive is used to allow access in Apache 2.4?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Apache 2.4 uses the <code>Require<\/code> directive. For example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Require all granted<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">allows access to the configured directory.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Do I need to restart Apache after changing the configuration?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. After validating the configuration, restart or reload Apache so that the changes take effect.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apachectl -t\nsystemctl restart apache2<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. Why is the <code>&lt;Directory&gt;<\/code> path important?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>&lt;Directory&gt;<\/code> path must match the actual filesystem location of the website&#8217;s document root. If the paths do not match, the intended access rule may not apply.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Does this error always mean the <code>&lt;Directory&gt;<\/code> directive is missing?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. A missing or restrictive <code>&lt;Directory&gt;<\/code> rule is one common cause. Other Apache access-control rules, filesystem permissions, <code>.htaccess<\/code> settings, or security modules can also result in access being denied.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-install-apache-superset-on-ubuntu-via-docker-compose\/\">How to Install Apache Superset on Ubuntu via Docker Compose<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-configure-apache-with-php-fpm-handler-in-ubuntu-20-04\/\">How to Configure Apache with PHP-FPM handler in ubuntu 20.04<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Have a technology challenge or looking for the right solution for your business? Our team can help you with <strong>cloud, DevOps, development, infrastructure, design, and more<\/strong>. Feel free to reach out to our experts <a href=\"https:\/\/pheonixsolutions.com\/contact\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: October 12, 2017Last Updated: September 17, 2026 Introduction While configuring Apache 2.4 on a Linux server, you may [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[398,399],"class_list":["post-2102","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-apache2","tag-configuration","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-xU","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2102"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2102\/revisions"}],"predecessor-version":[{"id":11830,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2102\/revisions\/11830"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}