12 Último

.htaccess

      • 769
      • mensajes
      • miembro desde
      • 13/06/02
    • Senior Member
    21/01/2003
    #1 .htaccess

    estuve viendo los threads de aca de psico y vi tutoriales de otros lugares sobre este archivo pero no lo logro hacer funcionar

    1ro: pongo este archivo (.htaccess) en el directorio que quiero proteger con contraseña
    contenido del archivo :

    Código:
    AuthType Basic
    AuthName "Lugar prohibido"
    AuthUserFile /dondesea/subdir1/.htpasswd
    AuthGroupFile /dev/null
    
    
    require user nombredelusuario
    
    2: creo el .htpasswd y lo coloco en la ruta que puse en AuthUserFile
    el archivo lo creo con el commando htpasswd del directorio bin de apache
    entonces hago ./htpasswd -c nombredelusuario , y despues pongo la clave 2 veces y listo
    el contenido de este archivo me queda
    Código:
    nombredelusuario:GsgsSER453SFS0


    entonces voy al explorer e intento ingresar al directorio ese
    http://www.midominio.com/privado
    y entro como si nada


    que estoy haciendo mal? probe reiniciando el apache y nada, tengo que darle algun tipo de permiso o asignarlos a algun grupo a los archivos?
  1. ¿Este tema te pareció interesante? Compártelo!

    ¿No es lo que buscabas? Intenta buscar un tema similar

    10 comentarios / 1448 Visitas

      • 432
      • mensajes
      • miembro desde
      • 04/02/02
    21/01/2003
    #2

    Hola,

    Me parece que el problema viene por este lado:

    Esta es la explicacion de la directiva Limit.

    directive
    Syntax: ...
    Context: any
    Status: core
    Access controls are normally effective for all access methods, and this is the usual desired behavior. In the general case, access control directives should not be placed within a section.

    The purpose of the directive is to restrict the effect of the access controls to the nominated HTTP methods. For all other methods, the access restrictions that are enclosed in the bracket will have no effect. The following example applies the access control only to the methods POST, PUT, and DELETE, leaving all other methods unprotected:


    Require valid-user

    The method names listed can be one or more of: GET, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, and UNLOCK. The method name is case-sensitive. If GET is used it will also restrict HEAD requests.
    Link Apache Limit Directive

    Me parece que si denegas el acceso a GET, no puede obtener los headers. Proba sacandole la directiva Limit a ver si funciona. Si des pues queres restringir algo en particular vas probando.

    En mi caso sin la directiva Limit me funciona perfectamente. Y luego de tres intentos fallidos me redirige a un 401.

    salu2
      • 769
      • mensajes
      • miembro desde
      • 13/06/02
    • Senior Member
    21/01/2003
    #3

    lo probe y nada

    tengo que cambiar algo en el archivo de virtualhosts??

      • 432
      • mensajes
      • miembro desde
      • 04/02/02
    21/01/2003
    #4

    A ver...

    El apache lo tenes local en tu maquina? Tenes derechos para acceder al archivo de configuracion?

    Troubleshooting
    When you put configuration directives in a .htaccess file, and you don't get the desired effect, there are a number of things that may be going wrong.

    Most commonly, the problem is that AllowOverride is not set such that your configuration directives are being honored. Make sure that you don't have a AllowOverride None in effect for the file scope in question. A good test for this is to put garbage in your .htaccess file and reload. If a server error is not generated, then you almost certainly have AllowOverride None in effect.

    If, on the other hand, you are getting server errors when trying to access documents, check your Apache error log. It will likely tell you that the directive used in your .htaccess file is not permitted. Alternately, it may tell you that you had a syntax error, which you will then need to fix.
    Link a htaccess Troubleshooting

    Fijate de probar lo que dice aca a ver que hace.

    salu2
      • 769
      • mensajes
      • miembro desde
      • 13/06/02
    • Senior Member
    21/01/2003
    #5

    en el archivo httpd.conf tengo una parte que dice

    Código:
    
    Options FollowSymLinks
    AllowOverride None
    
    pero despues en archivo virtualhosts no tengo nada con respecto al allow override none

    saco ese allow override none que esta en el httpd.conf ??? no corren peligro mis sitios?
      • 769
      • mensajes
      • miembro desde
      • 13/06/02
    • Senior Member
    21/01/2003
    #6

    bueno hice esto
    al archivo httpd.conf
    le agrege esto

    Código:
    
    AllowOverride All
    
    y ahora me pone
    Código:
    Internal Server Error (500)
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, admin@unsitio.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    
    More information about this error may be available in the server error log.
    cuando quiero acceder al privado ese
      • 432
      • mensajes
      • miembro desde
      • 04/02/02
    21/01/2003
    #7

    y el server error log que dice?

    porque me parece que las comillas dobles estan demas.

      • 769
      • mensajes
      • miembro desde
      • 13/06/02
    • Senior Member
    21/01/2003
    #8

    lo puse sin comillas y me tira lo mismo
    el log del apache me dice

    Código:
    200.69.18.177 - - [21/Jan/2003:15:58:40 -0300] "GET /admin HTTP/1.1" 500 626 "-" "Mozilla/4.0" (compatible; MSIE 5.01; Windows NT 5.0)"
    tipo no me dice nada del otro mundo me dice lo que veo en la pantalla digamos
      • 432
      • mensajes
      • miembro desde
      • 04/02/02
    21/01/2003
    #9

    este me parece que es el HTTPRequestLog, no el ServerErrorLog.
    Fijate en el otro log que ahi mismo.

    Que raro que sin comillas te de error, parecería que esta todo bien.

    a ver asi:

    Código:
    /*>
    AllowOverride All
    
      • 769
      • mensajes
      • miembro desde
      • 13/06/02
    • Senior Member
    21/01/2003
    #10

    el log que te di es el que tengo configurado asi como custom mio, el que vos me decis no se donde esta

    ahroa que puse como me dijiste vos, pasa de largo como normal, me muestra la pagina

12 Último