Apache

From My Mnemonic Rhyme
Jump to navigation Jump to search

.htaccess

Ganze Domain umleiten

RewriteEngine On
Redirect / http://www.destination.de

Auf SSL umleiten

RewriteCond %{SERVER_PORT}     !^443$
RewriteRule (.*)  https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

http://sw-guide.de/webdesign-und-entwicklung/htaccess-mod_rewrite-fuer-cms-und-blog/

.htpasswd

file

htpasswd -c .htpasswd  testuser 

#delete
htpasswd -D .htpasswd newuser

Apache Manual

apache vHost

<Directory "/var/www/private/">
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AuthType Basic
    AuthName "Private Repository"
    AuthUserFile /var/safe/.htpasswd-private
    Require valid-user
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

für einzelne files

AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName "My Secret Page"

<Files "mypage.html">
  Require valid-user
</Files>

apachebench

 ab -n 100 -c 10 http://www.tobias-weiss.org/