# Fixing Apache’s “Permission Denied: Search Permissions Missing” Error on Linux

If you’ve ever checked your Apache error logs and seen something like this:

Code

```bash
[core:error] (13)Permission denied: access to /robots.txt denied (filesystem path '/home/username/sites') because search permissions are missing on a component of the path
```

…you’ve run into a classic Linux filesystem permissions problem. The good news? It’s easy to fix once you understand what’s going on.

## **What the Error Means**

In Linux, directories need **execute (**`x`**) permission** for a user or process to “search” or traverse them. Even if a file like `/robots.txt` has the right read permissions, Apache can’t serve it unless it can walk through every directory in the path.

If any parent directory in `/home/username/sites/...` is missing execute permission for Apache’s user (`apache`, `www-data`, or similar), you’ll get this error.

## **How to Diagnose**

1. **Check Apache’s user**
    
    bash
    
    ```bash
    ps aux | grep httpd   # Apache
    ps aux | grep nginx   # Nginx with php-fpm
    ```
    
2. **Check permissions on each directory in the path**
    
    bash
    
    ```bash
    namei -l /home/username/sites
    ```
    
    This shows the permissions for each component of the path.
    

## **How to Fix**

### Option 1 — Open execute permission for “others”

Quick and simple:

bash

```bash
chmod o+x /home
chmod o+x /home/username
chmod o+x /home/username/sites
```

### Option 2 — Use group permissions (more secure)

1. Add Apache’s user to your group:
    
    bash
    
    ```bash
    sudo usermod -a -G yourgroup apache
    ```
    
2. Change group ownership and set execute for group:
    
    bash
    
    ```bash
    sudo chgrp -R yourgroup /home/username/sites
    chmod g+x /home /home/username /home/username/sites
    ```
    

## **Why This Happens Often**

Many developers keep their web projects under `/home/<user>/` for convenience. By default, home directories are locked down so other users (including the web server process) can’t traverse them. Apache needs at least execute permission to reach the `public` folder in your Laravel, WordPress, or static site.

## **Best Practice**

* Keep your web root in `/var/www/` or another directory Apache already has access to.
    
* If you must serve from your home directory, adjust permissions carefully — don’t just `chmod 777`.
    
* Use `namei -l` to quickly spot where permissions break.
    

**In short:** This error isn’t about the file itself, it’s about Apache’s ability to walk the path to it. Give the web server execute permission on each parent directory, and your 403 Forbidden will vanish.
