[GRLUG] Strange behavior with /var/www/html/

Grand Rapids Linux Users Group grlug at grlug.org
Wed Nov 2 23:11:17 EDT 2022


You could always fire up an Ubuntu Docker instance that mounts the
/var/www/html/ folder and runs Apache to see if you can replicate the issue.

$ docker container run \

-d \

-p 5100:80 \

--name apache2 \

-v /var/www/html/:/var/www/html/ \

ubuntu/apache2


Then connect to http://localhost:5100

It's not an LTS Ubuntu, but that's ok.

$ docker container exec apache2 grep ^PRE /etc/os-release
PRETTY_NAME="Ubuntu 22.10"





On Wed, Nov 2, 2022 at 8:03 PM Grand Rapids Linux Users Group <
grlug at grlug.org> wrote:

> Apache access log only indicates "404."
>
> Nothing in the Apache error log for today.
>
> It's probably one of those mysteries I have to live with.
>
> Thanks anyway.
> On 11/2/22 19:45, Grand Rapids Linux Users Group wrote:
>
> What web server: nginx, apache, other?
> What do the logs say?
>
>
>
> On Wed, Nov 2, 2022 at 4:43 PM Grand Rapids Linux Users Group <
> grlug at grlug.org> wrote:
>
>> It's not permissions. Nearly all are 777 for some reason and the
>> inconsistent behavior also happens with the few that are 553 or 533.
>>
>> It's not ownership. All are owned by "Me."
>>
>> Web-server is clearly listening on localhost. Is there any reason it
>> would have to listen on 127.0.0.1 for just certain files (which are coded
>> exactly like the others)? How would subnet restrictions or re-writes affect
>> some of the files in /var/www/html but not others?
>>
>> In any case, why would opening them from the file directory then make it
>> possible to open from the webbrowser?
>>
>>
>> On 11/2/22 18:00, Grand Rapids Linux Users Group wrote:
>>
>> Could be many things.. file permissions, file ownership (www-data).  Also
>> could be, depending upon the type of web-server, maybe it's only listening
>> on localhost? 127.0.0.1? or maybe there are subnet restrictions or
>> re-writes in the config file?
>>
>> On Wed, Nov 2, 2022 at 5:49 PM Grand Rapids Linux Users Group <
>> grlug at grlug.org> wrote:
>>
>>> I've got a new computer with Ubuntu 20.04.
>>>
>>> Some of the files in my /var/www/html directory behave funny. Many open
>>> fine in response to localhost/file.html or to localhost/ericbeversluis,
>>> where ericbeversluis is, eg, a WP site on my computer.
>>>
>>> But some of the individual files behave strangely. When I try to open
>>> them I get a 404, "Requested URL was not found on this server."
>>>
>>> I can't tell any difference between those that open and those that
>>> don't. To further confuse me, when I click on the file in the file browser,
>>> they open nicely in Firefox--as file:///var/www/html/file.html. After
>>> that happens some then open nicely in response to localhost/file.html.
>>>
>>> Many of the file have traveled from an old Fedora box to the webserver
>>> on a Macbook Pro to this new box. But that history doesn't seem to
>>> correlate with the different behaviors.
>>>
>>> Any insight into what's going on here?
>>> --
>>> Eric Beversluis www.ericbeversluis.com Forthcoming: *For Love of a
>>> Father*
>>> --
>>> grlug mailing list
>>> grlug at grlug.org
>>> https://shinobu.grlug.org/mailman/listinfo/grlug
>>>
>>
>> --
>> Eric Beversluis www.ericbeversluis.com Forthcoming: *For Love of a
>> Father*
>> --
>> grlug mailing list
>> grlug at grlug.org
>> https://shinobu.grlug.org/mailman/listinfo/grlug
>>
>
> --
> Eric Beversluis www.ericbeversluis.com Forthcoming: *For Love of a Father*
> --
> grlug mailing list
> grlug at grlug.org
> https://shinobu.grlug.org/mailman/listinfo/grlug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://shinobu.grlug.org/pipermail/grlug/attachments/20221102/ce4918ea/attachment.htm>


More information about the grlug mailing list