Tag: Geospatial
Tweak network configurations of OpenGeo Suite Server
- February 27, 2013
- posted in: Geospatial
- No comments yet
A completely web-based architecture such as the OpenGeo Suite means that a change in the IP address of the server where it is installed impacts radically operations of applications and services. It often happens, however, that the server on which the prototype has been developed becomes a machine directly used in production or even when the network is forced to migrate toward a different configuration then the OGS IP address has to be changed. What does it happen to the deployed applications and how to proceed without having to reinstall all over again?
Base installation of OGS on Windows servers
When installing from scratch the package of the OpenGeo Suite on Windows the applications are deployed into the Jetty container whose configuration drives the way how they are published on the Web (default value for IP address is 127.0.0.1). Therefore assuming that the target address for the OGS server will be for example 192.168.0.10, let’s see what are the steps to follow.
Step 1
- Click on Start to go into command shell
- Run “Cmd + Enter” and then
- Edit the configuration file for the Jetty server
- Change the IP address in the xml
- Start the OpenGeo Suite from the Dashboard
1 |
cd "C:\Program Files\OpenGeo Suite\etc" |
1 |
C:\Program Files\OpenGeo Suite\etc>notepad.exe .\jetty.xml |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<!-- ======================================================= --> <!-- Configure a WebApp --> <!-- ======================================================= --> <!-- <New id="TestContext" class="org.mortbay.jetty.webapp.WebAppContext"> <Arg><Ref id="contexts"/></Arg> <Arg><SystemProperty name="jetty.home" default="."/>/webapps/test</Arg> <Arg>/</Arg> <Set name="classLoader"> <New class="org.mortbay.jetty.webapp.TransformingWebAppClassLoader"> <Arg><Ref id="TestContext"/></Arg> </New> </Set> <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set> <Set name="virtualHosts"> <Array type="java.lang.String"> <Item>192.168.0.10</Item> </Array> </Set> |
- Open Start –> Programs –> OpenGeo Suite –> OpenSuite Dashboard
- Click on the Start button
-
Once all services are up and running we can:
- Verify the right behavior of OGS applications on the default port:
- Open a browser and enter the new URL GeoServer http://192.168.0.10:8080/geoserver
- Login to GeoServer
It remains to remedy to the visualization of the map projects that have been stored and exported from the GeoExplorer application. In fact, each project uses the URL of OGS server at the time of saving the map, and therefore requires adjustments if you do not want to generate the same project from scratch.
GeoExplorer is a map viewer/composer developed from the OpenGeo SDK that uses a SQLite database to store configurations of map projects.
Assuming that a map was saved with an URL like http://127.0.0.1:8080/geoexplorer/viewer/#maps/1 (let’s keep in mind the last number) then what do we need to do for recovering the operation after a change of IP address?
Step 2
Download a SQLite editor
Download the free editor SQLite Studio for MS Windows. It’s a binary that can be directly executed with no need for installation
Edit GeoExplorer database
- Backup SQLite database. From the command shell in the HOME of the user run:
- Open SQLite Studio and connect to geoexplorer.db
- Open SQL query editor and run the following query to find the configurations of the map with id 1
- Go into edit mode on the config field of the row and then make Copy of the value
- Paste into a new window
- Find “127.0.0.1″ and replace with “192.168.0.10″
- Copy the whole modified text
- Back to SQLite studio, paste and overwrite the config field value
- Commit the change in the table maps
- Open a browser, enter the new URL of the map stored in GeoExplorer http://192.168.0.10:8080/geoexplorer/viewer/#maps/1 and the trick is done!
1 2 |
cd .opengeo copy geoexplorer.db geoexplorer.db.backup |
1 |
select * from maps where id=1 |
-
From the resultset:
In a text editor:
Read more
Adding Geoserver’s extensions to OpenGeo Suite in production
- February 4, 2012
- posted in: Geospatial
- No comments yet
OpenGeo Suite is smoothly installed in Ubuntu Server as documented here below, except for the database component because each web application is deployed into a Tomcat container. Such deployment is performed by copying the necessary applications installed with the suite to the webapps directory of Tomcat usually located at the following path /var/lib/tomcat6/webapps/. Specifically they are located in these directories while the installation is performed:
Component | Web Archive | Path |
---|---|---|
GeoServer | geoserver.war | /usr/share/opengeo-geoserver/ |
Dashboard | dashboard.war | /usr/share/opengeo-suite/ |
GeoWebCache | geowebcache.war | /usr/share/opengeo-suite/ |
GeoEditor | geoeditor.war | /usr/share/opengeo-suite/ |
GeoExplorer | geoexplorer.war | /usr/share/opengeo-suite/ |
Recipes | recipes.war | /usr/share/opengeo-suite/ |
Tips: If you want to check if the web archives installed are those deployed into Tomcat, execute the md5sum command on each file
First of all, you have to check the Geoserver’s version currently installed by loading its default page available at http://localhost/geoserver. The extension to be downloaded has to correspond accordingly to the above-checked version.
Create a temporary directory in the user home:
1 |
$ mkdir geoserver_ext |
1 |
$ cd geoserver_ext |
For example you want to install the new data stores listed below by grabbing:
MySQL Data Store:
1 |
$ wget http://downloads.sourceforge.net/geoserver/geoserver--mysql-plugin.zip |
SQL Server Data Store:
1 |
$ wget http://downloads.sourceforge.net/geoserver/geoserver--sqlserver-plugin.zip |
Before performing all operations to take over the current installed Geoserver WAR with a more library extension, it is necessary to execute a backup of this version:
1 2 |
$ cd /usr/share/opengeo-geoserver/ $ sudo cp geoserver.war geoserver.war._<timestamp> |
Then you can export the original web archive to a temporary directory:
1 2 3 |
$ sudo mkdir temp_war $ cd temp_war $ sudo jar xvf ../geoserver.war |
Now it’s time to endorse the library directory with these new extensions:
1 2 3 |
$ sudo unzip -d . /home/geoserver_ext/geoserver--mysql-plugin.zip $ sudo unzip -d . /home/geoserver_ext/geoserver--sqlserver-plugin.zip $ sudo cp *.jar WEB-INF/lib/ |
At the end of this activity it is necessary to generate the new Web Archive as follows:
1 |
$ sudo jar cvf geoserver.war index.html www/ data/ META-INF/ WEB-INF/ |
Then copy this new geoserver deployment into Tomcat:
1 2 |
$ sudo cp geoserver.war /var/lib/tomcat6/webapps/ $ sudo rm -rf /var/lib/tomcat6/webapps/geoserver/ |
Restart Tomcat and load GeoServer application again. A screen showing a new vector data store for SQL Server will be displayed!
OpenGeo Suite Linux Server Installation
- September 20, 2011
- posted in: Geospatial
- No comments yet
In this post we want to explain how OpenGeo Suite can be easily and rapidly installed in a linux box. We assume to work on Linux but the same can be applied to Windows servers or Mac OS X machines equipped with a specific package.
However, given that we worked with several linux installations and that such installations are the most proper choice for the management in production environment, we now describe how it is easy to install it through an APT-GET repository.
Hereafter is our Ubuntu target server description [as VMware virtual machine on ESXi infrastructure]:
Server | Value |
---|---|
OS | Ubuntu 10.04 Linux 32-bit |
Virtual Memory | 2 GB |
Virtual CPU | 1 |
Run the following command shell as sudo.
First of all, import OpenGeo GPG key by executing:
1 |
$ sudo wget -qO- http://apt.opengeo.org/gpg.key | apt-key add - |
Tip: Since sometime an error associated with “apt-key” command is displayed, check if some distro treats pipe differently and retype “sudo” or alternatively split that up.
1 2 |
$ sudo wget -qO- http://apt.opengeo.org/gpg.key > gpg.key $ sudo apt-key add gpg.key |
Add the APT repository for OpenGeo Suite:
1 |
$ sudo echo "deb http://apt.opengeo.org/ubuntu lucid main" >> /etc/apt/sources.list |
Update APT:
1 |
$ sudo apt-get update |
Execute a search for packages available:
1 |
$ sudo apt-cache search opengeo |
Tip: The search has to return at least one result otherwise the repository hasn’t been added correctly.
Make OpenGeo Suite package (opengeo-suite) installed:
1 |
$ sudo apt-get install opengeo-suite |
Post installation
Once the installation process is ended you can display the applications provided by the suite through an Apache Web Server.
To do this, enable a proxy into Apache. First of all, create a suitable configuration for it:
1 2 3 |
$ sudo ln -s /etc/apache2/mods-available/proxy.conf /etc/apache2/mods-enabled/proxy.conf $ sudo ln -s /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled/proxy.load $ sudo ln -s /etc/apache2/mods-available/proxy_http.load /etc/apache2/mods-enabled/proxy_http.load |
Then add a proxy-pass configuration for the local Tomcat container by setting:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
$ sudo chmod 666 /etc/apache2/sites-available/default $ sudo sed -i '$d' /etc/apache2/sites-available/default $ sudo sh -c "echo ' ' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyRequests Off' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo '# Remember to turn the next line off if you are proxying to a NameVirtualHost' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPreserveHost On' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo ' ' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo '<Proxy *>' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo ' Order deny,allow' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo ' Allow from all' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo '</Proxy>' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo ' ' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPass /geoserver http://localhost:8080/geoserver' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPassReverse /geoserver http://localhost:8080/geoserver' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPass /geoexplorer http://localhost:8080/geoexplorer' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPassReverse /geoexplorer http://localhost:8080/geoexplorer' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPass /geoeditor http://localhost:8080/geoeditor' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPassReverse /geoeditor http://localhost:8080/geoeditor' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPass /geowebcache http://localhost:8080/geowebcache' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPassReverse /geowebcache http://localhost:8080/geowebcache' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPass /dashboard http://localhost:8080/dashboard' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPassReverse /dashboard http://localhost:8080/dashboard' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPass /recipes http://localhost:8080/recipes' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPassReverse /recipes http://localhost:8080/recipes' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPass /opengeo-docs http://localhost:8080/opengeo-docs' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo 'ProxyPassReverse /opengeo-docs http://localhost:8080/opengeo-docs' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo ' ' >> /etc/apache2/sites-available/default" $ sudo sh -c "echo '</VirtualHost>' >> /etc/apache2/sites-available/default" |
Alternatively, use the script at this location here.
Finally, restart Apache by executing:
1 |
$ sudo service apache2 restart |