User avatar
benderman
Posts: 15
Joined: Wed Dec 17, 2014 8:19 am

Web server confusion

Mon Feb 09, 2015 6:22 pm

Hi all,

Any reason why I should see a different index file when I log in on my home network and when I log on externally? I have changed the default index.html which I see fine internally but I get a variation of the default page (which I'd previously modified).

When I check /var/www and do an ls I only see one index.html and when i look at that with nano the code is for the internal page.

I don't understand...

Cheers,

Ben

plugwash
Forum Moderator
Forum Moderator
Posts: 3670
Joined: Wed Dec 28, 2011 11:45 pm

Re: Web server confusion

Mon Feb 09, 2015 6:33 pm

The first things i'd check would be the clock on your pi and the timestamp on the file.

When caching interacts with wrong clocks/timestamps it can cause some weird affects.

User avatar
benderman
Posts: 15
Joined: Wed Dec 17, 2014 8:19 am

Re: Web server confusion

Mon Feb 09, 2015 7:48 pm

Thanks for the pointer.

The clock is on the correct date and time and the file properties say it was last modified yesterday and last accessed 2 days ago.

That seems OK, I guess?

Also the PI is on the wifi but trying to access it seems painfully slow from outside?

klricks
Posts: 7241
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Web server confusion

Tue Feb 10, 2015 1:50 am

Are you sure your page isn't being cached in your web browser? Try clicking the reload button.
If so you can add refresh code to your page so it automatically refreshes.

What is the upload speed of your ISP? Many ISPs the upload speed is much slower than download speed.

If possible do not use WIFI on the RPi..... connect directly to your router with network cable, it's much faster.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
benderman
Posts: 15
Joined: Wed Dec 17, 2014 8:19 am

Re: Web server confusion

Tue Feb 10, 2015 12:32 pm

Hi, I've tried clearing all the browser data and cache but still get the 'old' home page, really not sure what to do next. I've not really seen much about this issue when googling it.

Plugging it into the router is much quicker, thanks.

Ben

User avatar
cyrano
Posts: 714
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Web server confusion

Tue Feb 10, 2015 10:41 pm

Could it be that one index lives in the web server root and the other in the user's htmldoc folder?

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Web server confusion

Tue Feb 10, 2015 11:20 pm

My local Wordpress blog has broken since an update, all the links are pointing to the wrong places....not sure whats up

User avatar
benderman
Posts: 15
Joined: Wed Dec 17, 2014 8:19 am

Re: Web server confusion

Wed Feb 11, 2015 9:44 pm

Thanks for the ideas but I'm going to give up on the web server idea, it's all a bit beyond me.

User avatar
iinnovations
Posts: 621
Joined: Thu Jun 06, 2013 5:17 pm

Re: Web server confusion

Wed Feb 11, 2015 11:51 pm

Without your web server configuration, it's difficult to say.

If, for example, you have set up multiple virtual hosts, you may get a redirect for a remote address, while addressing directly by IP on your LAN might take you to a default page.

On nginx, for example, if you had the following:

Code: Select all

server {
    listen       80  default_server;
    ...
}

server {
    listen       80 ;
    server_name  myexternaldomain.com;
    ...
}
If you went to 192.168.1.50 or whatever IP your Pi lives on, it would be handled by the first block. If you went to externaldomain.com, it would be handled by the second block. If these are different directories, then there you have it. If you are unsure, make sure to check in the config file nginx.conf, or for apache look at apache2.conf and ports.conf.

A similar situation as above also applies to virtual hosts in any other server such as Apache.

C
CuPID Controls :: Open Source browser-based sensor and device control
interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

Return to “Networking and servers”