1

I recently installed apache 2.4 on an openSUSE Leap 15.1 server on an local network, with php enabled. I can access html and php files from a browser on a desktop, but resources (images, css and javascript) are not loaded.

After investigation, it seems that the connection is closed when the browser requests these files but not html or php ones:

C:\Users\PATRICK>curl -v http://myserver/style.css
*   Trying 192.168.0.250...
* TCP_NODELAY set
* Connected to myserver (192.168.0.250) port 80 (#0)
> GET /style.css HTTP/1.1
> Host: myserver
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 05 Nov 2019 04:59:19 GMT
< Server: Apache
< Last-Modified: Wed, 30 Oct 2019 06:51:25 GMT
< ETag: "2e5-5961b2954acf9"
< Accept-Ranges: bytes
< Content-Length: 741
< Content-Type: text/css
<
* transfer closed with 741 bytes remaining to read
* Closing connection 0
curl: (18) transfer closed with 741 bytes remaining to read

This behaviour does not occur when querying from the server itself. The apache access logs seem to indicate that, from its perspective, the request was served successfully:

192.168.200.30 - - [05/Nov/2019:04:59:19 +0000] "GET /style.css HTTP/1.1" 200 741 "http://myserver/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"

I can't figure out what's going on.

ptrico
  • 131
  • 7
  • I've disabled the firewall and I still experience the same issue. So not the problem here. What else could I investigate? – ptrico Nov 06 '19 at 07:58

2 Answers2

2

So the answer is that I needed this parameter in my Apache configuration file :

EnableSendFile Off

As the documentation reads :

This directive controls whether httpd may use the sendfile support from the kernel to transmit file contents to the client. By default, when the handling of a request requires no access to the data within a file -- for example, when delivering a static file -- Apache httpd uses sendfile to deliver the file contents without ever reading the file if the OS supports it.

It would appear this is not properly supported on the server I'm running (OpenSUSE Leap 15.1 with 4.12.14-lp151.28.20-default kernel).

ptrico
  • 131
  • 7
0

Hy, Finaly find the answer on an other forum. Take a look at listen.conf

The orignal contains : Listen 80

So the apache server only listen on IP6.

I changed the conf to : Listen 0.0.0.0:80

Now the server listen on IP4... It works !

Guiss
  • 1