You are not logged in.

#1 2019-09-26 16:15:35

bhagenow
Member
Registered: 2019-09-26
Posts: 2

Apache returning bad response headers and garbage in content

I rarely use Apache on my Arch Linux machine but now I have need. It was working fine last April which was the last time I used it but now it returns bad headers and garbage characters in the content. Does anyone have any idea what might have happened between April and now and what I can do to fix it? Re-installing Apache did not resolve it.

This is what I get (notice it says "No headers"):

[user@archlinux public_html]$ wget localhost/~user/
--2019-09-26 10:00:36--  http://localhost/~user/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9
Length: unspecified
Saving to: ‘index.html.1’

index.html.1                  [      <=>                             ]     381  --.-KB/s    in 4.8s    

2019-09-26 10:00:42 (79.8 B/s) - ‘index.html.1’ saved [381]

The contents of the file is:

[user@archlinux public_html]$ cat index.html.1
4:02:40 GMT
ETag: "4e-59358b96adc5c"
Accept-Ranges: bytes
Content-Length: 78
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
Content-Language: en

<html>
<head>
<title>Test</title>
</head>
<body>
This works!
</body>
</html>

* There is a long string of ? after the closing html tag that did not copy and paste.

The time before the headers is the timestamp of the index.html file adjusted for time zone. I assume this is why wget doesn't recognize headers and why the web browser displays it as text instead of rendering the page.

-rwxr-xr-x 1 user root   78 Sep 24 22:02 index.html

The group is root because my public_html is a mount on a NAS.

I would appreciate any help to get this to return a correct text/html response and get rid of the leading timestamp and trailing garbage characters. As well as any insight as to why this stopped working. I am the only person that uses this machine and I rarely use apache on it so I have no idea at what point this stopped working.

Offline

#2 2019-09-26 16:27:26

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Apache returning bad response headers and garbage in content

Have you correctly merged any .pacnew files?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2019-10-01 18:50:07

bhagenow
Member
Registered: 2019-09-26
Posts: 2

Re: Apache returning bad response headers and garbage in content

No, I don't see any outstanding .pacnew files.

Just to try something I created a new public_html2 folder that is local (not CIFS mount) and copied everything from my normal public_html to it. When using the local directory Apache works correctly. When using the remote mounted public_html the page is served with the headers messed up so it is not recognized as an http response.

Offline

Board footer

Powered by FluxBB