• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Apache: "localhost" geht "localhost/index.php" geht nicht

Hi,

ich hab das oben beschriebene Problem und KEINEN Ansatz zur lösung, auch google ist nicht hilfreich :???:

Ich habe im Apache2 einen vhost angelegt in minimalkonfiguration nach dem Beispiel:

<VirtualHost *:80>
ServerName hab-ich;
DocumentRoot /srv/www/htdocs/meinOrdner
ServerAdmin webmaster@example.com
ErrorLog /var/log/apache2/www.example.com_log
CustomLog /var/log/apache2/www.example.com-access_log common
<Directory "/srv/www/htdocs/meinOrdner">
Order allow,deny
Allow from all
</Directory>
HostnameLookups Off
UseCanonicalName Off
ServerSignature On

</VirtualHost>

Wenn ich jetzt im FF localhost eingebe, dann funzt es bedingt (denke da muss ich ans PHPscript ran), gebe ich jedoch localhost/index.php ein-> Objekt nicht gefunden.

Wie Wo kann cih es ändern das er über index.php die datei anspricht (und entsprechend auch index.php?p=1)


danke im voraus
 
Aha. Interessant.

Beantwortet nur nicht die Frage.


Edit:Leere Logs deuten darauf hin, daß die Konfig nicht gezogen wird. Womit wir wieder bei der Frage nach der restlichen Konfig wären...
 
hab noch Nagios installiert, fasl das von belang ist

danke das du dir nen kopf machst :eek:ps:


Edit: im normalen Errorlog steht nur ein einzeiler:
(Linux/SUSE) mod_ssl/2.2.22 OpenSSL/1.0.1c PHP/5.3.16 configured -- resuming normal operations

Wenn nich geladen würde, woher weiß er denn wo die Seite liegt?

Welche *.conf Daten brauchst du denn?
 
hi,

laos hab jetzt mal ein wenig weitergeforscht.

Hab im Yast->Netzwerkdienste->HTTP-Server
unter Hosts meinen vorherigen Host gelöscht, ergibnis: die It works! seite kam wieder.

Also host wieder eingetragen allerdings mit dem unterschied das ich einen Hacken bei Public_HTML gemacht habe,
Ergebnis: der browser hat localhost automatisch zu localhost/index.php vervollständigt. allerdings mit der Ausgabe: Zugriff verweigert

nun muss ich sichlich noch irgendwas freigeben?

die virtualhost.conf sieht jetzt ähnlich aus:

<VirtualHost *:80>
ServerName hab-ich;
DocumentRoot /srv/www/htdocs/meinOrdner
ServerAdmin webmaster@example.com

<Directory /srv/www/htdocs/meinOrdner>
Order allow,deny
Allow from all
</Directory>
UserDir public_html
</VirtualHost>

Also wie weiter?
 
Entweder du postest die relevanten Konfig-Files und die Logfiles. Dann kann man Dir helfen.

Oder eben nicht.
 
die Conf's

Httpd:
Include /etc/apache2/uid.conf

Include /etc/apache2/server-tuning.conf

ErrorLog /var/log/apache2/error_log

Include /etc/apache2/sysconfig.d/loadmodule.conf

Include /etc/apache2/listen.conf

Include /etc/apache2/mod_log_config.conf

Include /etc/apache2/sysconfig.d/global.conf

Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf

Include /etc/apache2/mod_usertrack.conf

Include /etc/apache2/mod_autoindex-defaults.conf

TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf

Include /etc/apache2/errors.conf

Include /etc/apache2/ssl-global.conf

<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>

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

DirectoryIndex index.html index.html.var index.php

Include /etc/apache2/default-server.conf


Include /etc/apache2/sysconfig.d/include.conf


Include /etc/apache2/vhosts.d/*.conf




listen:

Listen 80


<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>

Listen 443

</IfModule>
</IfDefine>
</IfDefine>


und welche noch?

P.S.: da cih ein Neuling auf der Apache2(Linux) Front bin, vermute ich das nur die Conf's die ich "angefasst" habe relevant sind".

wie gesagt zur Zeit kommt die "kein Zugriff" meldung(fortschirtt?)
 
Alle.

Und verwende bitte die Code-Tags. Dann kann man das nämlich auch lesen und hat eine Chance, sie auch vernüntig analysieren zu können.
 
vhost.d:
Code:
#
<VirtualHost *:80>
    ServerName ich_hier
    ServerAdmin webmaster@ich_hier
    ServerAlias */ich_hier

      DocumentRoot "/srv/www/htdocs/meinOrdner/"

    ErrorLog /var/log/apache2/dummy-host.example.com-error_log
    CustomLog /var/log/apache2/dummy-host.example.com-access_log combined

        HostnameLookups Off

        UseCanonicalName Off

        ServerSignature On


        ScriptAlias /cgi-bin/ "/srv/www/htdocs/meinOrnder/"

    <Directory "/srv/www/htdocs/meinOrnder/">
	AllowOverride None
	Options +ExecCGI -Includes
	Order allow,deny
	Allow from all
    </Directory>


       <IfModule mod_userdir.c>
	UserDir public_html
	Include /etc/apache2/mod_userdir.conf
    </IfModule>


        <Directory "/srv/www/htdocs/meinOrnder/">
    
	Options +Indexes +MultiViews +FollowSymLinks
	IndexOptions FancyIndexing
    	AllowOverride None
    
	Order allow,deny
	Allow from all
    
    </Directory>

   
</VirtualHost>

Error

Code:
Alias /error/ "/usr/share/apache2/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/usr/share/apache2/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr
        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_UNSUPPORTED_MEDIA_TYPE.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>

default-server
Code:
Alias /error/ "/usr/share/apache2/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/usr/share/apache2/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr
        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_UNSUPPORTED_MEDIA_TYPE.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>

default-vhosts

Code:
<VirtualHost _default_:80>
    ServerName dummy-host.example.com
    ServerAdmin webmaster@dummy-host.example.com
    ServerAlias example.com www.example.com

    DocumentRoot "/srv/www/htdocs"
    ErrorLog /var/log/apache2/dummy-host.example.com-error_log
    CustomLog /var/log/apache2/dummy-host.example.com-access_log combined

    HostnameLookups Off

    UseCanonicalName Off

    ServerSignature On


    ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"

    <Directory "/srv/www/cgi-bin">
	AllowOverride None
	Options +ExecCGI -Includes
	Order allow,deny
	Allow from all
    </Directory>


APACHE_MODULES
    <IfModule mod_userdir.c>

	UserDir public_html
	Include /etc/apache2/mod_userdir.conf
	
</IfModule>

    <Directory "/srv/www/htdocs">
    
	Options +Indexes +MultiViews +FollowSymLinks
	IndexOptions FancyIndexing
    
	Order allow,deny
	Allow from all
    
    </Directory>

</VirtualHost>

uid

Code:
User wwwrun
Group www

servertuning


Code:
/etc/sysconfig/apache2.

<IfModule prefork.c>
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild
	MaxRequestsPerChild  10000
</IfModule>

<IfModule worker.c>
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#minsparethreads
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxsparethreads
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadsperchild
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild
	MaxRequestsPerChild  10000
</IfModule>


KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 15


<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

redirect-carefully
	BrowserMatch "^WebDrive" redirect-carefully
	BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
	BrowserMatch "^gnome-vfs" redirect-carefully
</IfModule>

mod_log_config

Code:
LogFormat "%h %l %u %t \"%r\" %>s %b"			common
LogFormat "%v %h %l %u %t \"%r\" %>s %b"		vhost_common
LogFormat "%{Referer}i -> %U"				referer
LogFormat "%{User-agent}i"				agent
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\""			combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\""			vhost_combined

# To use %I and %O, you need to enable mod_logio
<IfModule mod_logio.c>
LogFormat "%h %l %u %t \"%r\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\" %I %O"		combinedio
</IfModule>


<IfModule mod_ssl.c>
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b"						ssl_common
Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
\"%r\" %b \"%{Referer}i\" \"%{User-Agent}i\""		ssl_combined
</IfModule>

global
Code:
ServerSignature on
UseCanonicalName Off
ServerTokens OS
LogLevel warn
CustomLog /var/log/apache2/access_los combined

mod_status
Code:
<IfModule mod_status.c>
    <Location /server-status>
	SetHandler server-status
	Order deny,allow
	Deny from all
	Allow from localhost 127.0.0.1
    </Location>
</IfModule>
 
und in welchen punkten?

ich hab das so verstanden, das erst die default werte gelesen werden und dann mit den vhost die werte spezifisch angepasst werden.???

P.S.: für mich sehen die relativ gleich aus.

mod_userdir
Code:
<IfModule mod_userdir.c>
	UserDir disabled root



	<Directory /home/*/public_html>

		AllowOverride FileInfo AuthConfig Limit Indexes
		Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

		<Limit GET POST OPTIONS PROPFIND>
			Order allow,deny
			Allow from all
		</Limit>

		<LimitExcept GET POST OPTIONS PROPFIND>
			Order deny,allow
			Deny from all
		</LimitExcept>

	</Directory>

</IfModule>
 
Nö.

entweder oder - je nach dem, welcher VHost greift zieht die eine oder die andere Konfiguration. Und da Du (zumindest bisher nicht gesehen) keine NamedVirtualHost-Konfig hast greift die, die als letzte gezogen wird.

Hast Du schon mal die Apache-Doku zum Thema vHost gelesen?
 
ok von Named steh da auch was drin eigentlich dachte ich durch die zeile

ServerName in <VirtualHost> waere es Namensbasiert?

Und den Zusammen hang verstehe ich immennoch nicht :S
 
Nö.

Schau Dir bitte mal die Apache-Doku (die offizielle) zu dem Thema an - da ist alles gut erklärt - und auch erklärt, was die einzelnen Direktiven bewirken...
 
http://www.lmgtfy.com/?q=apache+doku

... ich geb's zu, echt schwer zu finden und auch überhaupt niicht intuitiv.
 
Da ich ja die Offizelle nehmen sollte fragte ich nach dem Link.

Wie dem auch sei, viel schlauer bin ich jetzt auch nicht.

Fakt ist ich habe 2 Virtuelle Server. zum einen Nagios und zum anderen MeinWeb.

Die nagios conf wird durch die httpd.conf eingebunden(s.o.) und sieht wie folgt aus(kusiv ist von mir hinzugefügt):

Code:
[i]NameVirtualHost *:80


<VirtualHost *:80 >

ServerName */nagios
ServerAlias nagios *nagios
DocumentRoot /usr/local/nagios[/i]


# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

<Directory "/usr/local/nagios/share/Rohbau">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>


[i]
</VirtualHost>[/i]


Und dann gibt es auch noch die MeinWeb.conf:

Code:
NameVirtualHost *:80

<VirtualHost *:80 >
SeerverAdmin na@na.com
DocumentRoot /var/www/htdocs/MeinWebOrdner
ServerName MeinWeb
ErrorLog  _pfad_
CostumLog -Pfad-

Allerdings funz jetzt Keiner von beiden?

Habe mich an das Beispiel
aus der offizellen Doku gehalten:

Code:
NameVirtualHost *:80

<VirtualHost *:80>

ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain

</VirtualHost>

<VirtualHost *:80>

ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain

</VirtualHost>
 
Oben