Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
becki:linux:apache_httpd [2010-05-18 08:24] becki |
becki:linux:apache_httpd [2018-05-16 14:20] (aktuell) becki [Protect a Directory with Digest Authentication] |
||
---|---|---|---|
Zeile 26: | Zeile 26: | ||
</code> | </code> | ||
- | Make sure that ''/etc/httpd/php.ini'' is identical with ''/etc/httpd/php.ini-recommended''. | + | Make sure that ''/etc/httpd/php.ini'' is based on ''/etc/httpd/php.ini-production''. See [[slack_upgrade#notes]] |
+ | |||
+ | As of Slack 13.37 you have to set your timezone in php.ini, eg ''date.timezone = "Europe/Berlin"'' in order to avoid warnings in error log. | ||
(Re)start apache with ''/etc/rc.d/rc.httpd restart'' | (Re)start apache with ''/etc/rc.d/rc.httpd restart'' | ||
Zeile 46: | Zeile 48: | ||
* Realm: 'Digest Authentication Test' (arbitrary selectable) | * Realm: 'Digest Authentication Test' (arbitrary selectable) | ||
* Username: testuser | * Username: testuser | ||
+ | * Module auth_digest_module is loaded in httpd.conf | ||
+ | * AllowOverride directive is set to All for that direcory for for the document root in general | ||
Create password file ''.htpasswd'' with: | Create password file ''.htpasswd'' with: | ||
Zeile 71: | Zeile 75: | ||
Note that the manual discourages to put ''.htpasswd'' into the same directory which is to be protected, however it seems common usage. Check at least ''.htpasswd'' and ''.htaccess'' will not be displayed in your webbrowser! | Note that the manual discourages to put ''.htpasswd'' into the same directory which is to be protected, however it seems common usage. Check at least ''.htpasswd'' and ''.htaccess'' will not be displayed in your webbrowser! | ||
- | More useres can be added to ''.htpasswd'' with: | + | More useres can be added to ''.htpasswd'' (or existing users modified) with: |
htdigest .htpasswd 'Digest Authentication Test' newusername | htdigest .htpasswd 'Digest Authentication Test' newusername | ||
More details at [[http://httpd.apache.org/docs/1.3/howto/auth.html#digest|Apache manual]] | More details at [[http://httpd.apache.org/docs/1.3/howto/auth.html#digest|Apache manual]] | ||
- | ===== Enable Directory Listing == | + | ===== Disable Directory Listing generally == |
+ | |||
+ | In DocumentRoot section do | ||
+ | <code diff> | ||
+ | - Options Indexes FollowSymLinks | ||
+ | + Options FollowSymLinks | ||
+ | </code> | ||
+ | |||
+ | ===== Enable Directory Listing for a particular Directory == | ||
Create an ''.htaccess'' file in the regarding directory and add this line: | Create an ''.htaccess'' file in the regarding directory and add this line: | ||
Zeile 82: | Zeile 94: | ||
Note that the [[http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride|AllowOverride Directive]] must allow this. More: [[http://httpd.apache.org/docs/2.2/howto/htaccess.html|htaccess]], [[http://httpd.apache.org/docs/2.2/mod/core.html#options|Options]] | Note that the [[http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride|AllowOverride Directive]] must allow this. More: [[http://httpd.apache.org/docs/2.2/howto/htaccess.html|htaccess]], [[http://httpd.apache.org/docs/2.2/mod/core.html#options|Options]] | ||
+ | |||
+ | Fancy directory listings: | ||
+ | |||
+ | Include /etc/httpd/extra/httpd-autoindex.conf | ||
===== Security Settings == | ===== Security Settings == | ||
Zeile 95: | Zeile 111: | ||
Further measures: | Further measures: | ||
- | ServerTokens Minimal | + | <code apache> |
- | ServerSignature Off | + | ServerTokens Minimal |
- | TraceEnable On | + | ServerSignature Off |
+ | TraceEnable On | ||
+ | </code> | ||
(Proposals taken from Debian Lenny ''/etc/apache2/conf.d/security'') | (Proposals taken from Debian Lenny ''/etc/apache2/conf.d/security'') | ||
Zeile 104: | Zeile 122: | ||
[[http://httpd.apache.org/docs/2.2/vhosts/|Vhost documentation start]] | [[http://httpd.apache.org/docs/2.2/vhosts/|Vhost documentation start]] | ||
+ | |||
+ | See also [[becki/my/linux/caldav]] | ||
FIXME Name-based virtual hosting cannot be used with SSL secure servers. More: http://httpd.apache.org/docs/2.2/vhosts/name-based.html | FIXME Name-based virtual hosting cannot be used with SSL secure servers. More: http://httpd.apache.org/docs/2.2/vhosts/name-based.html |