cb cb cb cb cb cb Willkommen auf dem coding-board cb

Zurück   coding-board > Schnittstellenprogrammierung > Unix(-programmierung)
Chat coding-wiki Kontakt Alle Foren als gelesen markieren Impressum Nutzungsbedingungen
Registrieren Hilfe Benutzerliste Kalender Suchen Heutige Beiträge Alle Foren als gelesen markieren


Antwort
 
Themen-Optionen Thema bewerten Ansicht
Alt 23.11.2009, 19:32   #1
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

Problem mit .htaccess

Hallo,
ich habe ein (großes) Problem mit meinem .htaccess...
Ich habe einen Ubuntu Server aufgesetzt in Version 9.04.
Es läuft auch alles soweit, bei der 8er Distribution hatte ich auch soweit keine Probleme mit dem htaccess. Jetzt ist es jedoch so:
Ich habe eine htpasswd file erstellt mit mehreren Benutzern. Jedem Benutzer ist auch ein Passwort zugeordnet.
Wenn ich mich jetzt im Browser Authentifizieren soll gelingt der Login bereits wenn ich nur den Benutzernamen eingebe und die ersten paar Buchstaben des Passworts. Ich kann mir leider nicht erklären was da falsch läuft...
Ich hoffe hier kann mir jemand helfen
Danke...

MfG
AtHack
AtHack ist offline   Mit Zitat antworten
Sponsored Links
Alt 24.11.2009, 22:41   #2
Jan Krüger
cb-team
 
Benutzerbild von Jan Krüger
 
Registriert seit: 11.05.2002
Ort: Aachen, Germany
Beiträge: 3.828

Jan Krüger eine Nachricht über ICQ schicken Jan Krüger eine Nachricht über AIM schicken Jan Krüger eine Nachricht über MSN schicken Jan Krüger eine Nachricht über Yahoo! schicken
Ich kann mir leider auch nicht erklären, was da falsch läuft, zumal ich deine Konfiguration nicht kenne und meine Kristallkugel gerade in Reparatur ist.
__________________
MfG, Jan Krüger <jk@jk.gs>
97.000 + 2.753*cos(0.331*t) + 2.858*sin(0.331*t) + 1.574*cos(0.661*t) + 0.462*sin(0.661*t) + 20.054*cos(0.992*t) + 7.475*sin(0.992*t) + 4.596*cos(1.323*t) - 1.922*sin(1.323*t) + 1.477*cos(1.653*t) + 6.882*sin(1.653*t) - 16.919*cos(1.984*t) - 5.816*sin(1.984*t) - 5.583*cos(2.315*t) + 5.435*sin(2.315*t) + 4.291*cos(2.646*t) - 5.706*sin(2.646*t) + 9.757*cos(2.976*t) + 3.512*sin(2.976*t)
Ich mach übrigens auch Musik.
Jan Krüger ist offline   Mit Zitat antworten
Alt 25.11.2009, 18:42   #3
DJFelipe
Profi Coder
 
Registriert seit: 30.06.2006
Ort: Bayern
Beiträge: 255

DJFelipe eine Nachricht über ICQ schicken DJFelipe eine Nachricht über MSN schicken
Zumal die .htaccess ein Teil des HTTP Protokolls ist und eigendlich bei Unix(-programmierung) nichts zu suchen hat
(oder irre ich mich hierbei?)
Es gibt eine sogenannte access.php die dir das erstellen erleichtert.. Such mal nach der
DJFelipe ist offline   Mit Zitat antworten
Alt 26.11.2009, 10:20   #4
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

Alles klar Danke euch.
Hatte bisher noch keine Zeit meine Konfiguration hier rein zu schreiben...
Werde ich aber noch nachholen !

MfG
AtHack
AtHack ist offline   Mit Zitat antworten
Alt 26.11.2009, 17:30   #5
Jan Krüger
cb-team
 
Benutzerbild von Jan Krüger
 
Registriert seit: 11.05.2002
Ort: Aachen, Germany
Beiträge: 3.828

Jan Krüger eine Nachricht über ICQ schicken Jan Krüger eine Nachricht über AIM schicken Jan Krüger eine Nachricht über MSN schicken Jan Krüger eine Nachricht über Yahoo! schicken
Zitat:
Zitat von DJFelipe Beitrag anzeigen
Zumal die .htaccess ein Teil des HTTP Protokolls ist
Nein, absolut nicht.
Man könnte .htaccess im weiteren Sinne als Apache-"Programmierung" ansehen. Eigentlich finde ich den Thread hier auch nicht optimal platziert, aber ich war zu faul, ihn zu verschieben.
__________________
MfG, Jan Krüger <jk@jk.gs>
97.000 + 2.753*cos(0.331*t) + 2.858*sin(0.331*t) + 1.574*cos(0.661*t) + 0.462*sin(0.661*t) + 20.054*cos(0.992*t) + 7.475*sin(0.992*t) + 4.596*cos(1.323*t) - 1.922*sin(1.323*t) + 1.477*cos(1.653*t) + 6.882*sin(1.653*t) - 16.919*cos(1.984*t) - 5.816*sin(1.984*t) - 5.583*cos(2.315*t) + 5.435*sin(2.315*t) + 4.291*cos(2.646*t) - 5.706*sin(2.646*t) + 9.757*cos(2.976*t) + 3.512*sin(2.976*t)
Ich mach übrigens auch Musik.
Jan Krüger ist offline   Mit Zitat antworten
Alt 27.11.2009, 12:44   #6
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

Hallo,
hier nun meine angekündigte Config...
Intel P4 2,6 GHz
1 GB Ram
Ubuntu-Server 9.04Linux server 2.6.31-14-generic-pae

/etc/apache2/sites-available/default.conf:
Code: (Breitenbeschränkung entfernen)
<VirtualHost *:80>
Alias /phpmyadmin /usr/share/phpmyadmin
    ServerAdmin webmaster@localhost

    DocumentRoot /srv/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /srv/www>
        Options FollowSymLinks
        AllowOverride None
        allow from all
    </Directory>

    <Directory /srv/www/secure>
        Options FollowSymLinks Indexes
        allow from all
        AllowOverride None
        AuthUserFile /etc/apache2/.htpasswd
        AuthName "Bitte loggen Sie sich ein..."
        AuthType Basic
        require valid-user
    </Directory>
            
    <Directory /usr/share/phpmyadmin>
        Options FollowSymLinks
        allow from all
        AllowOverride None
        AuthUserFile /etc/apache2/.htpasswd
        AuthName "Bitte loggen Sie sich ein..."
        AuthType Basic
        require valid-user
    </Directory>

    ErrorLog /var/log/apache2/error.log
    CustomLog /var/log/apache2/access.log combined
    ErrorDocument 404 /errorpage/404.html
    ErrorDocument 401     /errorpage/401.html
</VirtualHost>
/etc/apache2/sites-available/apache2.conf:
Code: (Breitenbeschränkung entfernen)
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
# with ServerRoot set to "" will be interpreted by the
# server as "//var/log/apache2/foo.log".
#
#Include /etc/phpmyadmin/apache.conf
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#<IfModule !mpm_winnt.c>
#<IfModule !mpm_netware.c>
LockFile /var/lock/apache2/accept.lock
#</IfModule>
#</IfModule>

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
## 

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog /var/log/apache2/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:
Include /etc/apache2/httpd.conf

# Include ports listing
Include /etc/apache2/ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined


# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
MfG
AtHack
AtHack ist offline   Mit Zitat antworten
Alt 08.02.2010, 13:04   #7
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

*push*
Hat jemand eine Idee???
AtHack ist offline   Mit Zitat antworten
Alt 08.02.2010, 15:06   #8
kill4h`
Freak
 
Registriert seit: 24.12.2006
Beiträge: 963

Hast du dir schonmal die Logs angeschaut? Sollte immer das erste sein, das du tust, wenn Fehler auftreten.
kill4h` ist offline   Mit Zitat antworten
Alt 08.02.2010, 22:39   #9
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

Ich bekomme folgende Meldung wenn die authentifizierung trotz "nicht korrektem", da nicht kompletten Passwort erfolgreich ist:

Auszug aus /var/log/apache2/error.log:
Code: (Breitenbeschränkung entfernen)
[Mon Feb 08 15:06:22 2010] [error] [client 192.168.133.8] access to /phpmyadmin/ failed, reason: user 'user_a' does not meet 'require'ments for user/valid-user to be allowed access
Wenn ich jedoch nur 2 oder 3 buchstaben des Passwortes eingebe erhalte ich folgende Meldung:
Code: (Breitenbeschränkung entfernen)
[Mon Feb 08 15:16:09 2010] [error] [client 192.168.133.8] user user_a: authentication failure for "/phpmyadmin/": Password Mismatch
Ich habe 2 benutzer in der .htaccess File: user_a und user_b

MfG
AtHack
AtHack ist offline   Mit Zitat antworten
Alt 08.02.2010, 23:01   #10
mnemonic
cb-team
 
Benutzerbild von mnemonic
 
Registriert seit: 22.08.2005
Ort: Saarbrücken
Beiträge: 1.557

mnemonic eine Nachricht über ICQ schicken mnemonic eine Nachricht über AIM schicken mnemonic eine Nachricht über MSN schicken mnemonic eine Nachricht über Yahoo! schicken mnemonic eine Nachricht über Skype™ schicken
Ist nicht unbedingt mein Fachgebiet, aber versuch mal Folgendes...

Ersetze
Code: (Breitenbeschränkung entfernen)
allow from all
mit
Code: (Breitenbeschränkung entfernen)
Order deny,allow
deny from all
Hab das gerade mal aus einer funktionierenden Config von meiner Kiste und IMHO macht das auch mehr Sinn.

Ist für ein Upload-Verzeichnis und hier für den Kontext der komplette Abschnitt:
Code: (Breitenbeschränkung entfernen)
        <Directory "/foo/">
                Options Indexes +MultiViews
                AllowOverride AuthConfig
                Order deny,allow
                deny from all
                AuthType Basic
                AuthUserFile /bar/.htpasswd
                AuthName Dojo
                require valid-user
                satisfy any

                php_admin_flag engine off
        </Directory>
__________________
Be kind. Everyone you meet is fighting a hard battle.
--Plato
~~~~~~~~~
Coding-Wiki
~~~~~~~~~
Das Wort "nen" ist die Kurzform des Wortes "einen", nicht jedoch des Wortes "ein". "Nen" beschreibt somit den Akkusativ, niemals aber den Nominativ!
mnemonic ist offline   Mit Zitat antworten
Alt 09.02.2010, 15:40   #11
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

Danke für die Hlfe, es hat aber leider nichts gebracht.
Sobald ich die zeile "deny from all" mit reinschreibe habe ich garkeinen zugriff mehr auf den Ordner, soll heißen der Dialog zum authentifizieren erscheint garnicht mehr.
Sonst noch irgendwelche Ideen? Bin mit meinem Latein langsam am Ende.
Könnte man evtl. die htaccess dateien einzeln in jeden Ordner legen anstatt eine Zentrale datei zu haben?


MfG
AtHack

Geändert von AtHack (10.02.2010 um 02:57 Uhr).
AtHack ist offline   Mit Zitat antworten
Alt 10.02.2010, 02:57   #12
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

Ich habe jetzt nocheinmal alles komplett frisch aufgesetzt und habe immer noch dasselbe problem... Die logs spucken diesleben Meldungen aus.
Es kann doch nicht sein , dass das System das Passwort nicht komplett überprüft sondern nur die ersten x buchstaben. Wer macht denn sowas O.o
Wenn sonst noch jemand einen Rat weis... nur zu
Danke

MfG
AtHack
AtHack ist offline   Mit Zitat antworten
Alt 10.02.2010, 03:23   #13
AtHack
Urlaubs Coder
 
Registriert seit: 07.12.2006
Beiträge: 15

Ich bins nochmal, aber ich glaube ich habe jetzt den "Fehler" gefunden und ich bin erschüttert wenns wirklich so ist...
Ich habe als Passwort eine 13 stellige Kombination aus zahlen, sonderzeichen und buchstaben als Passwort gewählt. Ich habe dann einfach mal ausprobiert ab welchem Zeichen er das "zu kurze" passwort denn akzeptiert und musste feststellen das die ersten 8 Zeichen reichen. Nach einigen kleinen Tests bin ich zu folgenden Ergebnis gekommen: (Testpasswort: 1234567)
-Wenn das Passwort 7 Zeichen lang ist, funktioniert alles wie gewünscht.
-Ist das Passwort 8 Zeichen lang wird das Passwort akzeptiert, jedoch auch Passwörter, die >8 Zeichen lang sind und das richtige Passwort voranstehen haben, also z.B. 123456789
-Ist das Passwort >8 Zeichen lang, so reichen bereits die ersten 8 Zeichen des Passwort zur erfolgreichen authentifizierung.

Also ich kann mit diesen "Einschränkungen" leben, jedoch frage ich mich nun, ob es irgendeine Konfigurationsdatei gibt, in der steht das das passwort nur 8 zeichen lang sein darf und alles dahinter ignoriert wird. Denn wenn das nicht beabsichtigt ist, wovon ich ausgehe, sieht das für mich nach einem dicken Bug aus...
Nunja, trotzdem Danke für all die konstruktiven Hinweise !

//Edit
Habs raus ^^ Ich bin ja so blöd...
Es lag an dem Linux-Tool htpasswd, mit dem ich die password-File generiert habe. Das Tool hat von meinem Passwort das ich eingegeben habe einfach nur die ersten 8 Zeichen genutzt. Habe den MD5-Hash des Passwort selbst generiert und in die .htpasswd File geschrieben und jetzt funktioniert es endlich wie es soll !

Kann also geschlossen werden

MfG
AtHack
AtHack ist offline   Mit Zitat antworten
Antwort


Themen-Optionen
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge anzufügen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

vB Code ist An.
Smileys sind An.
[IMG] Code ist Aus.
HTML-Code ist Aus.
Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 19:20 Uhr.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Design & Inhalt Copyright © 2001-2010, coding-board-Team