Mailing List Archive

Apache serving a page that doesn't exist
Apache 2.4.25 on a Fedora server.

Due to an emergency I created an html page saying that a function was
unavailable. The old page (on the apache base directory) was page.php and the
emergency page was linked to that as page.php -> pagex.html. Worked perfectly.

Now the problem is resolved and I renamed the emergency page as pagex.html.old,
a soft link to pagex.html -> page.php and the original page is back where it
used to be.

If I request page.php I get it as expected BUT if I request pagex.html, which no
longer exists, the SOURCE of pagex.html is displayed on the browser. I thought
this might be a browser cache issue so I rebooted the workstation and it still
happened. So I rebooted the server and the problem still exists. I checked
using ls -l page* and pagex.html does not exist.

If I removed the pagex.html -> page.php link everything works properly but some
customers have bookmarked pagex.html so I would like to have this link for them.

Any ideas of what I have forgotten?

Thanks in advance.

John
======

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache serving a page that doesn't exist [ In reply to ]
Sounds like mod_negotiation / MultiViews. If you don't use it
intentionally, `Options -MultiViews` in your DocumentRoot might help.

On Sat, Dec 3, 2022 at 3:36 PM John Iliffe <john.iliffe@iliffe.ca> wrote:
>
> Apache 2.4.25 on a Fedora server.
>
> Due to an emergency I created an html page saying that a function was
> unavailable. The old page (on the apache base directory) was page.php and the
> emergency page was linked to that as page.php -> pagex.html. Worked perfectly.
>
> Now the problem is resolved and I renamed the emergency page as pagex.html.old,
> a soft link to pagex.html -> page.php and the original page is back where it
> used to be.
>
> If I request page.php I get it as expected BUT if I request pagex.html, which no
> longer exists, the SOURCE of pagex.html is displayed on the browser. I thought
> this might be a browser cache issue so I rebooted the workstation and it still
> happened. So I rebooted the server and the problem still exists. I checked
> using ls -l page* and pagex.html does not exist.
>
> If I removed the pagex.html -> page.php link everything works properly but some
> customers have bookmarked pagex.html so I would like to have this link for them.
>
> Any ideas of what I have forgotten?
>
> Thanks in advance.
>
> John
> ======
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


--
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache serving a page that doesn't exist [ In reply to ]
Thanks Eric.

No, this is a pretty basic configuration and I am not using mod-negotiation that
I know of. Not even sure what it does!

I'll try that and see what happens.

Thanks for the prompt reply.

John
======
On Sat, 2022-12-03 at 15:40 -0500, Eric Covener wrote:
> Sounds like mod_negotiation / MultiViews. If you don't use it
> intentionally, `Options -MultiViews` in your DocumentRoot might help.
>
> On Sat, Dec 3, 2022 at 3:36 PM John Iliffe <john.iliffe@iliffe.ca> wrote:
> >
> > Apache 2.4.25 on a Fedora server.
> >
> > Due to an emergency I created an html page saying that a function was
> > unavailable. The old page (on the apache base directory) was page.php and the
> > emergency page was linked to that as page.php -> pagex.html. Worked perfectly.
> >
> > Now the problem is resolved and I renamed the emergency page as pagex.html.old,
> > a soft link to pagex.html -> page.php and the original page is back where it
> > used to be.
> >
> > If I request page.php I get it as expected BUT if I request pagex.html, which no
> > longer exists, the SOURCE of pagex.html is displayed on the browser. I thought
> > this might be a browser cache issue so I rebooted the workstation and it still
> > happened. So I rebooted the server and the problem still exists. I checked
> > using ls -l page* and pagex.html does not exist.
> >
> > If I removed the pagex.html -> page.php link everything works properly but some
> > customers have bookmarked pagex.html so I would like to have this link for them.
> >
> > Any ideas of what I have forgotten?
> >
> > Thanks in advance.
> >
> > John
> > ======
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache serving a page that doesn't exist [ In reply to ]
Hi Eric:

Didn't work, I added Options -MultiViews to both the document root and the
specific directory (one below the root) where the page used to be, did an
apachectl stop and start (not graceful as I wanted to be sure everything got
reloaded) and Apache is still serving the source for the deleted page.

The only thing I can think of is that the deleted page is an html page and the
link is to a php page so the php-fpm processor is not being invoked for some
reason on the link. But it still shouldn't be able to serve a page that doesn't
exist!

Finally, I figured maybe the MultiViews was generating a map using the only
page. file with an html extension (page.html.old) so I moved it to another
directory, reset the link and I still get the source displayed. The browser URL
line shows that pagex.html is being displayed and not page.php so Apache must be
ignoring the link. I think the source gets displayed because the browser has no
idea how to display a page with extension "old". (not surprising!)

Any suggestions as to where to go next?

Regards,

John
======
On Sat, 2022-12-03 at 15:40 -0500, Eric Covener wrote:
> Sounds like mod_negotiation / MultiViews. If you don't use it
> intentionally, `Options -MultiViews` in your DocumentRoot might help.
>
> On Sat, Dec 3, 2022 at 3:36 PM John Iliffe <john.iliffe@iliffe.ca> wrote:
> >
> > Apache 2.4.25 on a Fedora server.
> >
> > Due to an emergency I created an html page saying that a function was
> > unavailable. The old page (on the apache base directory) was page.php and the
> > emergency page was linked to that as page.php -> pagex.html. Worked perfectly.
> >
> > Now the problem is resolved and I renamed the emergency page as pagex.html.old,
> > a soft link to pagex.html -> page.php and the original page is back where it
> > used to be.
> >
> > If I request page.php I get it as expected BUT if I request pagex.html, which no
> > longer exists, the SOURCE of pagex.html is displayed on the browser. I thought
> > this might be a browser cache issue so I rebooted the workstation and it still
> > happened. So I rebooted the server and the problem still exists. I checked
> > using ls -l page* and pagex.html does not exist.
> >
> > If I removed the pagex.html -> page.php link everything works properly but some
> > customers have bookmarked pagex.html so I would like to have this link for them.
> >
> > Any ideas of what I have forgotten?
> >
> > Thanks in advance.
> >
> > John
> > ======
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: Apache serving a page that doesn't exist [ In reply to ]
What about mod_cache? Is it stuck in the cache?


Thanks,


Sent with BlackBerry Work (www.blackberry.com)
________________________________
From: John Iliffe <john.iliffe@iliffe.ca>
Sent: Dec 3, 2022 4:06 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache serving a page that doesn't exist

Hi Eric:

Didn't work, I added Options -MultiViews to both the document root and the
specific directory (one below the root) where the page used to be, did an
apachectl stop and start (not graceful as I wanted to be sure everything got
reloaded) and Apache is still serving the source for the deleted page.

The only thing I can think of is that the deleted page is an html page and the
link is to a php page so the php-fpm processor is not being invoked for some
reason on the link. But it still shouldn't be able to serve a page that doesn't
exist!

Finally, I figured maybe the MultiViews was generating a map using the only
page. file with an html extension (page.html.old) so I moved it to another
directory, reset the link and I still get the source displayed. The browser URL
line shows that pagex.html is being displayed and not page.php so Apache must be
ignoring the link. I think the source gets displayed because the browser has no
idea how to display a page with extension "old". (not surprising!)

Any suggestions as to where to go next?

Regards,

John
======
On Sat, 2022-12-03 at 15:40 -0500, Eric Covener wrote:
> Sounds like mod_negotiation / MultiViews. If you don't use it
> intentionally, `Options -MultiViews` in your DocumentRoot might help.
>
> On Sat, Dec 3, 2022 at 3:36 PM John Iliffe <john.iliffe@iliffe.ca> wrote:
> >
> > Apache 2.4.25 on a Fedora server.
> >
> > Due to an emergency I created an html page saying that a function was
> > unavailable. The old page (on the apache base directory) was page.php and the
> > emergency page was linked to that as page.php -> pagex.html. Worked perfectly.
> >
> > Now the problem is resolved and I renamed the emergency page as pagex.html.old,
> > a soft link to pagex.html -> page.php and the original page is back where it
> > used to be.
> >
> > If I request page.php I get it as expected BUT if I request pagex.html, which no
> > longer exists, the SOURCE of pagex.html is displayed on the browser. I thought
> > this might be a browser cache issue so I rebooted the workstation and it still
> > happened. So I rebooted the server and the problem still exists. I checked
> > using ls -l page* and pagex.html does not exist.
> >
> > If I removed the pagex.html -> page.php link everything works properly but some
> > customers have bookmarked pagex.html so I would like to have this link for them.
> >
> > Any ideas of what I have forgotten?
> >
> > Thanks in advance.
> >
> > John
> > ======
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache serving a page that doesn't exist [ In reply to ]
Hi Jon:

Not so far as I know; that was the reason for restarting using stop/start
instead of using graceful. I wanted to be sure the cache was fully cleared.
I also rebooted the workstation to be sure the browser cache was deleted too.

In playing around with this I seem to have changed the problem, or at least the
symptom. Now it would appear that the correct page is being loaded but with
incorrect mime type (?). In the following discussion, ord0001.php works
correctly and has for many years.

I reset the link again to point ord0001x.html to ord0001.php, and I removed the
original ord0001x.html to avoid the previous problem.

ls -al ord0001*
-rw-r--r--. 1 root root 7437 Jun 7 15:54 ord0001.php
-rw-r--r--. 1 root root 10174 Nov 1 11:16 ord0001r.php
lrwxrwxrwx. 1 root root 11 Dec 3 19:39 ord0001x.html -> ord0001.php

Now the correct (I can tell by some of the content) page is served but with the
wrong type: (cut and pasted from browser screen}

-------
To order an item, click on the icon; when complete click Check Out "; for
($i=0;$i<$num_rows;$i++) { $this_item = pg_fetch_array($result,$i,PGSQL_ASSOC);
echo '
'; echo ''; echo '
$' . $this_item['i_price'] . ' ' . $this_item['i_name'] , '?' .
$this_item['i_desc'] . '
'; } } } else { $err = true; $errno = 1; } } if ($err) { $fh =
fopen($elog,"wa"); $errlog = $timestamp . "\tord0001: "; switch ($errno) { case
1: fwrite($fh,($errlog . "Unable to connect to database, order terminated\n"));
echo "
------

As you can see, the words are sort of randomly selected with PHP, html, and a
bit of Javascript code all munged together. There is a lot more of both that is
not displayed on the screen at all and these lines are out of sequence.

It appears that php-fpm didn't get a whack at the page before it was served,
even though the page is valid and the extension is ".php". It would seem that
Apache treated the page using the initial extension (.html) instead of the
linked page extension (.php)

So sort of out of the frying pan and into the fire!

Regards,

John
======
On Sat, 2022-12-03 at 22:57 +0000, jonmcalexander@wellsfargo.com.INVALID wrote:
> What about mod_cache? Is it stuck in the cache?
>
>
> Thanks,
>
>
> Sent with BlackBerry Work (www.blackberry.com)
> From: John Iliffe <john.iliffe@iliffe.ca>
> Sent: Dec 3, 2022 4:06 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Apache serving a page that doesn't exist
>
> Hi Eric:
>
> Didn't work, I added Options -MultiViews to both the document root and the
> specific directory (one below the root) where the page used to be, did an
> apachectl stop and start (not graceful as I wanted to be sure everything got
> reloaded) and Apache is still serving the source for the deleted page.
>
> The only thing I can think of is that the deleted page is an html page and the
> link is to a php page so the php-fpm processor is not being invoked for some
> reason on the link.  But it still shouldn't be able to serve a page that
> doesn't
> exist!
>
> Finally, I figured maybe the MultiViews was generating a map using the only
> page. file with an html extension (page.html.old) so I moved it to another
> directory, reset the link and I still get the source displayed.  The browser
> URL
> line shows that pagex.html is being displayed and not page.php so Apache must
> be
> ignoring the link.  I think the source gets displayed because the browser has
> no
> idea how to display a page with extension "old".  (not surprising!)
>
> Any suggestions as to where to go next?
>
> Regards,
>
> John
> ======
> On Sat, 2022-12-03 at 15:40 -0500, Eric Covener wrote:
> > Sounds like mod_negotiation / MultiViews. If you don't use it
> > intentionally, `Options -MultiViews` in your DocumentRoot might help.
> >
> > On Sat, Dec 3, 2022 at 3:36 PM John Iliffe <john.iliffe@iliffe.ca> wrote:
> > >
> > > Apache 2.4.25 on a Fedora server.
> > >
> > > Due to an emergency I created an html page saying that a function was
> > > unavailable.  The old page (on the apache base directory) was page.php and
> > > the
> > > emergency page was linked to that as page.php -> pagex.html.  Worked
> > > perfectly.
> > >
> > > Now the problem is resolved and I renamed the emergency page as
> > > pagex.html.old,
> > > a soft link to pagex.html -> page.php and the original page is back where
> > > it
> > > used to be.
> > >
> > > If I request page.php I get it as expected BUT if I request pagex.html,
> > > which no
> > > longer exists, the SOURCE of pagex.html is displayed on the browser. I
> > > thought
> > > this might be a browser cache issue so I rebooted the workstation and it
> > > still
> > > happened.  So I rebooted the server and the problem still exists. I
> > > checked
> > > using ls -l page* and pagex.html does not exist.
> > >
> > > If I removed the pagex.html -> page.php link everything works properly but
> > > some
> > > customers have bookmarked pagex.html so I would like to have this link for
> > > them.
> > >
> > > Any ideas of what I have forgotten?
> > >
> > > Thanks in advance.
> > >
> > > John
> > > ======
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail: users-help@httpd.apache.org
> > >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache serving a page that doesn't exist [ In reply to ]
> It appears that php-fpm didn't get a whack at the page before it was served,
> even though the page is valid and the extension is ".php". It would seem that
> Apache treated the page using the initial extension (.html) instead of the
> linked page extension (.php)

Apache doesn't use the link target in the way you expect (it is not
fed back into config sections like Directory or Files/FilesMatch)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Apache serving a page that doesn't exist [ In reply to ]
Thanks Eric:

That is probably what is happening (now). There is a fairly obvious solution to
this problem then, just set up a JavaScript href=... switch using the original
page and let the browser request the proper one. Is there a general work around
for this sort of situation that will cause the proper handler to be used?

Thanks again for everything.

John
=========
On Sat, 2022-12-03 at 20:57 -0500, Eric Covener wrote:
> > It appears that php-fpm didn't get a whack at the page before it was served,
> > even though the page is valid and the extension is ".php". It would seem
> > that
> > Apache treated the page using the initial extension (.html) instead of the
> > linked page extension (.php)
>
> Apache doesn't use the link target in the way you expect (it is not
> fed back into config sections like Directory or Files/FilesMatch)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org