> man ant busybox linux nesiseka padaryt lighttpd webserverio su php uzdaryto I chroot.
> pats web severis jei be php tai startuoja sekmingai, bet jei su php tai nestartuoja. nu
> zodziu as linku turiu milijona, viska padariau kaip ten raso nu kad ir pvz :
>
> http://www.cyberciti.biz/tips/howto-setup-lighttpd-php-mysql-chrooted-jail.html
> http://www.google.com/search?hl=en&q=lighttpd+chroot&btnG=Google+Search&aq=f&oq=
>
> tai va zodziu nukopinau as ta php su lighttpd I /wwwroot/etc ir taip- toliau ir pabandziau strace
> padaryt, tai tas velnias php panasu kad librarius loadina ne is /wwwroot/lib, bet is savo standartinio
> folderio /ffp/lib
> nu jau uzsipisau. buk zmogus padek nors ant kelio uzvest.jau forumus prirasinejau ir kokio tik velnio
> nedariau bet pagalbos negaunu. gal gali ko nors uzklaust jei pats nezinosi ?
>
> nu busiu dekingas juodai. as gi dabar ziaurus linuxistas :Smile:
> is anksto dekavoju....
> Chrooted lighttpd, evhost and non-chrooted fastcgi
>
> If you're trying to use non-chrooted fastcgi combined with evhost in a chrooted lighttpd, you seem to be out of luck. To properly support this configuration, lighttpd
> would need to prepend its chroot path before its document root when making fastcgi requests. The "docroot" option can do this statically (ie, when not using
> evhost), but not for multiple hosts. Also see #1816 about this.
>
> Docs:ModProxyCore will be supporting this configuration in lighttpd 1.5.
> sorry you asked for my distro and version information as well:
>
> d# apt-show-versions | grep lighttpd
> lighttpd/edgy uptodate 1.4.13~r1370-1ubuntu1
# mkdir /webroot
# mkdir /webroot/tmp/
# chmod 1777 /webroot/tmp/
# mkdir /webroot/etc
# mkdir -p /webroot/var/log/lighttpd
# chown lighttpd:lighttpd /webroot/var/log/lighttpd
# mkdir /webroot/var/run
# chown lighttpd:lighttpd /webroot/var/run
# mkdir -p /webroot/var/tmp/lighttpd/cache/compress/
# chown lighttpd:lighttpd /webroot/var/tmp/lighttpd/cache/compress/
# mkdir -p /webroot/home/lighttpd
# chown lighttpd:lighttpd /webroot/home/lighttpd
# chmod 0700 /webroot/home/lighttpd
#!/bin/bash
BASE="/webroot"
if [ $# -eq 0 ]; then
echo "Syntax : $0 /path/to/executable"
echo "Example: $0 /usr/bin/php5-cgi"
exit 1
fi
[ ! $BASE ] && mkdir -p $BASE || :
# iggy ld-linux* file as it is not shared one
FILES="$(ldd $1 | awk '{ print $3 }' |egrep -v ^'\(')"
echo "Copying shared files/libs to $BASE..."
for i in $FILES
do
d="$(dirname $i)"
[ ! -d $BASE$d ] && mkdir -p $BASE$d || :
/bin/cp $i $BASE$d
done
# copy /lib/ld-linux* or /lib64/ld-linux* to $BASE/$sldlsubdir
# get ld-linux full file location
sldl="$(ldd $1 | grep 'ld-linux' | awk '{ print $1}')"
# now get sub-dir
sldlsubdir="$(dirname $sldl)"
if [ ! -f $BASE$sldl ];
then
echo "Copying $sldl $BASE$sldlsubdir..."
/bin/cp $sldl $BASE$sldlsubdir
else
:
fi
chmod +x /bin/chroot
# mkdir -p /webroot/usr/bin
# cp /usr/bin/php-cgi /webroot/usr/bin/
# cp /usr/bin/php /webroot/usr/bin/
# cd /webroot/etc/
# cp -avr /etc/php .
# cp /etc/hosts /webroot/etc/
# cp /etc/nsswitch.conf /webroot/etc/
# cp /etc/resolv.conf /webroot/etc/
# cp /etc/services /webroot/etc/
# cp /etc/localtime /webroot/etc/
# /bin/chroot /usr/bin/php
# /bin/chroot /usr/bin/php-cgi
# cp /lib/ld-linux.so.2 /webroot/lib
# {{{ modules
server.modules = (
"mod_rewrite",
"mod_redirect",
"mod_alias",
"mod_access",
"mod_fastcgi",
"mod_accesslog"
)
# }}}
server.username = "lighttpd"
server.groupname = "lighttpd"
server.document-root = "/home/lighttpd"
server.pid-file = "/var/run/lighttpd.pid"
server.chroot = "/webroot"
server.errorlog = "/var/log/lighttpd/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
server.modules += ("mod_fastcgi")
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd-fastcgi$
"bin-path" => "/usr/bin/php-cgi"
)
)
)
# php -v
PHP 5.2.8-pl2-gentoo (cgi-fcgi) (built: Feb 18 2009 20:56:08)
PHP 5.2.6 (cli) (built: Sep 1 2008 17:27:55)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
PHP 5.2.6 (cgi-fcgi) (built: Sep 1 2008 17:13:05)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
chroot /mnt/HD_a2/www /bin/php-cgi
chroot: cannot execute /bin/php-cgi: No such file or directory
. taigi yra itarimo kad kazkas negerai su chroot. beje, toks path /mnt/HD_a2/www/bin/php-cgi
tikrai egzistuoja. Gal yra kokiu komentaru va tokiam dalykui ?Powered by mwForum 2.29.6 © 1999-2015 Markus Wichitill