Page 1 of 1

Web server confusion

Posted: Mon Feb 09, 2015 6:22 pm
by benderman
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

Re: Web server confusion

Posted: Mon Feb 09, 2015 6:33 pm
by plugwash
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.

Re: Web server confusion

Posted: Mon Feb 09, 2015 7:48 pm
by benderman
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?

Re: Web server confusion

Posted: Tue Feb 10, 2015 1:50 am
by klricks
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.

Re: Web server confusion

Posted: Tue Feb 10, 2015 12:32 pm
by benderman
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

Re: Web server confusion

Posted: Tue Feb 10, 2015 10:41 pm
by cyrano
Could it be that one index lives in the web server root and the other in the user's htmldoc folder?

Re: Web server confusion

Posted: Tue Feb 10, 2015 11:20 pm
by asandford
My local Wordpress blog has broken since an update, all the links are pointing to the wrong places....not sure whats up

Re: Web server confusion

Posted: Wed Feb 11, 2015 9:44 pm
by benderman
Thanks for the ideas but I'm going to give up on the web server idea, it's all a bit beyond me.

Re: Web server confusion

Posted: Wed Feb 11, 2015 11:51 pm
by iinnovations
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