Hallo,
Ich habe ein Problem bei der Umstellung auf apache2.
Folgende Dokumentation wird verwendet:
apache
http://forum.ubuntuusers.de/topic/92688/next/
http://httpd.apache.org/docs/2.2/de/vhosts/name-based.html
Ich habe bereits ServerName localhost in /etc/apache2/apache2.conf eingetragen.
So bekomme ich nicht mehr folgende Meldung beim restart:
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Trotzdem besteht weiterhin das Problem, dass der Hauptserver nicht funktioniert:
http://localhost im Adressfeld des Browsers wird zu http://localhost/ und gibt diese Fehlerseite (404) aus:
Not Found The requested URL / was not found on this server.
Im error.log steht dann:
[error] [client 127.0.0.1] File does not exist: /htdocs
Das scheint hardgecodetes fallback zu sein, da es sich in der Konfiguration nicht findet:
$ rgrep -C3 htdocs /etc/apache2 /etc/apache2/magic-# Magic data for mod_mime_magic Apache module (originally for file(1) command) /etc/apache2/magic:# The module is described in htdocs/manual/mod/mod_mime_magic.html /etc/apache2/magic-# /etc/apache2/magic-# The format is 4-5 columns: /etc/apache2/magic-# Column #1: byte number to begin checking from, ">" indicates continuation -- /etc/apache2/README-magic /etc/apache2/README- /etc/apache2/README- Magic data for mod_mime_magic Apache module, documented in /etc/apache2/README: htdocs/manual/mod/mod_mime_magic.html. You probably don't /etc/apache2/README- need to touch this. /etc/apache2/README- /etc/apache2/README-mods-available/
Das selbe Bild ergibt sich bei a2ensite default sowie bei a2dissite default.
$ sudo egrep -v '#|^ *$' /etc/apache2/sites-available/default NameVirtualHost 172.16.240.1:80 <VirtualHost 172.16.240.1:80> ServerAdmin webmaster@localhost ServerName localhost DocumentRoot /var/www/ ServerAlias localhost DirectoryIndex index.php index.html index.htm <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews -Indexes +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log 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>
Weshalb sucht er also in /htdocs ? Oder sucht er /var/www/htdocs ?
Er soll aber /var/www anzeigen, und damit das dort vorhandene /var/www/index.html.
Die anderen vhosts funktionieren.
Was ist hier falsch?
Vielen Dank im Voraus.
Weitere Konfigurationsdateien:
$ sudo egrep -v '#|^ *$' /etc/apache2/apache2.conf ServerRoot "/etc/apache2" ServerName localhost LockFile /var/lock/apache2/accept.lock PidFile /var/run/apache2.pid Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_worker_module> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule> User www-data Group www-data AccessFileName .htaccess <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> DefaultType text/plain HostnameLookups Off ErrorLog /var/log/apache2/error.log LogLevel warn Include /etc/apache2/mods-enabled/*.load Include /etc/apache2/mods-enabled/*.conf Include /etc/apache2/httpd.conf Include /etc/apache2/ports.conf 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 ServerTokens Full ServerSignature On Include /etc/apache2/conf.d/ Include /etc/apache2/sites-enabled/
$ ls /etc/apache2/conf.d/ apache2-doc charset php4.conf phpmyadmin.conf.dpkg-tmp tetex-doc backuppc modxslt phpmyadmin.conf scoreboard
$ sudo egrep -v '#|^ *$' /etc/apache2/httpd.conf $
/etc/apache2/httpd.conf ist also leer, envvars ebenfalls. ports.conf entspricht dem ubuntu-paket (LISTEN 80 und 443).