0

In my raspberry pi when I go to http://localhost/ I see a Apache2 debian default page,

So I went to

/var/www/html/index.html

and changed the source code to see if there were any changes in the page, and there aren't.

So, there's some other server running and sharing the same folder maybe?

sudo netstat | grep apache  

shows nothing, neither does httpd

4
  • Apart from should being "sudo netstat -a | grep http" and you probably wont be reloading the browser to get the new content of the page....no ideas. Have you checked this well, or am I missing something? Feb 22, 2019 at 14:38
  • thanks for the support, i feel stupid this browser is really bad, doesnt have any options, im installing chromium now
    – Navy Seal
    Feb 22, 2019 at 15:03
  • See my answer about the cache... some browsers might have different behaviours and/or configurations...which browser anyway? (btw, also from Porto)= Feb 22, 2019 at 15:04
  • I was using raspberry pre installed browser epiphany
    – Navy Seal
    Mar 8, 2019 at 17:30

2 Answers 2

3

If wget -O - http://localhost fails, then it must be coming from the browser cache.

1
  • yea seems to be cache , i hate this web browser, i had to go to preferences clean all data. Once i did the page start returning connection refused
    – Navy Seal
    Feb 22, 2019 at 14:43
2

You are making several simple mistakes.

Firstly, the port service name for the HTTP/HTTPS services is named http or https and not apache.

For checking the service name:

$ grep http /etc/services 
http        80/tcp      www     # WorldWideWeb HTTP
https       443/tcp             # http protocol over TLS/SSL
http-alt    8080/tcp    webcache    # WWW caching service
http-alt    8080/udp

Secondly, to see listening services you have to give the -a option to netstat.

So, you should be running:

netstat -a | grep http

or:

$ netstat -a | grep LISTEN | grep http
tcp        0      0 0.0.0.0:http            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:https           0.0.0.0:*               LISTEN   

You could also check Apache is running checking the process:

$ ps ax | grep apache
 2362 ?        Ss     0:00 /usr/sbin/apache2 -k start
 2366 ?        S      0:00 /usr/sbin/apache2 -k start
 2367 ?        S      0:00 /usr/sbin/apache2 -k start
 2368 ?        S      0:00 /usr/sbin/apache2 -k start
 2369 ?        S      0:00 /usr/sbin/apache2 -k start
 2370 ?        S      0:00 /usr/sbin/apache2 -k start
23476 pts/0    S+     0:00 grep apache

So then you know Apache is running.

As for the page change: If using Debian or raspbian, the default is indeed /var/www/html. The most probable thing is being the former version cached in the browser. At most, the default configuration could have been changed, but I guess you would remember doing it.

As for caching pages, your browser might not be entirely at fault. If you want to signal some page is not to be cached, you have to return headers signalling data to client software (browser, proxies).

Namely these headers:

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

You alternatively signal that you do not want particular pages cached in HTML:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

See for more details: How to control web page caching, across all browsers?

P.S. Obviously signalling that you do not want pages cached is more useful for HTML pages with dynamic content. However, due the nature of the question, this situation was explored to try to explain your browser might be behaving as it is expected of it.

corollary: As a former Galician mentor of mine used to say, the important part of having tools, is understanding how they behave before putting them at fault.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .