Htaccess

htaccess mit apache

Erstelle den zu schützenden Ordner.

$ mkdir protected-folder

$ cd protected-folder
Erstelle einen Benutzer. Ich nehme hier den Benutzer “john”.

$ /opt/httpd-2.0.59/bin/htpasswd -c /opt/httpd-2.0.59/conf/.htpasswd john

pass:johns-password

 

  • —–

Bei Solaris kann es eventuell folgenden Error geben:

ld.so.1: htpasswd: fatal: libgcc_s.so.1: open failed: No such file or directory Killed
Der “workaround” hierfür wäre:

$ LD_LIBRARY_PATH=/usr/local/lib

$ export LD_LIBRARY_PATH

  • —–

$ vi .htaccess (Im zu schützenden Verzeichnis)

1
 AuthUserFile /opt/httpd-2.0.59/conf/.htpasswd
1
AuthGroupFile /dev/null
1
AuthName Mein-geschuetztes-Verzeichnis
1
AuthType Basic require valid-user

Dann musst Du noch das httpd.conf editieren so dass das .htaccess auch ausgelesen werden darf. $ vi /opt/httpd-2.0.59/conf/httpd.conf

1
 <Directory />
   Options FollowSymLinks
  #AllowOverride None
   AllowOverride All

</Directory>

Nicht vergessen den Apache neu zu starten.

Das wärs, viel Spass!

About missing_link

Nietzsche is dead.
This entry was posted in Software. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.