Tiro monedas al aire, pero hasta ahora nunca las pude agarrar.

En este post le voy a mostrar lo sencillo que es instalar Geoserver en Debian Wheezy y dejarlo funcionando como una aplicación de Tomcat.
Para realizar una instalación básica, necesitamos tener instalado el «Java OpenJDK» o el «jdk de SUN/Oracle».
Primero comprobaremos que no este ya instalada (en mi caso ya está instalado el java):
dpkg --get-selections | grep java

En caso de no tenerlo instalado, lo hacemos en la consola:
sudo aptitude update
sudo aptitude install openjdk-7-jdk

Ahora le toca el turno a Tomcat.
Escribimos en la consola:
sudo aptitude install tomcat7 tomcat7-admin tomcat7-common tomcat7-user tomcat7-docs tomcat7-examples

Ahora ya tenemos el Tomcat funcionando. Abrimos nuestro navegador y escribimos: «http://tuserver:8080/manager/html». En mi caso sería http://localhost:8080/manager/html

Si entras, te pedirá un usuario y un password. No te preocupes que ahora editaremos un archivo para poder acceder.
Escribimos en la consola:
sudo nano /etc/tomcat7/tomcat-users.xml

Editarlo como sigue:
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="tomcat,manager,manager-gui"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>

Ahora guardamos el archivo (Control + o), y luego lo cerramos (Control + x).

OBS:

  • Hemos hecho lo siguiente, definir un nuevo rol, llamado «manager» y «manager-gui», el cual es el necesario para manejar las aplicaciones instaladas, y luego al usuario genérico «tomcat» le hemos datos el rol de «manager y manager-gui».

Ahora reiniciamos el servidor Tomcat:
sudo /etc/init.d/tomcat7 restart

Ahora nos vamos a la web oficial de Geoserver y nos bajamos la versión «Web Archive», como indica la siguiente imagen.

Descargar GeoServer 2.5.2
Descargar GeoServer 2.5.2

Ya tenemos, el archivo «war«, osea descomprimí el que descargaste y tendrás el war..
Luego entras a tu navegador y escribís en la barra de direcciones (localhost:8080/manager/html).

OBS:

  • En mi caso es esa la IP, la tuya podría cambiar.

Te va a pedir un usuario y password, en mi caso seria:

  • User: tomcat
  • Password: tomcat

Volvemos a entrar a la consola y escribimos lo siguiente:
sudo nano /usr/share/tomcat7-admin/manager/WEB-INF/web.xml

Cambiamos el valor de max-file-size y de max-request-size, como se indica abajo:
<multipart-config>
<!-- 50MB max -->
<max-file-size>62428800624288000</multipart-config>
<max-request-size>100258913</max-request-size>

Ahora guardamos el archivo (Control + o), y luego lo cerramos (Control + x). Volvemos a entrar a la consola y escribimos lo siguiente:
sudo /etc/init.d/tomcat7 restart

Ahora nos dirigimos en la parte de donde dice Archivo war a desplegar.

Archivo war – GeoServer
Archivo war – GeoServer

Después de desplegar el war, accedemos a la aplicación Geoserver, en «localhost:8080/geoserver«.
El usuario y password de administrador por defecto es:

  • Usuario: admin
  • Password: geoserver
GeoServer 2.5.2 en Debian Wheezy
GeoServer 2.5.2 en Debian Wheezy

Comments

  1. hola buenas noches muy bueno tu tutorial pero presento muchos problemas uno de los principales es que cuando intento ingresar al tomcat con mi direccion ip ingresa pero me sale un error mira:

    403 Access Denied

    You are not authorized to view this page.

    If you have already configured the Manager application to allow access and you have used your browsers back button, used a saved book-mark or similar then you may have triggered the cross-site request forgery (CSRF) protection that has been enabled for the HTML interface of the Manager application. You will need to reset this protection by returning to the main Manager page. Once you return to this page, you will be able to continue using the Manager appliction’s HTML interface normally. If you continue to see this access denied message, check that you have the necessary permissions to access this application.

    If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

    For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.

    Note that for Tomcat 7 onwards, the roles required to use the manager application were changed from the single manager role to the following four roles. You will need to assign the role(s) required for the functionality you wish to access.

    manager-gui – allows access to the HTML GUI and the status pages
    manager-script – allows access to the text interface and the status pages
    manager-jmx – allows access to the JMX proxy and the status pages
    manager-status – allows access to the status pages only

    The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection:

    Users with the manager-gui role should not be granted either the manager-script or manager-jmx roles.
    If the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces are intended for tools not humans) then the browser must be closed afterwards to terminate the session.

    For more information – please see the Manager App HOW-TO.

  2. he intentado cambiarla contraseña y poner otro usuario y el error persiste la verdad no entiendo por que

  3. En el caso de Debian Jessie para instalar el tomcat utilicé el Gestor de Paquete Synaptic y los DVD de debiam. Instalé el Geoserver 2.8. La explicación es perfecta. Gracias.

Responder a Sebastián Amaya Cancelar la respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *