Ir al contenido principal

Snippets Mongo DB

 Esta publicación servirá para ir colocando fragmentos de consultas que en algún momento me fueron útiles para usarlo en MongoDB Fragmento 1:  Se requería obtener todos los elementos que dentro de un atributo que es de tipo array(arreglo) coincida  con type:"fire"  Fragmento 2: Se requería actualizar el atributo " lastUpdate "  de toda la colección donde la  edad sea mayor o igual a 15.

Habilitar Manager de Tomcat 8

Bien esta vez , lo escribo para repasar como habilitar el administrador de tomcat para poder desplegar el war,  ya que hoy se me habia olvidado como se hace esto y realmente es muy sencillo pero por si alguna otra vez ando distraido aca lo explico de manera rapida.



Cuando se decarga tomcat, en mi caso apache-tomcat-8.0.3 trae por defaul la configuracion inicial de acceso al manager. por lo que es necesario habilitarlo ya que si no se hace, no se podra tener acceso a este y al cancelar la accion nos mostrara algun texto como este


401 Unauthorized

You are not authorized to view this page. 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.


Para hablitarlo nos diringimos ala capeta conf de nuestro tomcat

/apache-tomcat-8.0.3/conf/tomcat-user.xml



Por default trae esta configuracion:

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>

Hay que moficarlo por esta:

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>


</tomcat-users>

Reiniciamos nuestro tomcat (Si es que lo teniamos trabajando), y listo







Comentarios

Entradas más populares de este blog

Resetear usuario y contraseña Weblogic

Esta ocasión se me presento un pequeño problema con el acceso a mi weblogic local, podía levantar mi weblogic pero para entrar a la consola no tenia el usuario ni password (Autenticación Denegada Weblogic).Por lo que busque en la red para poder resetear el usuario y password de weblogic.

No se puede llamar Invoke o a BeginInvoke

Que tal banderola pues aca escribiendo sobre un error que me dio al instalar el administrador Microsoft SQL 2008 , pues bien resulta que necesitaba instalar esta tool, y cuando trataba de iniciar el wizard me lanzaba un error que decia algo asi " No se puede llama a Invoke o a BeginInvoke en un control hasta que se halla creado el indentificador de ventana" si no me creen vean la imagen : y entonces me dije a mi mismo, "mi mismo como le voy hacer" entonces pues tube que recurrir a mi salvacion como siemore :D San Google.com, y ya con unas cuantas palabras clave pues que me lanza algunos resultados de los cuales me habia encontrado algo como esto: Problemas al instalar SQL Server 2008 ? Para lo cual no hice caso a este tip pues resulta que yo no tenia instaldo el windows xp, mas bien tenia instalado el windows 7 por que leyendo en los comentarios que se habian hecho llegue a un muy buen tip que decia algo asi: "Para aquellos compañeros que quieren instalar el S