Bianca: Apache httpd.conf htaccess und htpasswd

Hi Leute,

hab ein Problem mit der Konfiguration. Ich möchte meine Verzeichnisse schützen un bekomm immer wieder Internal Server Error
oder ich kann ohne Passwortabfrage direkt auf meine Verzeichnisse
zugreifen.
Bitte helft mir, und Sorry wegen dem vielen Code

Meine htaccess im Verzeichniss ddownload:
<Directory "/srv/www/htdocs/*/ddownload/index.htm">
 AuthType Basic
 AuthName "x-source.hopto.org_Download"
 AuthUserFile "/etc/httpd/.htpasswd"
 require valid-user
</Directory>

Meine htpasswd sieht folgender maßen aus (in httpd):
dieter:dieter
bianca:bianca

und meine httpd.conf (hier ohne geladene Module):
ServerType standalone
ServerRoot "/srv/www"
LockFile /var/lock/subsys/httpd/httpd.accept.lock
PidFile /var/run/httpd.pid
ScoreBoardFile /var/run/httpd.scoreboard
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 0
Include /etc/httpd/suse_addmodule.conf
ExtendedStatus On
<IfModule mod_dav.c>
DavLockDB /var/lock/DAVLock
</IfModule>
<IfModule mod_include.c>
XBitHack on
</IfModule>

Section 2: 'Main' server configuration

Port 80
<IfDefine SSL>
Listen 80
Listen 443
</IfDefine>
User wwwrun
Group nogroup
ServerAdmin webmaster@x-source.hopto.org
ServerName x-source.hopto.org
DocumentRoot "/srv/www/htdocs"

<Directory />
    AuthUserFile  /etc/httpd/passwd
    AuthGroupFile /etc/httpd/group
    Options -FollowSymLinks +Multiviews
    AllowOverride None
</Directory>

<Directory "/srv/www/htdocs">
    Options Indexes -FollowSymLinks +Includes MultiViews
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
 <IfModule mod_dav.c>
  DAV Off
 </IfModule>

<Files /srv/www/htdocs/index.htm*>
  Options -FollowSymLinks +Includes +MultiViews
 </Files>

<Files /src/www/htdocs/ddownload/index.htm*>
  Options -FollowSymLinks +Multiviews
  AllowOverride AuthConfig
  AuthAuthoritative on
  order deny,allow
  deny from all
  allow from localhost
 </Files>

<Files test.php3>
  Order deny,allow
  deny from all
  allow from localhost
 </Files>
</Directory>
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm
</IfModule>
AccessFileName .htaccess
<Files ~ "^.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>
#CacheNegotiatedDocs
UseCanonicalName On
<IfModule mod_mime.c>
    TypesConfig /etc/httpd/mime.types
</IfModule>
DefaultType text/plain
<IfModule mod_mime_magic.c>
    MIMEMagicFile /etc/httpd/magic
</IfModule>
HostnameLookups Off
ErrorLog /var/log/httpd/error_log
LogLevel warn
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/httpd/access_log common
ServerSignature On
<IfModule mod_alias.c>
    Alias /icons/ "/srv/www/icons/"
    <Directory "/srv/www/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

Alias /ddownload/ "/srv/www/htdocs/ddownload/"
    <Directory "/srv/www/htdocs/ddownload">
        Options -FollowSymLinks +Multiviews
        AllowOverride AuthConfig
        Order allow,deny
        Allow from all
    </Directory>

Alias /manual/ "/srv/www/htdocs/manual/"
    <Directory "/srv/www/htdocs/manual">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
    <IfModule mod_perl.c>
        # Provide two aliases to the same cgi-bin directory,
        # to see the effects of the 2 different mod_perl modes.
        # for Apache::Registry Mode
        ScriptAlias /perl/          "/srv/www/cgi-bin/"
        # for Apache::Perlrun Mode
        ScriptAlias /cgi-perl/      "/srv/www/cgi-bin/"
    </IfModule>
    <Directory "/srv/www/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
</IfModule>

set /cgi-bin for CGI execution

<Location /cgi-bin>
 AllowOverride None
 Options +ExecCGI -Includes
 SetHandler cgi-script
</Location>
<IfModule mod_perl.c>
 Perlrequire /usr/include/apache/modules/perl/startup.perl
 PerlModule Apache::Registry
 <Location /perl>
  SetHandler  perl-script
  PerlHandler Apache::Registry
  Options ExecCGI
  PerlSendHeader On
 </Location>
 <Location /cgi-perl>
  SetHandler  perl-script
  PerlHandler Apache::PerlRun
  Options ExecCGI
  PerlSendHeader On
 </Location>
</IfModule>
<IfModule mod_setenvif.c>
    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4.0b2;" nokeepalive downgrade-1.0 force-response-1.0
    BrowserMatch "RealPlayer 4.0" force-response-1.0
    BrowserMatch "Java/1.0" force-response-1.0
    BrowserMatch "JDK/1.0" force-response-1.0
</IfModule>

/etc/sysconfig/apache.

<IfDefine STATUS>
 <Location /server-status>
      SetHandler server-status
      Order deny,allow
      Deny from all
      Allow from localhost
 </Location>
 <Location /server-info>
      SetHandler server-info
      Order deny,allow
      Deny from all
      Allow from localhost
 </Location>
 # enable perl-status for mod_perl
 <IfModule mod_perl.c>
  <Location /perl-status>
       SetHandler perl-script
       PerlHandler Apache::Status
       order deny,allow
       deny from all
       allow from localhost
  </Location>
 </IfModule>
</IfDefine>
<IfDefine SSL>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
</IfDefine>
<IfModule mod_ssl.c>
 SSLPassPhraseDialog  builtin
 #SSLSessionCache        none
 #SSLSessionCache        shmht:/var/run/ssl_scache(512000)
 #SSLSessionCache        shmcb:/var/run/ssl_scache(512000)
 SSLSessionCache         dbm:/var/run/ssl_scache
 SSLSessionCacheTimeout  300
 SSLMutex  file:/var/run/ssl_mutex
 SSLRandomSeed startup builtin
 SSLRandomSeed connect builtin
 #SSLRandomSeed startup file:/dev/random  512
 #SSLRandomSeed startup file:/dev/urandom 512
 #SSLRandomSeed connect file:/dev/random  512
 #SSLRandomSeed connect file:/dev/urandom 512
 SSLLog      /var/log/httpd/ssl_engine_log
 SSLLogLevel info
</IfModule>
<IfDefine SSL>

SSL Virtual Host Context

<VirtualHost _default_:443>
DocumentRoot "/srv/www/htdocs"
ServerName new.host.name
ServerAdmin you@your.address
ErrorLog /var/log/httpd/error_log
TransferLog /var/log/httpd/access_log
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/httpd/ssl.crt/server.crt
....
Wenn die Module wichtig sind bitte ich um einen kurzen Hinweis.
Ist sonst noch etwas zu beachten??? Muß für die PW abfrage ein Script geschrieben werden?

MfG Bianca

  1. hab ein Problem mit der Konfiguration. Ich möchte meine Verzeichnisse schützen un bekomm immer wieder Internal Server Error
    oder ich kann ohne Passwortabfrage direkt auf meine Verzeichnisse
    zugreifen.

    Was steht dann denn in deinem error.log?

    1. Was steht dann denn in deinem error.log?

      Hi Björn,

      das steht in meiner error.log (etwas gekürzt):

      [Sun Jan 12 06:41:12 2003] [warn] child process 11676 still did not exit, sending a SIGTERM  # das gleiche mit=11677; 11678; 11679; 11680
      [Sun Jan 12 06:41:16 2003] [notice] caught SIGTERM, shutting down
      [Sun Jan 12 06:41:34 2003] [notice] Apache/1.3.26 (Linux/SuSE) mod_python/2.7.8 Python/2.2.1 PHP/4.2.2 mod_perl/1.27 configured -- resuming normal operations
      [Sun Jan 12 06:41:34 2003] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
      [Sun Jan 12 06:41:34 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)
      [Sun Jan 12 06:41:34 2003] [alert] [client 10.100.100.100] /srv/www/htdocs/ddownload/.htaccess: <Directory not allowed here

      Dank für dir Antwort am frühen Morgen.
      Bin schon die ganze Nacht damit beschäftigt

      Bianca

      1. [Sun Jan 12 06:41:34 2003] [alert] [client 10.100.100.100] /srv/www/htdocs/ddownload/.htaccess: <Directory not allowed here

        In der .htaccess musst du das <directory> weglassen, du beziehst dich ja bereits auf das aktuelle Verzeichnis.

        1. [Sun Jan 12 06:41:34 2003] [alert] [client 10.100.100.100] /srv/www/htdocs/ddownload/.htaccess: <Directory not allowed here

          In der .htaccess musst du das <directory> weglassen, du beziehst dich ja bereits auf das aktuelle Verzeichnis.

          Hi Björn,

          Dank Dir.

          Son kleiner Fehler und nix hat gefunzt. nun Super.

          Noch ne kleine Frage: wie lasse ich immer die Startseite anzeigen obwohl auf Unterverzeichnisse zugegriffen wird. Ich mein Oben und unten im Browser z.B http://meine.webadresse obwohl auf http://meine.webadresse/index.htm zugegriffen wird.
          evt. weisst Du wie ich meinen Quellcode der Seiten verbergen kann, z.B das auf Unterverzeichnissen immer der Quelltext von einer Abgespeckten Startseite oder dem Disklöamer angezeigt wird.

          OKi bis denn Bianca

          :-)

          1. Hallo, Bianca,

            Noch ne kleine Frage: wie lasse ich immer die Startseite anzeigen

            Oh, wieder jemand, der die besten Methoden kennenlernen will, wie man BesucherInnen verschrecken und bevormunden kann.

            obwohl auf Unterverzeichnisse zugegriffen wird. Ich mein Oben

            Adressleiste nennt sich das.

            und unten

            Statusleiste nennt sich das.

            im Browser z.B http://meine.webadresse obwohl auf http://meine.webadresse/index.htm zugegriffen wird.

            Missbrauche Frames: http://selfhtml.teamone.de/html/frames/

            Die Statusleiste müsstest du mit defaultStatus http://selfhtml.teamone.de/javascript/objekte/window.htm#default_status außer Betrieb setzen. Das ist mit Abstand die effizienteste Methode, die BesucherInnen zu vergrätzen, insofern viel Spaß damit.

            evt. weisst Du wie ich meinen Quellcode der Seiten verbergen kann

            Das ist nicht möglich, im Archiv http://selfsuche.teamone.de/ wirst du dazu zweitausenddreihundertfünfundfünfzig Diskussionen finden. Wenn der/die BenutzerIn den tatsächlichen Quelltext zu Gesicht bekommen möchte, kannst du das zwar erschweren und sie/ihn damit belästigen, du kannst es aber nicht verhindern.

            z.B das auf Unterverzeichnissen immer der Quelltext von einer Abgespeckten Startseite oder dem Disklöamer angezeigt wird.

            Rechtliche Hinweise können durchaus im Quelltext untergebracht werden, beispielsweise in Form von Kommentaren und <link rel="copyright" href="..." title="Rechtliche Hinweise" /> oder ähnlichem.

            Grüße,
            Mathias

            --
            Moving, watching, working, sleeping, driving, walking, talking, smiling
            Moving, watching, working, sleeping, driving, walking, talking, smiling
            Moving, watching, working, sleeping, driving, walking, talking, smiling
            Moving, watching, working, sleeping, ...     (Air - People In The City)