PDA

Bekijk Volledige Versie : Problemen met apache 2.2.3



Blacky
19/09/08, 03:38
Betreft een nieuwe installatie op een testmachine, Centos 5 en httpd met yum geinstalleerd.
Ik ben er al urenlang naar aan het zoeken met google maar krijg geen oplossing gevonden.

Dit krijg ik als foutmelding in de errorlog bij het bezoeken van een domein:
[client 82.168.xx.xx] Directory index forbidden by Options directive: /var/www/html/

Ik krijg dan op beide virtuele sites wel gewoon netjes de welkom pagina te zien van apache.

Oplossing volgens google: Maak in de /var/www/html een lege index.html aan en het probleem is opgelost.

Nou niet dus. Gevolg hiervan is dat er bij het bezoeken van de site gewoon een lege pagina zichtbaar wordt.
Dit staat dan in de error log:
[error] [client ::1] Directory index forbidden by Options directive: /var/www/html/

Nu heb ik de userdir in apache uitgeschakeld en dan krijg je het volgende weer. Geen errorlog meldingen meer, maar wel dit in de access log:


82.168.xxx.xxx - - [19/Sep/2008:03:17:06 +0200] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 1.1.4322)"
82.168.xxx.xxx - - [19/Sep/2008:03:17:08 +0200] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 1.1.4322)"
82.168.xxx.xxx - - [19/Sep/2008:03:17:08 +0200] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 1.1.4322)"
82.168.xxx.xxx - - [19/Sep/2008:03:17:09 +0200] "GET / HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
.NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 1.1.4322)"
::1 - - [19/Sep/2008:03:17:25 +0200] "GET / HTTP/1.0" 200 - "-" "Apache/2.2.3 (CentOS) (internal dummy connection)"

Dus bij de ene site 304's en bij de tweede virtual host die internal dummy connection.

Ook daar is hopen over te vinden, maar de geboden oplossing (Options +indexes) helpt ook niet.

Op m'n andere bak had ik nog apache 2.0 staan en daar had ik geen problemen, zelfde wijze geconfigureerd.

Hier wat gegevens uit de httpd.conf:

DocumentRoot "/var/www/html"
<Directory />
Options FollowSymLinks
AllowOverride Options
</Directory>

<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>


en dan nog de virtual hosts:


NameVirtualHost 10.0.0.2:80

<VirtualHost 10.0.0.2:80>
DocumentRoot /home/jantje/public_html
ServerName jantje.dhs.org
ServerAdmin info@jantje.dhs.org
ErrorLog /var/log/httpd/jantje.log
</VirtualHost>

<VirtualHost 10.0.0.2:80>
DocumentRoot /home/pietje/public_html
ServerName pietje.dyndns.org
ServerAdmin info@pietje.dyndns.org
ErrorLog /var/log/httpd/pietje.log
</VirtualHost>

Ik zie door de bomen het bos niet meer, met apache 1.3 liep dit zo perfekt. Als er meer informatie nodig is hoor ik het graag.

MMaI
19/09/08, 07:53
heb je de rechten op de betreffende mappen goed staan?
dus chown [je www user]:[je www user groep]
en vervolgens read+ write rechten voor je eigen user op deze map (chmod 755 denk ik)

SebastiaanStok
19/09/08, 11:35
Ik neem aan dat je apache config in /etc/apache of iets staat?
Zoek is naar de Options directive, die staat namelijk ergens ingesteld dat andere geen toegang hebben of iets.

Dit kan je doen met: egrep 'Options' /etc/apache/*
En zoek ook even naar Deny from, dit is namelijk een standaard iets van Apache.

Volgens mij staat het ergens in de httpd.conf ingesteld.

Blacky
19/09/08, 13:22
@MMai: De rechten op de map staan op 755 met user jantje en groep jantje om in mijn voorbeeld te blijven. Dat is mijn user.
Apache draait onder user en usergroup apache, maar daar heb ik niets voor aangegeven.
Dat heb ik op de produktieserver ook niet en bij 1.3 ook nooit gehad. Maar ik ga het eens proberen.

drwxr-xr-x 8 jantje apache 4096 Sep 19 04:07 public_html
Nee, helaas, dan krijgik ook die 304.:(

@Rollerscapes: De config staat in de voor Centos standaard /etc/httpd/conf.
De enige aanwezige Deny from die in de httpd.conf voorkomen, staat in mijn eerste bericht vermeld bij de /home/*/public_html directive. Met egrep komt die niet zichtbaar:

egrep 'Options' /etc/httpd/conf/httpd.conf
Options FollowSymLinks
AllowOverride Options
# Possible values for the Options directive are "None", "All",
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# The Options directive is both complicated and important. Please see
Options Indexes FollowSymLinks
# Options FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Options Indexes MultiViews
Options None
# IndexOptions: Controls the appearance of server-generated directory
IndexOptions FancyIndexing FoldersFirst VersionSort NameWidth=* HTMLTable
# (You will also need to add "ExecCGI" to the "Options" directive.)
# (You will also need to add "Includes" to the "Options" directive.)
Options IncludesNoExec
# Options Includes Indexes

MvG, Blacky.

Edit: Heee... da's apart. Als ik via het lokale ip adres 10.0.0.2 de site ga bezoeken, draait de hoofdsite in elk geval wel gewoon.
Dat opent perspectief.

Blacky
19/09/08, 14:35
Gefixed!
Eerst draaide httpd op een aparte server.

Nu heb ik 2 interne netwerk interfaces. 192.168.1.11 op eth0 en 10.0.0.2 op eth1.
Daar draait een firewall tussen. Apache was ingesteld om te luisteren op 10.0.0.2. De firewall doet NAT naar het 192.168.1.x netwerk, dus gateway via eth0 naar buiten.
In de firewall kon ik http verkeer open zetten of forwarden dat maakte niet uit, dat wilde niet werken. Nja, verkeer kwam er door maar er kwam dan een 304 van apache.
Schijnbaar werkt dat met deze firewall software niet als beide interfaces intern zitten.
Met de vorige server fysiek apart op 10.0.0.3 werkte de forward perfekt.
Dus nu maar de httpd op 192.168.1.11 draaien en dan is het probleem over.

Ik vraag me alleen af of hij dan nog wel beschermd is door de firewall, daar heb ik zo mijn twijfels nog over.
Dus ik ga eens kijken of er nog een mogelijkheid is om met alias interfaces de boel toch anders te krijgen.