Forum EUserv

VPS/vServer - virtual private server => vServer - HowTo's => Thema gestartet von: TuSFloo am 16.April 2009, 21:42:00

Titel: (Apache2) htacces und httpd.conf
Beitrag von: TuSFloo am 16.April 2009, 21:42:00
Hi,
habe auf meinem Server jetzt einen Webserver installiert.
Nun möchte ich ein Verzeichnis mit einem Passwort schützen, indem ich in den entsprechenden Ordner eine .htacces Datei ablege.
Leider weiß ich nicht was ich nun in meine httpd.conf eintragen muss damit er die Passwortabfrage aufruft.
Ihr würdet mir sehr helfen wenn ihr mir ein Muster für meine httpd.conf geben könntet.

Gruß Flo
Titel: Re: (Apache2) htacces und httpd.conf
Beitrag von: uname am 17.April 2009, 08:41:42
Gibt es die httpd.conf noch ?

Also ich habe unter

/etc/apache2/sites-available/domain
 <Directory /users/bla/www>                                                             
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all   
</Directory>   
das AllowOveride auf "All" gesetzt.

Der Rest ist Standard:

- .htpasswd generieren mit htpasswd

.htaccess:
AuthUserFile /users/bla/www/blubb/.htpasswd
AuthName "Geschuetzter Bereich!"
AuthType Basic
Require valid-user
Titel: Re: (Apache2) htacces und httpd.conf
Beitrag von: TuSFloo am 17.April 2009, 10:37:47
Vielen Dank, es hat funktioniert.
Ich habe den code einfach in meine httpd.conf kopiert.
<Directory /users/bla/www>                                                             
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all   
</Directory>
Bei mir gibts diese Datei noch, habe Debian 4 32bit drauf.

Gruß Flo
Titel: Re: (Apache2) htacces und httpd.conf
Beitrag von: uname am 17.April 2009, 13:52:54
Die Datei ist nichts für mich. Habe natürlich Debian 5.0 Lenny

httpd.conf
# This is here for backwards compatability reasons and to support
#  installing 3rd party modules directly via apxs2, rather than
#  through the /etc/apache2/mods-{available,enabled} mechanism.
#
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so