[FC3-Apache] DocumentRoot must be a directory

Pagina: 1
Acties:

  • freeco
  • Registratie: Juni 2001
  • Laatst online: 29-12-2025
Sinds mijn overstap naar FC3 krijg ik mijn Apache niet meer aan de praat zoals vroeger.

Via een search hier vond ik dat ik niet de enige ben, maar er niet onmiddellijk een oplossing voor is:

[rml][ apache] DocumentRoot is geen dir[/rml]

Via google vond ik nog van dit, maar nergens zie ik een oplossing gepost...


Mijn DocumentRoot is dus niet de standaard /var/www/html, maar /mnt/disk2/www/html. M.a.w. hij staat op mijn 2de disk in de server... Voorlopig los ik dit kleine euvel op door alles alles gewoon onder de /var/www/html te zetten, maar dit doe ik liever niet.

Het rare is (naast het feit dat dit perfect werkte onder RH7/8/9 en FC2) dat mijn andere server op identiek dezelfde manier ingesteld staat, en het daar wél werkt.


Even een aantal zaken posten waar in de post van Birkoff ook naar gevraagd werd:
code:
1
2
3
4
5
6
7
8
9
10
11
[root@Corolla www]# mount
/dev/hda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
none on /dev/shm type tmpfs (rw)
/dev/hdb1 on /mnt/disk2 type ext3 (rw)
/dev/hdc1 on /mnt/disk3 type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)


stukje uit /etc/httpd/httpd.conf: (naast deze 2 aanpassingen is ie volledig standaard)
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/mnt/disk2/www/html"

...

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/mnt/disk2/www/html">

en ja, ik heb de quotes al weggedaan, en ook een slash achteraan geprobeerd...

code:
1
2
3
4
5
6
7
8
9
10
[root@Corolla disk2]# ls -all
total 44
drwxrwxrwx   8 root   admins 4096 Dec 16 13:46 .
drwxr-xr-x   4 root   root   4096 Nov 19 18:58 ..
drwxr-xr-x   4 freeco admins 4096 Dec 16 14:47 _backup_
drwxrwxr-x  20 root   admins 4096 Dec 16 13:46 Images
drwxrwxrwx  14 root   root   4096 Dec 16 13:46 JPG's
drwx------   2 root   root   4096 Nov 19 19:03 lost+found
drwx------   2 root   root   4096 Nov 20 12:39 .Trash-root
drwxr-xr-x   7 root   root   4096 Nov 20 12:17 www


code:
1
2
3
4
5
6
7
8
9
[root@Corolla www]# ls -all
total 28
drwxr-xr-x   7 root root   4096 Nov 20 12:17 .
drwxrwxrwx   8 root admins 4096 Dec 16 13:46 ..
drwxr-xr-x   2 root root   4096 Feb 25  2003 cgi-bin
drwxr-xr-x   3 root root   4096 Apr  8  2003 error
drwxr-xr-x   6 root root   4096 Dec 16 14:10 html
drwxr-xr-x   3 root root   4096 Apr  8  2003 icons
drwxr-xr-x  13 root root   4096 Apr  8  2003 manual


laatste stuk uit strace service httpd start:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/sbin/env", 0xfee64450)         = -1 ENOENT (No such file or directory)
stat64("/usr/sbin/env", 0xfee64450)     = -1 ENOENT (No such file or directory)
stat64("/bin/env", {st_mode=S_IFREG|0755, st_size=15676, ...}) = 0
access("/bin/env", X_OK)                = 0
stat64("/bin/env", {st_mode=S_IFREG|0755, st_size=15676, ...}) = 0
access("/bin/env", X_OK)                = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xf6ff2708) = 31296
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGINT, {0x807603b, [], SA_RESTORER, 0x3c5a48}, {SIG_DFL}, 8) = 0
waitpid(-1, Starting httpd: Syntax error on line 265 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
                                                           [FAILED]
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0) = 31296
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
waitpid(-1, 0xfee6410c, WNOHANG)        = -1 ECHILD (No child processes)
sigreturn()                             = ? (mask now [])
rt_sigaction(SIGINT, {SIG_DFL}, {0x807603b, [], SA_RESTORER, 0x3c5a48}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(255, "", 1819)                     = 0
exit_group(1)                           = ?


ik herken me dus heel goed in de situatie van Birkoff, maar ook voor hem was de enige oplossing de DocumentRoot verplaatsen naar een meer standaard-directory...

/mnt/disk2/www/html is toch wel degelijk een directory, en de rechten staan toch ook goed?

Heeft iemand hier nu al een oplossing of oorzaak voor gevonden? Of ben ik genoodzaakt om toch de standaard /var/www/html te blijven gebruiken en te hopen dat het in FC4 opgelost is?

  • Osiris
  • Registratie: Januari 2000
  • Niet online
Kun je niet in /var/www/ een sym-link maken naar die andere dir op je 2e schijf? :?

  • freeco
  • Registratie: Juni 2001
  • Laatst online: 29-12-2025
ik heb al eens gebrobeerd /var/www/html te verwijderen
van /mnt/disk2/var/html een link te maken
en die te copieren naar /var/www/

voor nautilus geen enkel probleem, maar voor Apache niet: zelfde error...

  • Pyrowired
  • Registratie: Februari 2004
  • Laatst online: 05-01-2025
Heb je toevallig ook SELinux draaien?

Dan heb je hier misschien iets aan.

Zolang de zon schijnt, blijf ik binnen.


  • freeco
  • Registratie: Juni 2001
  • Laatst online: 29-12-2025
dat zou inderdaad wel de oorzaak kunnen zijn!
Ik denk dat SElinux onder FC3 standaard geactiveerd wordt. Onder FC2 nog niet...
Ik ga het deze namiddag nog eens bekijken.

  • freeco
  • Registratie: Juni 2001
  • Laatst online: 29-12-2025
yep, het was dus inderdaad SELinux dat de oorzaak was.
De oplossing staat hier: http://fedora.redhat.com/...ng.html#sn-httpd-booleans

Ik zet gewoon de "SELinux protection for Apache HTTP" uit. Die server is toch niet kritiek en staat achter een degelijke firewall.

phpSysInfo 2.3 werkt nu ook terug. Zelfs al zette ik het onder de default /var/www/html kon ik 2.3 niet werkend krijgen. 2.2 werkte wel...

  • F_J_K
  • Registratie: Juni 2001
  • Niet online

F_J_K

Moderator CSA/PB

Front verplichte underscores

Blijkbaar nogal Linux-specifiek dus stiekem even SA --> NOS :)

'Multiple exclamation marks,' he went on, shaking his head, 'are a sure sign of a diseased mind' (Terry Pratchett, Eric)


  • PowerSp00n
  • Registratie: Februari 2002
  • Laatst online: 17-11-2025

PowerSp00n

There is no spoon

En met een trailing slash in die document root? Zoals je het nu aangeeft kan die html ook een file zijn, of misschien toch een directory?

[edit] Weer lekker gelezen :P, maargoed dan is bovenstaande alsnog een tip voor in het vervolg :).

[ Voor 28% gewijzigd door PowerSp00n op 17-12-2004 17:35 ]


Verwijderd

freeco schreef op vrijdag 17 december 2004 @ 13:03:
Ik zet gewoon de "SELinux protection for Apache HTTP" uit. Die server is toch niet kritiek en staat achter een degelijke firewall.
Uhm, ik neem aan dat je met firewall een packetfilter bedoelt (iptables). Dan is dat absoluut geen argument om SELinux uit te zetten. Het lijkt me persoonlijk verstandiger de policy aan te passen of de schijf onder /var/www/html te mounten en dan restorecon -v -R /var/www/ te runnen bijvoorbeeld :)

[ Voor 4% gewijzigd door Verwijderd op 17-12-2004 23:32 ]

Pagina: 1