[GIS] How to put data in remote geoserver

boundless-suitegeoserverpostgis

I created some layers and upload it to PostGIS and then GeoServer and then styled it using GeoExplorer. I have done all this in localhost. I used the iframe generated in GeoExplorer and used it in my webpage. So I can open it in my computer. But I don't understand how to keep this in remote server so that everyone can access it.
I used OpenGeoSuite for doing all this.
Is the data I uploaded in PostGIS and GeoServer just located in my computer or in remote server? Please help!!

Question Extension

This is the code that I am trying to run. But it's not working even in the same machine:

var map;

function init() {
   map = new OpenLayers.Map('map_element', {});


   var road_name = new OpenLayers.Layer.WMS(
            "IIRS:river_canal_project - Tiled",
"http://localhost:8080/geoserver/IIRS/wms",
            {
                LAYERS: 'IIRS:river_canal_project',
                STYLES: '',
                format: format,
                tiled: true,
                tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
            },
            {
                buffer: 0,
                displayOutsideMaxExtent: true,
                isBaseLayer: false,
                yx : {'EPSG:4326' : true}
            } 
        );

   Var industrial_park = new OpenLayers.Layer.WMS(
            "IIRS:future_industrial_project - Tiled", 
"http://localhost:8080/geoserver/IIRS/wms",
            {
                LAYERS: 'IIRS:future_industrial_project',
                STYLES: '',
                format: format,
                tiled: true,
                tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
            },
            {
                buffer: 0,
                displayOutsideMaxExtent: true,
                isBaseLayer: false,
                yx : {'EPSG:4326' : true}
            } 
        );

   var land_use = new OpenLayers.Layer.WMS(
            "http://localhost:8080/geoserver/IIRS/wms",
            {
                LAYERS: 'IIRS:current_landuse_project',
                STYLES: '',
                format: format
            },
            {
               singleTile: true, 
               ratio: 1, 
               isBaseLayer: true,
               yx : {'EPSG:4326' : true}
            } 
        );
   map.addLayers([land_use, industrial_park, road_name]);
   if(!map.getCenter()){
       map.zoomToMaxExtent();
   }
}

Along with the code, I inserted openlayers.js in script and only that.
I found myself some mistakes and now I that can load the map but..the images are not loading.
This is my edited code :

map = new OpenLayers.Map('map_element', {});            
            // setup tiled layer
            var tiled = new OpenLayers.Layer.WMS(
                "earth:ne_10m_railroads - Tiled",      
"http://localhost:8080/geoserver/earth/wms",
                {
                    LAYERS: 'earth:ne_10m_railroads',
                    STYLES: '',
                    format: OpenLayers.Format.WMSGetFeatureInfo,
                    tiled: true,
                    tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
                },
                {
                    buffer: 0,
                    displayOutsideMaxExtent: true,
                    isBaseLayer: true,
                    yx : {'EPSG:900913' : false}
                } 
            );


            map.addLayer(tiled);
var bounds = new OpenLayers.Bounds(
                -135.326858520508, -30.5615100860596,
                179.357788085938, 69.604377746582
);


    map.zoomToExtent(bounds);
}

Best Answer

The Answer depends on what you mean by remote server.

Ideally, you would have a server connected to the internet (or maybe intranet only, dependent on your need). You would then install the OpenGeo suite on it, and copy your data into the Postgresql database on the Server.

You would then configure Geoserver to serve this data as WMS/WFS services, just like you have done on your development machine.

After this you would copy your JavaScript Application onto a webserver on that server, making sure that it is pointing to the geoserver on that machine, and is accessible from clients.

Related Question