AH00035 - search permissions are missing on a component of the path

Hi! The obligatory: I’m a little new to linux, pardon my ignorance c:

How I got here: I’m trying to set up nextcloud, and going along this guide, I’m first trying to set up an Apache2 server, using the linked guide there about setting up LAMP.

Error I’m trying to solve right now: I’ve installed apache2 and set it up, however at http://localhostI get a 403 / access forbidden error.

In /var/log/apache2/error_log, I see the following upon connecting:
[Sun Mar 01 14:32:30.781698 2026] [core:error] [pid 45675:tid 45675] (13)Permission denied: [client 127.0.0.1:51996] AH00035: access to /index.html denied (filesystem path '/srv/www/htdocs/index.html') because search permissions are missing on a component of the path

I’ve eventually learned from the apache docs that this is a permission issue and usually occurs when apache doesn’t have access to the directory declared in /etc/apache2/default-server.conf (which is /srv/www/htdocs for me - the default).

But I’ve went through and made sure it should have - here’s the output of namei:

# namei /srv/www/htdocs/index.html -m -o

f: /srv/www/htdocs/index.html
 drwxr-xr-x root root /
 drwxr-xr-x root root srv
 drwxr-xr-x root root www
 drwxr-xr-x root root htdocs
 -rwxr-xr-x root root index.html

the /srv directory was assigned to root:root by default, but while troubleshooting I’ve found that apache has it’s own user/group, in /etc/apache2/uid.conf - by default, this was user wwwrun and group www.

Changing the owner to wwwrun:www on /srv/www/htdocs doesn’t seem to change anything, but just in case, here’s the output once i do:

# namei /srv/www/htdocs/index.html -m -o

f: /srv/www/htdocs/index.html
 drwxr-xr-x root   root /
 drwxr-xr-x wwwrun www  srv
 drwxr-xr-x wwwrun www  www
 drwxr-xr-x wwwrun www  htdocs
 -rwxr-xr-x wwwrun www  index.html

Lastly, here’s the versions stuff, for OpenSUSE:

NAME="openSUSE Tumbleweed"
# VERSION="20260128"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20260128"

and Apache:
Server version: Apache/2.4.66 (Linux/SUSE)

I imagine i’m doing something trivial wrong - will be grateful for any help or pointers.

Hello and welcome to the openSUSE forums.

Strange because all x-bits you show are set. Does not matter who the owner is.

I have this (on Leap 15.6):

boven:~ # namei /srv/www/htdocs/index.html -m -o
f: /srv/www/htdocs/index.html
 drwxr-xr-x root  root /
 drwxr-xr-x root  root srv
 drwxr-xr-x root  root www
 drwxr-xr-x root  root htdocs
 -rw-r----- wappl www  index.html
boven:~ #

And Apache can read that because all x-bits for others are set and the Apache processes are group www.

Something with SELinux?

systemctl status apache2

Fair point - here’s the ouput:

# systemctl status apache2

* apache2.service - The Apache Webserver
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: disabled)
     Active: active (running) since Sun 2026-03-01 16:06:01 CET; 3min 32s ago
 Invocation: 7e31705a26f3484496fecfb0f1712c8c
   Main PID: 55166 (httpd-prefork)
     Status: "Total requests: 1; Idle/Busy workers 100/0;Requests/sec: 0.00478; Bytes served/sec:   0 B/sec"
      Tasks: 7
        CPU: 256ms
     CGroup: /system.slice/apache2.service
             |-55166 /usr/sbin/httpd-prefork -DSYSCONFIG -DphpMyAdmin -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include />
             |-55170 /usr/sbin/httpd-prefork -DSYSCONFIG -DphpMyAdmin -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include />
             |-55173 /usr/sbin/httpd-prefork -DSYSCONFIG -DphpMyAdmin -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include />
             |-55174 /usr/sbin/httpd-prefork -DSYSCONFIG -DphpMyAdmin -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include />
             |-55175 /usr/sbin/httpd-prefork -DSYSCONFIG -DphpMyAdmin -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include />
             |-55176 /usr/sbin/httpd-prefork -DSYSCONFIG -DphpMyAdmin -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include />
             `-55185 /usr/sbin/httpd-prefork -DSYSCONFIG -DphpMyAdmin -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//loadmodule.conf" -C "Include />

Mar 01 16:06:00 localhost.localdomain systemd[1]: Starting The Apache Webserver...
Mar 01 16:06:01 localhost.localdomain systemd[1]: Started The Apache Webserver.

You were right @hcvv - it was SELinux. That was a great lead, thank you!

After a quick google I’ve found this article which ended up resolving the problem.

sealert -l "*" produced the same error:

SELinux is preventing httpd from getattr access on the file /srv/www/htdocs/index.html.

And following the troubleshooting steps in-console i’ve only had to do:
semanage fcontext -a -t httpd_sys_content_t '/var/www/htdocs/index.html'
(for future users, because this wasn’t obvious to me - /var/www/ instead of /srv/www/is important)

and then restorecon -v '/srv/www/htdocs/index.html'.

Everything works now, thanks y’all!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.