[Geoserver-devel] GeoServer 1.5.3 Install

When starting up the web ui using the short cut installed into the start menu (ie http://127.0.0.1:8080/geoserver/)
some of the demos don't function.
- (works) http://localhost:8080/geoserver/demo.do
- (does not work) http://171.0.0.1:8080/geoserver/demo.do

The Google Maps API key used on this web site was registed for a different website. you can generate a new key for this web site at http://www.google.com/apis/maps/

Jody

Hey Jodi, that Key will probably work for http://localhost:8080/geoserver

Google won’t differential between 127.0.0.1, localhost, your machines name or IP address eta… its purely domain based authentication. Kinda sucks if you are hosting via server aliases, a bit like your use case here…

A solution that would reduce this problem would be… Do not add the GMap.js to the page . Instead load a script, which looks at the document.location, when the location is matched to a Name Value Pair location/APIKey inject the GMap.js into the head with the matched APIKey appended to it. Still not the best but would help.

Injecting JS could be done like this… (credit to OpenLayers).

var gMapSrc = " http://google.com/xxxxxxx?APIKey=“+ apiKey;
if (/MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {
document.write(”";
} else {
var s = document.createElement(“script”);
s.src = gMapSrc;
var h = document.getElementsByTagName(“head”).length ?
document.getElementsByTagName(“head”)[0] :
document.body;
h.appendChild(s);

On 9/10/07, Jody Garnett <jgarnett@anonymised.com> wrote:

When starting up the web ui using the short cut installed into the start
menu (ie http://127.0.0.1:8080/geoserver/)
some of the demos don’t function.

The Google Maps API key used on this web site was registed for a
different website. you can generate a new key for this web site at
http://www.google.com/apis/maps/

Jody


This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Thanks Andrew; the bug report is that the short cut installed in the start menu is to 127.0.0.1 and not localhost; as I recall localhost has to be added in the hosts file - so unless we can get a google key for 127.0.0.1 we will have to find another way to make the demo work (perhaps the installer can modify the hosts file?)

Cheers,
Jody

Hey Jodi, that Key will probably work for http://localhost:8080/geoserver

Google won't differential between 127.0.0.1 <http://127.0.0.1/&gt;, localhost, your machines name or IP address eta... its purely domain based authentication. Kinda sucks if you are hosting via server aliases, a bit like your use case here...

A solution that would reduce this problem would be.... Do not add the GMap.js to the page <head>. Instead load a script, which looks at the document.location, when the location is matched to a Name Value Pair location/APIKey inject the GMap.js into the head with the matched APIKey appended to it. Still not the best but would help.

Injecting JS could be done like this.... (credit to OpenLayers).

            var gMapSrc = " http://google.com/xxxxxxx?APIKey=&quot;\+ apiKey;
            if (/MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {
                document.write("<script src='"+gMapSrc + "'></script>";
            } else {
                var s = document.createElement("script");
                s.src = gMapSrc;
                var h = document.getElementsByTagName("head").length ?
                           document.getElementsByTagName("head")[0] :
                           document.body;
                h.appendChild(s);

On 9/10/07, *Jody Garnett * <jgarnett@anonymised.com <mailto:jgarnett@anonymised.com>> wrote:

    When starting up the web ui using the short cut installed into the
    start
    menu (ie http://127.0.0.1:8080/geoserver/)
    some of the demos don't function.
    - (works) http://localhost:8080/geoserver/demo.do
    - (does not work) http://171.0.0.1:8080/geoserver/demo.do

    The Google Maps API key used on this web site was registed for a
    different website. you can generate a new key for this web site at
    http://www.google.com/apis/maps/

    Jody

    -------------------------------------------------------------------------

    This SF.net email is sponsored by: Microsoft
    Defy all challenges. Microsoft(R) Visual Studio 2005.
    http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
    <http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/&gt;
    _______________________________________________
    Geoserver-devel mailing list
    Geoserver-devel@lists.sourceforge.net
    <mailto:Geoserver-devel@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
------------------------------------------------------------------------

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
  

Jody Garnett ha scritto:

When starting up the web ui using the short cut installed into the start menu (ie http://127.0.0.1:8080/geoserver/)
some of the demos don't function.
- (works) http://localhost:8080/geoserver/demo.do
- (does not work) http://171.0.0.1:8080/geoserver/demo.do

The Google Maps API key used on this web site was registed for a different website. you can generate a new key for this web site at http://www.google.com/apis/maps/

Ouch, you're right, we should fix the shortcut created by the installer.
And we should state that the demo works only on localhost in the
description.

http://jira.codehaus.org/browse/GEOS-1323

Cheers
Andrea