[FUGSPBR] chrootando o apache !!!!

Soulofblack n.i.b em terra.com.br
Dom Out 13 18:42:09 BRT 2002


        Caros colegas,

  Estou tentando chrootar o apache pela primeira vez.
  Porem quando tento inicial o daemon httpd o mesmo me retorna com..	


ROOT(/home/apache-chroot)[18:26]# chroot . sbin/apachectl start
sbin/apachectl: /home/apache-chroot/sbin/httpd: not found

O problema é que o httpd esta nesse diretorio.

--------------------------------------------%
ROOT(/home/apache-chroot)[18:26]# ls -la
total 20
drwxr-xr-x  9 root  wheel  512 Oct 13 13:28 .
drwxr-xr-x  6 root  wheel  512 Oct 12 21:48 ..
lrwxr-xr-x  1 root  wheel    7 Oct 12 23:58 bin -> usr/bin
drwxr-xr-x  2 root  wheel  512 Oct 13 01:20 dev
drwxr-xr-x  3 root  wheel  512 Oct 13 13:07 etc
lrwxr-xr-x  1 root  wheel    7 Oct 13 12:25 lib -> usr/lib
drwxr-xr-x  2 root  wheel  512 Oct 13 13:19 sbin
drwxr-xr-x  3 root  wheel  512 Oct 13 02:05 src
drwxrwxrwt  2 root  wheel  512 Oct 12 21:49 tmp
drwxr-xr-x  9 root  wheel  512 Oct 13 12:23 usr
drwxr-xr-x  6 root  wheel  512 Oct 13 12:00 webhome
--------------------------------------------%

O apache2 foi compilado como --enable-layout=chroot

ROOT(/home/apache-chroot)[18:30]# more src/httpd-2.0.43/config.layout

---------------------------------------------%
<Layout chroot>
    prefix: /home/apache-chroot
    exec_prefix: ${prefix}
    bindir: ${exec_prefix}/bin
    sbindir: ${exec_prefix}/sbin
    libexecdir: ${exec_prefix}/usr/libexec/apache2
    mandir: ${prefix}/usr/man
    sysconfdir: ${prefix}/etc/apache2
    datadir: ${prefix}/webhome
    installbuilddir: ${prefix}/usr/share/apache2
    errordir: ${datadir}/error
    iconsdir: ${datadir}/icons
    htdocsdir: ${datadir}/htdocs
    manualdir: ${prefix}/usr/share/doc/apache2
    cgidir: ${datadir}/cgi-bin
    includedir: ${prefix}/usr/include/apache2
    localstatedir: /var
    runtimedir: ${localstatedir}/run
    logfiledir: ${localstatedir}/log
    proxycachedir: ${datadir}/proxy
    infodir: ${exec_prefix}/usr/share/info
</Layout>
---------------------------------------------%

As libs tambem foram copiadas,

ROOT(/home/apache-chroot)[18:30]# ldd sbin/httpd
sbin/httpd:
	libaprutil.so.9 => /home/apache-chroot/lib/libaprutil.so.9 (0x280c9000)
	libexpat.so.4 => /home/apache-chroot/lib/libexpat.so.4 (0x280da000)
	libapr.so.9 => /home/apache-chroot/lib/libapr.so.9 (0x280fa000)
	libm.so.2 => /home/apache-chroot/lib/libm.so.2 (0x28112000)
	libcrypt.so.2 => /home/apache-chroot/lib/libcrypt.so.2 (0x28130000)
	libc.so.5 => /home/apache-chroot/lib/libc.so.5 (0x28149000)

Esse mensagem do csh é normal?

ROOT(/home/apache-chroot)[18:36]# chroot /home/apache-chroot/
csh: Cannot open /etc/termcap.
csh: using dumb terminal settings.
%ls -la
total 20
drwxr-xr-x  9 0  0  512 Oct 13 13:28 .
drwxr-xr-x  9 0  0  512 Oct 13 13:28 ..
lrwxr-xr-x  1 0  0    7 Oct 12 23:58 bin -> usr/bin
drwxr-xr-x  2 0  0  512 Oct 13 01:20 dev
drwxr-xr-x  3 0  0  512 Oct 13 13:07 etc
lrwxr-xr-x  1 0  0    7 Oct 13 12:25 lib -> usr/lib
drwxr-xr-x  2 0  0  512 Oct 13 13:19 sbin
drwxr-xr-x  3 0  0  512 Oct 13 02:05 src
drwxrwxrwt  2 0  0  512 Oct 12 21:49 tmp
drwxr-xr-x  9 0  0  512 Oct 13 12:23 usr
drwxr-xr-x  6 0  0  512 Oct 13 12:00 webhome
%
Usando o truss

ROOT(/)[18:52]# truss /home/apache-chroot/sbin/httpd
truss: cannot open /proc/41061/mem: No such file or directory
truss: cannot open /proc/curproc/mem: No such file or directory

Essa mensagem tambem aparece quando tento com um apache em funcionamento.

Bom se alguem puder tirar minhas duvidas, ou indicar alguma literatura 
eu agradeço :-)


te++





-------------- Próxima Parte ----------
Um anexo não-texto foi limpo...
Nome: não disponível
Tipo: application/pgp-signature
Tamanho: 187 bytes
Descrição: não disponível
URL: <http://www.fug.com.br/pipermail/freebsd/attachments/20021013/9776c538/attachment.bin>


Mais detalhes sobre a lista de discussão freebsd