Upgrade Leap 15.5 > 15.6 changed /srv/www/htdocs/index.html

I just upgraded a Leap 15.5 system to 15.6 using the on-line method (most important command zypper --releasever 15.6 dup --allow-vendor-change).

All went very well and the system is up and running again.

The system runs Apache. From /etc/apache2/default-server.conf:

DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs">
...

Using a browser to go there I got a message telling that it is not allowed to read the page.

I have also some other directories, one of them

Alias /milweb/ "/home/henk/milweb/"
<Directory "/home/henk/milweb">
...

Those were (and are) readable and shown by the browser.

Investigation in srv/www/htdocs showed that index.html was renamed index.html.rpmnew and the r-bit for group and others were removed. Reversing this made everything working again as expected.

As I understand it during a package update a file that is due to be overwritten can be kept and the new file is created with th same name and the suffix .rpmnew added. But in this case index.html was not kept, but renamed (the contents was OK) and r-bits removed.
BTW the same was done to favicon.ico.

It is repaired now, but I wonder if some bug report would be applicable or if I am wrong here in my assessment. Anybody experiencing the same or similar.

Telling what package owns /srv/www/htdocs/index.html would be useful.

Yes, good idea.

boven:~ # zypper se -f /srv/www/htdocs/index.html
Loading repository data...
Reading installed packages...
No matching items found.

    Note: For an extended search including not yet activated remote resources please use 'zypper
    search-packages'.
boven:~ # zypper se -f /srv/www/htdocs
Loading repository data...
Reading installed packages...

S  | Name       | Summary                                       | Type
---+------------+-----------------------------------------------+--------
i  | filesystem | Basic Directory Layout                        | package
i  | info2html  | Program to Convert Info Pages into HTML Pages | package
   | nextcloud  | File hosting service                          | package

    Note: For an extended search including not yet activated remote resources please use 'zypper
    search-packages'.
boven:~ # 

So it does not seem to be installed at all, but created by the web manager long ago.

That does not make it better understood by me why this upgrade touched it.

Additional I looked at my backup. Before the upgrade:

backup:/backups/backup.0/boven.henm.xs4all.nl/srv/www/htdocs # ls -l index.html 
-rw-r----- 10 1004 www 872 Mar  1  2019 index.html
backup:/backups/backup.0/boven.henm.xs4all.nl/srv/www/htdocs # 

(UID 1004 is not configured on the backup system, it is wappl on the boven system).

It shows more changes then I thought:

  • name change from index.html to index.html.rpmnew
  • owner:group change from wappl:www to root:root`
  • removal of group read permission.

There is simply not enough information to guess. The file /etc/www/htdocs/index.html was likely provided by some package before upgrade and so was removed during upgrade. The .rpmnew file may have been there for a long time, you did not show timestamp. There is no evidence that this file has been created during upgrade.

That is partly because the very upgrade destroyed a lot of evidence.

The file index.html definitely contains it’s contents since at least 2019-03-01 as the list from the backup (the backup is from 2024-10-22) shows. As I am also the web master, I am pretty sure that I created that file myself and I did not change it for years (it may even be older, but 2019-03-01 may be the date of a fresh installation).
And BTW, that contents is still unchanged (see the sizes of the file in Post #1 and the size in the backup). Thus it was NOT removed and a new .rpmnew file with a new contents created. mv the file to the correct name and setting r-permission restored the web site’s functionality.

The .rpmfile is NOT in the backup. I can of course fire up the backup system again and post a complete ls -l of the backed up /srv/www/htdocs directory, but I did it this morning (when I copied/pasted the ls -l index.html of post #4).

Of course I can not prove it and you have to take my word (or not :wink: ) that thew web site functioned until the upgrade. The upgrade itself took me less then an hour. After that, testing if all things were OK, I found this.

And I agree that there probably is not enough information to guess what happened. That is why I posted here. Maybe others are smarter then I am.

I tried to reproduce the issue, but it did not occur in my testing. Are you able to reproduce it?

Do you really have a Leap 15.5 with LAMP running that you upgraded using the online method to 15.6?

I doubt very much. The system is now upgraded 15.5 > 15.6 (what produced the problem). I do not think it is easy to revert the system to the 15.5 situation. In other words, downgrading is not supported. And I have no other 15.5 system with a running Apache.

I have one other system that I upgraded a few weeks ago, but it hasn’t a LAMP sever and /srv/www/htdocs is empty there.

@hcvv:

Henk, for whatever reason, the openSUSE Apache package doesn’t include a default ‘/srv/www/htdocs/index.html’ file.

Searching the Net reveals an old “StackExchange” discussion and, an old “stackoverflow” discussion –
<Apache2 in OpenSUSE>
<The Suse Apache didn’t create a index.html file by default don’t know why.>

‘/etc/apache2/httpd.conf’ contains the following –

# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var

The openSUSE Apache2 documentation doesn’t have any related information – apart from a section dealing with the DocumentRoot permissions –

<The Apache HTTP server>


Is it worth a Bug Report containing a Change Request?

  • If yes, then, a documentation change indicating the need for the creation of a site specific ‘index.html’ file could, possibly, be helpful.

Thanks for trying to help.

But I either do not understand you, or you misread what is the problem.

The problem is NOT that on installation of Apache (which was done by me many, many years ago for the first time and done again on the last time I did a fresh new installation, also some years ago) index.html is not provided (what should it contain?). The index.html as available on the system now, was created by me when I created the web site. And wasn’t changed since at least 2019-03-01 which was then in Leap 15.0. It survived all upgrade steps > 15.1 > 15.2 > 15.3 > 15.4 > 15.5 unharmed.

But now on the upgrade > 15.6 it was changed from

-rw-r----- 10 wappl www  872 Mar  1  2019 index.html

into

-rw------- 10 root root 872 Mar  1  2019 index.html.rpmnew

Same for favicon.ico
No other changes in the /srv/www/htdocs/ directory.

I am with @arvidjaar that there are almost no hints to what did this. The fact that (as you stressed) index.html is not part of apache2 or any other package makes it even more mysterious. And thus it will be very difficult to file a decent bug report.

PM. the second ls list above is from what I remember. I am not sure of the date, it could be that it was changed to 2024-10-28.

For what it’s worth, in answer to “(what should it contain?)” – here’s an example simple HTML5 ‘index.html’ –

<!DOCTYPE html>
<html lang="de">
  <head>
    <meta charset="UTF-8">
    <!-- The Browser's Tab Title -->
    <title>???.fritz.box</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <main>
      <!-- Page content -->
      <h1>Prüfen ob …</h1>
    </main>
  </body>
</html>

And, an example simple Style Sheet –

/* style.css */
body {
  color: black;
  background-color: aqua;
}

Other distributions do include a default “index.html” – openSUSE doesn’t …

  • If, we’re wanting to be “new user friendly” then, we could at least provide some example file content for a simple “does it work” scenario …

That may be a discussion, but that is not the subject of this thread. I prefer to stay on topic.

@hcvv:

Taking a look at the scripts which are part of the apache2 RPM packages –

One of the things which the “apache2” package does, is the removal of the “wwwadmin” group –

postinstall scriptlet (using /bin/sh):
# wwwadmin group existed in past remove after openSUSE-13.2 out of support scope
if grep -q "^wwwadmin:" /etc/group; then
        groupmod -n www wwwadmin 2>/dev/null ||:
        usermod -g www wwwrun 2>/dev/null ||:
        usermod -s /bin/false wwwrun 2>/dev/null ||:
fi

But, nothing related to the ‘/srv/www/htdocs/’ directory content – the “filesystem” package also doesn’t touch that directory.

Therefore, it seems that, an upgraded package on your system has a post-install script which touches the files in the ‘/srv/www/htdocs/’ directory –

  • But, which one?

Yes, that is the big question. :question:

Yes, in a test VM. I’ve only installed apache2 package, created the /srv/www/htdocs/index.html and upgraded to Leap 15.6.

OK, it only confirms that it is not obvious which package does do this. Or which action.

And that makes it more unlikely that I will be able to create a system exactly as it was before the upgrade, because it is very unknown which aspect is to be get special attention to re-create it exactly as it was.

Try this and see if it shows anything: rpm --query --all --scripts | grep /srv/www

boven:~ # rpm --query --all --scripts | grep /srv/www
boven:~ # 

Hi Henk,

You might want to check /var/log/zypp/history . Look what I found in my archived history:

# 2023-01-29 16:58:13 apache2-2.4.51-150400.6.3.1.x86_64 removed ok
# Additional rpm output:
# warning: /etc/apache2/mod_mime-defaults.conf saved as /etc/apache2/mod_mime-defaults.conf.rpmsave
# rm: cannot remove '/var/lib/systemd/migrated/apache2': No such file or directory
# 
2023-01-29 16:58:13|remove |apache2|2.4.51-150400.6.3.1|x86_64|root@lanserv|
2023-01-29 16:58:13|remove |apache2-doc|2.4.51-150400.6.3.1|noarch|root@lanserv|
# 2023-01-29 16:58:13 apache2-example-pages-2.4.51-150400.6.3.1.x86_64 removed ok
# Additional rpm output:
# warning: /srv/www/htdocs/index.html saved as /srv/www/htdocs/index.html.rpmsave
# 

That was a zypper up in 15.4 . So far, I spare you all the logs unless you need it. You’ll probably find your own details.

Wow, here it is:

# 2024-10-28 14:41:11 apache2-2.4.58-150600.5.26.1.x86_64.rpm installed ok
# Additional rpm output:
# Please check /etc/permissions.local for settings of /usr/sbin/suexec .
# Updating /etc/sysconfig/apache2 ...
# warning: /srv/www/htdocs/index.html saved as /srv/www/htdocs/index.html.rpmsave
# warning: /srv/www/htdocs/favicon.ico saved as /srv/www/htdocs/favicon.ico.rpmsave
# Requesting apache restart (all instances)
# 

But now, why would anybody want to do this?
This is normally done to configuration files, but then a new file is installed and the old file is saved. But here there is no new file at all.

Apart from the fact that replacing a websites main entrance page is a bit rude to say it friendly.

I think this is enough stuff to start a bug report. Will do that tomorrow and report here.

Thanks @kasi042 , very to the point.