What is wrong with my webserver installation?

I’m trying to set up a webserver on my OpenSUSE Leap 15.6 and I manage to get Apache up and running (se below):

Firewall:/etc/apache2 # systemctl status apache2.service
● apache2.service - The Apache Webserver
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: disabled)
     Active: active (running) since Fri 2025-03-14 09:22:30 CET; 2s ago
   Main PID: 12260 (httpd-prefork)
     Status: "Processing requests..."
      Tasks: 6
        CPU: 100ms
     CGroup: /system.slice/apache2.service
             ├─12260 /usr/sbin/httpd-prefork -DSYSCONFIG -DSSL -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//l>
             ├─12277 /usr/sbin/httpd-prefork -DSYSCONFIG -DSSL -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//l>
             ├─12278 /usr/sbin/httpd-prefork -DSYSCONFIG -DSSL -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//l>
             ├─12279 /usr/sbin/httpd-prefork -DSYSCONFIG -DSSL -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//l>
             ├─12280 /usr/sbin/httpd-prefork -DSYSCONFIG -DSSL -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//l>
             └─12281 /usr/sbin/httpd-prefork -DSYSCONFIG -DSSL -C "PidFile /run/httpd.pid" -C "Include /etc/apache2/sysconfig.d//l>

Mar 14 09:22:30 Firewall systemd[1]: Starting The Apache Webserver...
Mar 14 09:22:30 Firewall systemd[1]: Started The Apache Webserver.
------------------------------------------------------------------------------------------------------------

However i I try to “surf” to the servers ip-address (either via http or https) I get the result:

# Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the [webmaster](mailto:webmaster@localhost).

## Error 403

WHAT HAVE I MISSED?

Any hints are greatly appreciated!

/Henrik

To begin with:
Please, to make the pieces of computer code in your posts better consumable by technical oriented people:

And post as complete as possible. That is starting with the line with the prompt and the command, then all output, and ending with the new prompt line.
When you really feel you need to change anything in such a copy, then in a comment, else we take all characters literally.

Then, you have the server running, but no prove whatsoever that you have any contents file(s) stored in the correct place.
Nor that that “correct place” is configured correct in your Apache configuration.

@HenrikLjungberg:

For a while now, there ain’t no default examples included with the “apache2” package – you have to “roll your own” …


You then have to drop some HTML into the default ‘/srv/www/htdocs/’ directory.

For example, some HTML5 code to test your server:

  • “index.html”:
<!DOCTYPE html>
<html lang="??">
  <head>
    <meta charset="UTF-8">
    <!-- The Browser's Tab Title -->
    <title>your.host.and.local.domain</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <main>
      <!-- Page content -->
      <h1>Checking if …</h1>
    </main>
  </body>
</html>
  • “style.css”:
/* style.css */
body {
  color: black;
  background-color: aqua;
}

It’s been a long time since I played with web servers, but if my memory serves me well, check:

firewalls
httpd.conf
robots.txt
listen.conf

You will have to search tutorials for details though.

@HenrikLjungberg:

One more thing –

  • The package “system-user-wwwrun” has to be installed –
    Both “user(wwwrun)” and “group(www)” are required by the “apache2” package.
 > LANG=C zypper info --provides system-user-wwwrun
Loading repository data...
Reading installed packages...


Information for package system-user-wwwrun:
-------------------------------------------
Repository     : Haupt-Repository
Name           : system-user-wwwrun
Version        : 20170617-150400.24.2.1
Arch           : noarch
Vendor         : SUSE LLC <https://www.suse.com/>
Installed Size : 96 B
Installed      : Yes
Status         : up-to-date
Source package : system-users-20170617-150400.24.2.1.src
Summary        : System user wwwrun and group www
Description    : 
    This package provides the system account 'wwwrun' and group 'www'.
Provides       : [4]
    user(wwwrun)
    group(www)
    group(wwwrun)
    system-user-wwwrun = 20170617-150400.24.2.1

 >

If this package has been installed then, the following login directory permissions are correct for the “wwwrun” user’s login directory –

 > l -d /var/lib/wwwrun
drwxr-xr-x 2 wwwrun root 4096  4. Dez 2023  /var/lib/wwwrun/
 >

AFAICS, the “apache2” package requires the user and group provided by the “system-user-wwwrun” package but, if for what ever reason, the “system-user” package was never installed then, Apache will have a couple of runtime issues …

Turn the firewall off and then check web services. If turning the firewall off works, then check the zones.if that dose not work, leave it off and look at Apache.

Given Leap 15.6, the Firewall should be “firewalld” and, provided that, the LAN is private – behind a Router – a default zone setting of “trusted” could be OK.

Sorry, I do not understand something.
I appreciate that people try to throw in several ways that may lead to a solution. But please read what the OP provided. He can reach the Apache server, and the server shows hm a HTTP 403 error page. So there can’t be a problem in connecting through the network. Thus all extensive meditations about firewalls, etc. are useless.

Further the OP did not answer any of the questions asked three days ago, thus (s)he seems not to be interested in a solution anymore. I guess everybody can spend her/his energy better on other threads.

@HenrikLjungberg:

As the error message indicates:

There is either no index document

Drop an ‘index.html’ file into the ‘/srv/www/htdocs/’ directory and, the error will disappear.

  • Tested with a fresh Leap 15.6 installation in a VM and, simply installing the “apache2” package with everything that, that package wants to be installed on the system.

Isn’t that the same as we in post #2 and #3 already suggested?
But he is on personal hibernation I assume and not interested in our input.

Not really –

  • Because of another thread I installed Leap 15.6 into a VM and then installed Apache2 on that freshly installed system.
    Then, I revisited the error text which appears if there ain’t nothing in the ‘/srv/www/htdocs/’ directory – it’s horrible!!! :imp: :space_invader: :disappointed:

# Access forbidden!

Huh!!!??? – “Access forbidden!” just because a file is missing???

  • That’s crazy!!! … :grimacing: :roll_eyes:

I remember getting those when it is missing file, which imho should be error 404 (file not found), but that is a minor detail. There is an answer from the browser, thus no network problem. And the OP should check where the contents of his web server is and if that is configured correct and if the files are readable by Apache (wwwrun), etc., etc. But as he vanished, I think we can put our efforts in a more rewarding problem topic.

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