Apache Probleme mit der Konfiguration



  • Wer kann helfen.
    Ich hab auf mein Server Debian und Apache2.

    Homepage habe ich im Angegebenen Ordner, eingefügt.

    Ruf ich die Ip des Servers in Firefox auf, erscheint keine Homepage, sondern die Defaultpage von Apache.

    Wenn ich die Nutzung der Defaultpage, rausnehme sehe ich das Verzeichnis mit den Unterordnern.

    Wo liegt der Fehler und was mussich noch einstellen?



  • Zeig mal den htdocs abschnitt



  • Dieser Thread wurde von Moderator/in rüdiger aus dem Forum Rund um die Programmierung in das Forum Themen rund um den PC verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.



  • 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

    -------------------apache2.conf----------------------------

    ServerRoot "/etc/apache2"

    LockFile /var/lock/apache2/accept.lock

    PidFile /var/run/apache2.pid

    # Timeout: The number of seconds before receives and sends time out.

    Timeout 300

    KeepAlive On

    MaxKeepAliveRequests 100

    KeepAliveTimeout 15

    <IfModule prefork.c>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 20
    MaxRequestsPerChild 0
    </IfModule>

    process
    # MaxRequestsPerChild .. maximum number of requests a server process serves
    <IfModule worker.c>
    StartServers 2
    MaxClients 150
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25
    MaxRequestsPerChild 0
    </IfModule>

    # perchild MPM
    # NumServers ........... constant number of server processes
    # StartThreads ......... initial number of worker threads in each server process
    # MinSpareThreads ...... minimum number of worker threads which are kept spare
    # MaxSpareThreads ...... maximum number of worker threads which are kept spare
    # MaxThreadsPerChild ... maximum number of worker threads in each server process
    # MaxRequestsPerChild .. maximum number of connections per server process (then it dies)
    <IfModule perchild.c>
    NumServers 5
    StartThreads 5
    MinSpareThreads 5
    MaxSpareThreads 10
    MaxThreadsPerChild 20
    MaxRequestsPerChild 0
    AcceptMutex fcntl
    </IfModule>

    User www-data
    Group www-data

    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    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

    # Global error log.
    ErrorLog /var/log/apache2/error.log

    # Include module configuration:
    Include /etc/apache2/mods-enabled/.load
    Include /etc/apache2/mods-enabled/
    .conf

    # Include all the user configurations:
    Include /etc/apache2/httpd.conf

    # Include ports listing
    Include /etc/apache2/ports.conf

    # Include generic snippets of statements
    Include /etc/apache2/conf.d/[^.#]*

    #Let's have some Icons, shall we?
    Alias /icons/ "/usr/share/apache2/icons/"
    <Directory "/usr/share/apache2/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

    <IfModule mod_negotiation.c>
    <IfModule mod_include.c>
    Alias /error/ "/usr/share/apache2/error/"

    <Directory "/usr/share/apache2/error">
    AllowOverride None
    Options IncludesNoExec
    AddOutputFilter Includes html
    AddHandler type-map var
    Order allow,deny
    Allow from all
    LanguagePriority en es de fr
    ForceLanguagePriority Prefer Fallback
    </Directory>

    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
    ErrorDocument 410 /error/HTTP_GONE.html.var
    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
    ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var
    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

    </IfModule>
    </IfModule>

    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

    #<Directory /home/*/public_html>
    # AllowOverride FileInfo AuthConfig Limit
    # Options Indexes SymLinksIfOwnerMatch IncludesNoExec
    #</Directory>

    AccessFileName .htaccess

    <Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    </Files>

    UseCanonicalName Off

    TypesConfig /etc/mime.types
    DefaultType text/plain

    HostnameLookups Off

    IndexOptions FancyIndexing VersionSort

    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*

    # This really should be .jpg.

    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core

    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^DIRECTORY^
    AddIcon /icons/blank.gif ^BLANKICON^

    # This is from Matty J's patch. Anyone want to make the icons?
    #AddIcon /icons/dirsymlink.jpg ^SYMDIR^
    #AddIcon /icons/symlink.jpg ^SYMLINK^

    DefaultIcon /icons/unknown.gif

    ReadmeName README.html
    HeaderName HEADER.html

    IndexIgnore .??* *~ # HEADER RCS CVS *,t

    AddEncoding x-compress Z
    AddEncoding x-gzip gz tgz

    AddLanguage da .dk
    AddLanguage zh-tw .tw

    LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw

    #AddDefaultCharset ISO-8859-1

    AddCharset ISO-8859-1 .iso8859-1 .latin1

    AddCharset shift_jis .sjis

    #AddType application/x-httpd-php .php
    #AddType application/x-httpd-php-source .phps

    AddType application/x-tar .tgz

    # To use CGI scripts outside /cgi-bin/:

    #AddHandler cgi-script .cgi

    # To use server-parsed HTML files

    <FilesMatch "\.shtml(\..+)?$">
    SetOutputFilter INCLUDES
    </FilesMatch>

    # If you wish to use server-parsed imagemap files, use

    #AddHandler imap-file map

    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

    BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
    BrowserMatch "^WebDrive" redirect-carefully
    BrowserMatch "^gnome-vfs" redirect-carefully
    BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully

    # Allow server status reports, with the URL of http://servername/server-status
    # Change the ".your_domain.com" to match your domain to enable.

    #<Location /server-status>
    # SetHandler server-status
    # Order deny,allow
    # Deny from all
    # Allow from .your_domain.com
    #</Location>

    #<Location /server-info>
    # SetHandler server-info
    # Order deny,allow
    # Deny from all
    # Allow from .your_domain.com
    #</Location>

    # Include the virtual host configurations:
    Include /etc/apache2/sites-enabled/[^.#]*

    ------------------------Und nun die default aus sites-enabled-------------------
    NameVirtualHost *
    <VirtualHost *>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    </Directory>
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    # This directive allows us to have apache2's default start page
    # in /apache2-default/, but still have / go to the right place
    # RedirectMatch ^/$ /apache2-default/
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
    ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

    </VirtualHost>

    So die index.html liegt in usr/www
    gebe ich ip/index.html ruft er die auf
    gebe ich nur ip ein(soll denn ja auch index.html,index.php aufrufen), ruft er das Verzeichnis auf, und ich kann in die Ordner gehen etc.

    Wo ist der Fehler?



  • Kann echt keiner helfen? Wer sich gut auskennt kann sich hier melden, gebe denn auch Server ip und pw raus.



  • Heisst deine "Startseite" eventuell index.htm? Dann solltest du das auch in die DirectoryIndex-Zeile mit aufnehmen.



  • Die heisst genauso.
    Laut DirectoryIndex dürfte sie auch index.php heissen.

    Hatt denn vielleicht einer ein Link zu Apache Konfiguration?
    Es liegt nämlich auch noch das Problem an mehrere Homepages auf den Server zu betreiben.



  • Apache konfiguration ist schon ein Kapitel für sich.
    Das ist der Abschnitt für einen virtuellen Host der über Confixx angelegt wird.
    Ich vermute das Dein Problem mit dem DocumentRoot zusammen hängt, da sonst alle Anfragen an der Server in das Huptverzeichnis www/htdocs/ führt.

    <VirtualHost 123.456.789.010:80>
    ServerName domain.de
    ServerAlias  www.domain.de web4.hauptdomain.de
    DocumentRoot /srv/www/htdocs/web4/html
    SuexecUserGroup web4 ftponly
    ScriptAlias /cgi-bin/ /srv/www/htdocs/web4/html/cgi-bin/
    php_admin_value open_basedir /srv/www/htdocs/web4/:/srv/www/htdocs/phpMyAdmin/:/srv/www/htdocs/confixx/html/gesperrt/
    php_admin_value upload_tmp_dir /srv/www/htdocs/web4/phptmp/
    php_admin_value safe_mode on
    
    </VirtualHost>
    


  • Erstell mal einen neuen VirtualHost eintrag bei deinen Konfigurationsdateien.
    Hierüber ist es später auch möglich mehrere Domains einzurichten. Für jede Domain muss ein eigener VirtualHost angelegt werden.
    Kleine Beispielkonfiguration:

    <VirtualHost *>
    ServerName domain.tld
    ServerAlias www.domain.tld

    DocumentRoot /home/domain/public_html/
    <Directory />
    AllowOverride All
    </Directory>

    # AWSTATS
    Alias /awstats-icon/ /usr/share/awstats/icon/
    ScriptAlias /cgi-bin/awstats/ /usr/lib/cgi-bin/awstats/
    <Directory "/usr/lib/cgi-bin">
    AllowOverride All
    Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    </Directory>

    ErrorLog /home/domain/log/error.log

    # Possible values include: debug, info, notice, warn, error,
    # crit, alert, emerg.
    LogLevel warn
    CustomLog /home/domain/log/access.log combined
    ServerSignature On

    </VirtualHost>



  • Leider nach wie vor das gleiche Problem.
    Ich finde nicht meine Homepage mit den Standardwerten.

    Hier wurd ja vermutet das Confix da was einstellt, leider ist den nicht so.



  • Zeig mal bitte deine Konfigurationsdatei.
    Hast du die Default verwendet oder eine neue angelegt?
    ApacheServer neu gestartet?



  • Hmm

    also dein DirectoryIndex
    beinhaltet aber keine index.htm.

    Nur falsch ich das jetzt nicht falsch verstanden habe.
    Ist deine index Seite jetzt mit "l" oder ohne?



  • the_hero99 schrieb:

    Leider nach wie vor das gleiche Problem.
    Ich finde nicht meine Homepage mit den Standardwerten.

    Hier wurd ja vermutet das Confix da was einstellt, leider ist den nicht so.

    Es geht ja nicht ums Confixx, sondern um den Code in der httpd.conf
    Wo Du dann die Einstellungen machen musst hängt ja von Deinem ganzen System ab.
    Ein Default Server wird z.B. so angelegt.
    Damit Zeigt Deine IP vom Server auf das Verzeichnis /srv/wwww

    DocumentRoot "/srv/www"
    
    <Directory "/srv/www">
    	Options None
    	AllowOverride None
    	Order allow,deny
    	Allow from all
    </Directory>
    

    Wenn Du eine Domain oder Webseite da drauf packen willst, musst Du einen virtuellen Server anlegen, das geht z.B. so.

    NameVirtualHost 123.456.789.10:80
    
    <VirtualHost 123.456.789.10:80>
    ServerName deinedomain.de
    ServerAlias  www.deinedomain.de
    DocumentRoot /srv/www/web1/html
    </VirtualHost>
    

    Und genau da liegt der Knackpunkt, die Variable DocumentRoot zeigt jetzt auf das Verzeichnis /srv/www/web1/html



  • Bei einem Debiansystem steht die Standardkonfiguration unter /etc/apache2/sites-available/default



  • Du kannst es auch mal so probieren.
    In das Verzeichnis var/www/html packst Du dann deine index.html

    <VirtualHost 123.456.789.10:80>
    ServerName 123.456.789.10
    DocumentRoot /var/www/html
    </VirtualHost>
    


  • Nachdem die Domain endgültigt eingerichtet ist und mein Hoster die Restkonfiguration durchgeführt hatt wird alles Ordnungsgemäss erkannt.



  • in welchem verzeichnis liegt denn deine homepage
    die muss natürlich schon im DocumentRoot liegen



  • the_hero99 schrieb:

    Nachdem die Domain endgültigt eingerichtet ist und mein Hoster die Restkonfiguration durchgeführt hatt wird alles Ordnungsgemäss erkannt.

    Bedeutet dies nun das alles so funktioniert wie es soll?



  • nur so nebenbei:
    wenn ich nicht mehrere domains brauch dann würd ich alles ohne virtual hosts machen weils einfach einfacher is



  • guenni81 schrieb:

    the_hero99 schrieb:

    Nachdem die Domain endgültigt eingerichtet ist und mein Hoster die Restkonfiguration durchgeführt hatt wird alles Ordnungsgemäss erkannt.

    Bedeutet dies nun das alles so funktioniert wie es soll?

    Das würde mich auch interessieren, und wie seine Confi denn jetzt aussieht. 😉


Anmelden zum Antworten