Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Apache on WAMP answers 403 Forbidden to other computers on the network

Error403 Forbidden

Short answer

403 on other devices means an Apache Require rule only trusts local clients. Require local allows 127.0.0.0/8, ::1 and the server's own address, nothing else. Change the rule for the folder or virtual host to allow your network range with Require ip, then test the configuration and restart Apache.

  • Applies to Apache 2.4, WampServer 3
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Find the Require lines that apply to the site. Open httpd-vhosts.conf and httpd.conf in the WAMP Apache folder, or search them.

    findstr /n /i "Require" C:\wamp64\bin\apache\apache2.4.xx\conf\httpd.conf C:\wamp64\bin\apache\apache2.4.xx\conf\extra\httpd-vhosts.conf
  2. 2Match what you see, then jump to its fix

    1. 1The folder or virtual host has Require localRequire local is in effectFix
    2. 2A Require ip line exists but your device has a different address rangeRequire ip lists the wrong networkFix
    3. 3The rule uses Require host and the client has no DNS nameRequire host fails on reverse DNSFix

What does the error look like?

  • 403 Forbidden
  • http://localhost/ works, http://192.168.x.x/ from another device does not

Cause 1 of 3

Require local is in effect

1Check

Apache's mod_authz_host manual says local allows a client matching 127.0.0.0/8, ::1, or the same address as the server. A phone or another PC matches none of these.

findstr /n /i "Require local" C:\wamp64\bin\apache\apache2.4.xx\conf\extra\httpd-vhosts.conf

2Fix

Replace it with a rule for your LAN range. Use Require all granted only if you accept every client.

<Directory "c:/wamp64/www/">
    Require local
    Require ip 192.168.1.0/24
</Directory>

3Verify

Test the syntax, restart Apache, then open the PC's address from another device.

httpd -t
curl -I http://192.168.1.10/

Confirmed by httpd.apache.org

Did this fix it?

Cause 2 of 3

Require ip lists the wrong network

1Check

Require ip accepts a full address, a partial address or a CIDR range. A partial address such as 192.168.1 only covers that subnet, so a device on 192.168.0.x is refused.

ipconfig

2Fix

Make the range match the network the other device is on.

Require ip 192.168.0.0/24

3Verify

Restart Apache and request the page from that device.

httpd -t

Confirmed by httpd.apache.org

Did this fix it?

Cause 3 of 3

Require host fails on reverse DNS

1Check

The manual says Require host makes Apache do a double reverse DNS lookup, and access is allowed only if forward and reverse DNS agree and the name matches. Home devices often fail this.

findstr /n /i "Require host" C:\wamp64\bin\apache\apache2.4.xx\conf\httpd.conf

2Fix

Use Require ip with the network range instead.

Require ip 192.168.1.0/24

3Verify

Restart Apache and retry from the other device.

httpd -t

Confirmed by httpd.apache.org

Did this fix it?

How do I stop it coming back?

  • Allow a network range with Require ip, not Require all granted, on a machine that is reachable from other networks.
  • Run httpd -t after every change to the configuration.
  • Give the PC a fixed LAN address so your Require ip range keeps working.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Related fixes

Servers

dnf cannot install MySQL on Amazon Linux 2023

dnf cannot find a mysql-server package on Amazon Linux 2023

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.