Contao-Camp 2024
Ergebnis 1 bis 3 von 3

Thema: Kann app_dev.php Login bei All-Inkl nicht setzen (mit htaccess parallel)

  1. #1
    Contao-Nutzer
    Registriert seit
    28.03.2019.
    Beiträge
    40

    Standard Kann app_dev.php Login bei All-Inkl nicht setzen (mit htaccess parallel)

    Ich wollte auf einem All-Inkl Webspace das Login für die app_dev.php setzen. Da es noch Entwicklungsumgebung ist, habe ich auch einen allgemeinen .htaccess-Schutz in der /web liegen. Entsprechend habe ich darauf geachtet, dass ich beim Setzen des Logins per für die app_dev.php die exakt selbe Kombination aus Benutzernamen und Passwort setze. Für SSH bin ich so rangegangen:

    Code:
    /usr/bin/php72 vendor/bin/contao-console contao:install-web-dir --user=BENUTZERNAME --password=PASSWORT
    (Benutzername und Passwort durch die korrekten im SSH-Aufruf ersetzt und mehrfach überprüft)

    Rufe ich die app_dev.php über domain.tld/app_dev.php/contao/login auf, erscheint die Passwortabfrage. Egal wie oft ich die Logindaten eingebe, kommt sie aber immer wieder.

    Aus einem Ticket habe ich gesehen, dass es bei einem anderen Hoster geholfen hat, stattdessen die app_dev von Contao 4.5 zu nutzen. Ich habe also auch die app_dev.php von Contao 4.5 auf den Server gepackt und als app_dev45.php benannt. Rufe ich sie über domain.tld/app_dev45.php/contao/login auf, habe ich aber das selbe Problem.

    Hat jemand einen Ansatz für mich? Könnte es damit zu tun haben, mit welchem Hashing Algorhythmus das Passwort in der .htpasswd gesetzt ist? Also dass der Server die beiden Logindaten aus .htpasswd und dem per SSH gesetzten Login sonst nicht als identisch erkennt?

  2. #2
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    34.062
    Partner-ID
    10107

    Standard

    Du musst deinen eigenen Passwort Schutz entfernen - zumindest wenn du die app_dev.php verwendest. In einem anderen Thread gibt es dazu von mir ein Beispiel für die .htaccess

  3. #3
    Contao-Nutzer
    Registriert seit
    28.03.2019.
    Beiträge
    40

    Standard

    Es lag wohl an der generierten Benutzername/Passwort Kombi. Da war irgendwo der Wurm drin (vielleicht wie oben vermutet die Sache mit dem Algorhythmus). Ich habe es nun mit http://www.htaccesstools.com/htpasswd-generator/ neu generiert und plötzlich läuft alles problemlos.

    Der Inhalt meiner 4.4 htaccess (Standard + Spookys Ergänzungen):

    Code:
    <IfModule mod_headers.c>
        # Allow access from all domains for webfonts (see contao/core-bundle#528)
        <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
            Header set Access-Control-Allow-Origin "*"
        </FilesMatch>
    </IfModule>
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        # Determine the RewriteBase automatically and set it as environment variable.
        # If you are using Apache aliases to do mass virtual hosting or installed the
        # project in a subdirectory, the base path will be prepended to allow proper
        # resolution of the app.php file and to redirect to the correct URI. It will
        # work in environments without path prefix as well, providing a safe, one-size
        # fits all solution. But as you do not need it in this case, you can comment
        # the following 2 lines to eliminate the overhead.
        RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
        RewriteRule ^(.*) - [E=BASE:%1]
    
        # Sets the HTTP_AUTHORIZATION header removed by Apache
        RewriteCond %{HTTP:Authorization} .
        RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect to URI without front controller to prevent duplicate content
        # (with and without `/app.php`). Only do this redirect on the initial
        # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
        # endless redirect loop (request -> rewrite to front controller ->
        # redirect -> request -> ...).
        # So in case you get a "too many redirects" error or you always get redirected
        # to the start page because your Apache does not expose the REDIRECT_STATUS
        # environment variable, you have 2 choices:
        # - disable this feature by commenting the following 2 lines or
        # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
        #   following RewriteCond (best solution)
        RewriteCond %{ENV:REDIRECT_STATUS} ^$
        RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
    
        # If the requested filename exists, simply serve it.
        # We only want to let Apache serve files and not directories.
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^ - [L]
    
        # Rewrite all other queries to the front controller.
        RewriteRule ^ %{ENV:BASE}/app.php [L]
    </IfModule>
    
    <IfModule !mod_rewrite.c>
        <IfModule mod_alias.c>
            # When mod_rewrite is not available, we instruct a temporary redirect of
            # the start page to the front controller explicitly so that the website
            # and the generated links can still be used.
            RedirectMatch 302 ^/$ /app.php/
            # RedirectTemp cannot be used instead
        </IfModule>
    </IfModule>
    
    SetEnvIfNoCase Request_URI ^/app_dev.php($|/) allow_access
    SetEnvIfNoCase Request_URI ^/contao-manager.phar.php($|/) allow_access
    AuthUserFile "/www/htdocs/FOO/web/.htpasswd"
    AuthName "Geschuetzt"
    AuthType Basic
    Order Deny,Allow
    Deny from all
    Satisfy any
    Require valid-user
    Allow from env=allow_access
    So klappt es nun. Vielen Dank.

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •