Change Root Gefängnis für LAMPP

Irgendwelche Probleme mit XAMPP für Linux? Dann ist hier genau der richtige Ort um nachzufragen.

Change Root Gefängnis für LAMPP

Postby SnakeCoder » 06. March 2003 12:31

Kann mir jemand erklären wie ich beim Aufbau einer Change Root Umgebung mit LAMPP vorgehen muss ?
Mfg
SnakeCoder
SnakeCoder
 

Postby Morpheus » 06. March 2003 14:59

Hi
Was willst du?
Willst du htdocs verschieben, oder /opt/lampp in einen anderen Ordner verschieben?
Morph
Morpheus
 
Posts: 218
Joined: 17. January 2003 20:58

Postby Oswald » 06. March 2003 15:53

Hallo Snake!

Gundsätzlich muss alles was LAMPP braucht unter dem chrooted Verzeichnis liegen.

Mit folgenden Schritten hab ich schon mal einen Anfang für ein chrooted LAMPP zusammengestrickt, das einfach unter /opt/lampp chrooted wird:

Code: Select all
cd /opt/lampp
cp /bin/sh /bin/cat /bin/netstat /bin/egrep bin
cp /lib/libreadline.so.4 /lib/libcrypt.so.1 /lib/libhistory.so.4 lib
cp /lib/libncurses.so.5 /lib/libdl.so.2 /lib/libc.so.6 lib
cp /lib/libnsl.so.1 /lib/ld-linux.so.2 /lib/libm.so.6 lib
cp /lib/libresolv.so.2 /lib/libpthread.so.0 /lib/libutil.so.1 lib
mkdir opt
ln -s .. opt/lampp
mkdir dev
mknod dev/null c 1 3


Danach kannst Du schon mal mit:

chroot /opt/lampp ./lampp help

den Hilfetext in dem chrooted LAMPP anzeigen lassen. Zum Starten von Apache, MySQL und so weiter reicht's aber bei weitem noch nicht. Dazu müssen noch mehr Dateien nach /opt/lampp/... kopiert werden. Aber wenn Du mal anstelle von "help" in der Zeile oben "start" schreibst, sieht Du was noch alles gebraucht wird. Ist halt 'ne Menge..

Viel Erfolg,
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Vielen Dank

Postby SnakeCoder » 06. March 2003 21:54

Okay schon mal vielen Dank,
werde das ganze gleich mal testen.
SnakeCoder
 

Postby Morpheus » 06. March 2003 22:59

Jetzt mal ne Frage:
Was bringt das?

Morph
Morpheus
 
Posts: 218
Joined: 17. January 2003 20:58

Postby cola » 19. March 2004 08:23

gibts da nicht ein gutet tut, oder anleitung für das einrichten einer chroot umgebung? (speziell für lampp)

besten dank für die hilfe
cola
 
Posts: 74
Joined: 19. February 2004 08:38

Postby Kristian Marcroft » 19. March 2004 09:10

HI,

die beste Doku die du dazu bekommst, hast du gerade oben bekommen.
Die von Kai :)
Mehr gibt es zur Zeit nicht.
Solltest du es allerdings hinbekommen, könntest du ja solch ein tut schreiben?

So long
KriS
User avatar
Kristian Marcroft
AF Moderator
 
Posts: 2962
Joined: 03. January 2003 12:08
Location: Diedorf

Postby cola » 19. March 2004 13:30

hm... ja gut, stimmt schon ist schon ein anfang!
jedoch wie geht es weiter :)?
habe ein bisschen in meinen büchern gewühtl und folgendes gefunden:
um alle Bibliotheken etc. die betroffen sind zu kopieren kann man mit dem befehl "ldd /bin/bash" herausfinden......

hat kei noch ein paar tipps :)

würde sicherlich ein tut schreiben wen ich es hinbekomme!!!
cola
 
Posts: 74
Joined: 19. February 2004 08:38

Postby cola » 31. March 2004 23:37

habe nun mal anhand der anleitung oben + sachen hineinkopiert
nun kommt jedoch folgender fehler:

linux:/ # chroot /opt/lampp ./lampp start
Starting XAMPP for Linux 1.4.4...
XAMPP: Starting Apache with SSL...
XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Sorry, I've no idea what's going wrong.
XAMPP: Please contact our forum http://community.apachefriends.org/f/
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP: - getaddrinfo 'linux' error: Name or service not known
- error: unable to determine IP address of 'linux'
- error: no valid servers configured
- Fatal: error processing configuration file '/opt/lampp/etc/proftpd.conf'

woran könnte dies liegen?
Besten Dank für die Hilfe!

mfg cola
cola
 
Posts: 74
Joined: 19. February 2004 08:38

Postby DJ DHG » 01. April 2004 00:27

@ cola

crossposting ist hier verboten!
auf deinen thread habe ich bereits geantwortet.

DJ DHG
User avatar
DJ DHG
AF Moderator
 
Posts: 2455
Joined: 27. December 2002 13:50
Location: Kiel

Postby Pc-dummy » 01. April 2004 12:27

hallo cola

Du brauchst noch:

die /lib/libnss ...?

die /etc/{hosts|nss...conf}

höchstwahrscheinlich noch uid dann solltest du dir noch /etc/{passwd|shadow|group} anlegen mit den nötigen einträgen.

Weiters solltest du "for i in /opt/lampp/bin/*; do ldd $i; done" ausführen (und noch mit "/opt/lampp/sbin/*" und sämtliche libarys die nicht in /opt/lampp/lib sind noch dahin kopieren. ( "cp `ldd bin/* sbin/* | awk '{print $3}'` lib" ausgeführt vom /opt/lampp ordner hilft auch, musst halt immer bei überschreiben "nein" sagen)

/bin/hostname währe auch noch interresant... :)

MFG
Pc-Dummy

P.s.: Cola hab dir doch gesagt du sollst dir Chroot tuts durchlesen :) (vor nen paar wochen :))
Gentoo/X86_64, AMD Athlon 64 FX-53, 1,5 GB INFINEON Ram, Audigy 2 ZS Platinum Pro, 300 GB Platten, LG-DVD Brenner
Pc-dummy
AF Moderator
 
Posts: 784
Joined: 29. December 2002 01:46
Location: AT-Vorarlberg-Feldkirch

funzt noch immer nicht....

Postby cola » 07. April 2004 14:01

so nun habe ich mir zeitgenommen und habe mal folgendes gemacht (dies sind all meine befehle die ich ausgeführt habe):
Code: Select all
cd /opt/lampp

ln -s .. opt/lampp
mkdir -p usr/bin usr/lib lib etc tmp dev
ln -s usr/bin bin
chmod 777 tmp
chmod +t tmp
mknod -m 666 dev/null c 1 3 (mknod dev/null c 1 3)
mkdir -p usr/share/zoneinfo
cp -pi /usr/share/zoneinfo/MET usr/share/zoneinfo/
cd etc
ln -s ../usr/share/zoneinfo/MET localtime
cd ..
set | grep LANG
LANG=en_US
mkdir /opt/lamp/usr/share/locale
cp -a /usr/share/locale/en_US /opt/lamp/usr/share/locale/
cp -pi /lib/libtermcap.so.2 /lib/ld-linux.so.2 /lib/libc.so.6 lib/
cp -pi /bin/ls /bin/sh /bin/cat /bin/netstat /bin/egrep bin/
chroot /opt/lampp /bin/ls -l /
rm bin/ls

touch etc/passwd etc/group etc/shadow
chmod 400 etc/shadow
echo 'www:x:888:888:Web Account:/webhome:/usr/bin/False' > etc/passwd
echo 'www:x:888:' > etc/group
echo 'www:*:10882:-1:99999:-1:-1:-1:134537804' > etc/shadow
echo 'int main(int argc, char *argv[]) { return(1); }' > /tmp/False.c
cc -o /www/usr/bin/False /tmp/False.c
chmod 111 usr/bin/*
cp -pi /lib/libnss_files.so.2 lib/
cp -pi /lib/libnss_dns.so.2 lib/
cp -pi /lib/libreadline.so.4 lib/
cp -pi /lib/libcrypt.so.1 lib/
cp -pi /lib/libhistory.so.4 lib/
cp -pi /lib/libncurses.so.5 lib/
cp -pi /lib/libdl.so.2 lib/
cp -pi /lib/libc.so.6 lib/
cp -pi /lib/libnsl.so.1 lib/
cp -pi /lib/ld-linux.so.2 lib/
cp -pi /lib/libm.so.6 lib/
cp -pi /lib/libresolv.so.2 lib/
cp -pi /lib/libpthread.so.0 lib/
cp -pi /lib/libutil.so.1 lib/

# ---- Contents of    etc/nsswitch.conf ----#
passwd: files
shadow: files
group: files
hosts: files dns

# ---- Contents of    etc/resolv.conf ----#
domain mynet.home
## use the IP address of your naming server
## if bind is not installed on your web server
nameserver 10.0.5.2
## use this if your web server is a (caching) name server
#ameserver 127.0.0.1

# ---- Contents of    etc/hosts ----#
127.0.0.1 localhost loopback mynet
10.0.5.88 web.mynet.home web www


jedoch beim sarten von apache (also nur apache) kommt folgender fehler:
Code: Select all
mynet:~ # chroot /opt/lampp ./lampp startapache
XAMPP: Starting Apache...
XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Your /etc/hosts is not okay. I will fix it.
XAMPP: See also http://www.apachefriends.org/faq-lampp-en.html#failed
XAMPP: Next try...
XAMPP: Starting Apache...
XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Your /etc/hosts is not okay. I will fix it.
XAMPP: See also http://www.apachefriends.org/faq-lampp-en.html#failed
XAMPP: Next try...
XAMPP: Starting Apache...
XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Your /etc/hosts is not okay. I will fix it.
XAMPP: See also http://www.apachefriends.org/faq-lampp-en.html#failed
XAMPP: Next try...
XAMPP: Starting Apache...
XAMPP: Error 1! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Your /etc/hosts is not okay. I will fix it.
XAMPP: See also http://www.apachefriends.org/faq-lampp-en.html#failed
XAMPP: Next try...
XAMPP: Starting Apache...
XAMPP: Error 1! Couldn't start Apache!


hoffe ihr habt genug infos um mir weiterzugehlfen.... :) besten dank!

mfg cola
cola
 
Posts: 74
Joined: 19. February 2004 08:38

Postby Pc-dummy » 07. April 2004 22:12

Log dich mal im chroot ein und gib dort "hostname" in der console ein

bzw. mach nen "echo `hostname`" in das lampp-script oben rein (nach "#! /bin/sh" :))

MFG
Pc-Dummy
Gentoo/X86_64, AMD Athlon 64 FX-53, 1,5 GB INFINEON Ram, Audigy 2 ZS Platinum Pro, 300 GB Platten, LG-DVD Brenner
Pc-dummy
AF Moderator
 
Posts: 784
Joined: 29. December 2002 01:46
Location: AT-Vorarlberg-Feldkirch

Postby cola » 08. April 2004 12:23

also wen ich:
Code: Select all
mynet:/opt/chroot # chroot /opt/chroot hostname

erscheint das korrekte: mynet

jedoch habe ich in der lampp datei noch eingefügt echo 'hostname'

und dort erscheint beim starten von lampp:
Code: Select all
mynet:/opt/chroot # chroot /opt/chroot /opt/lampp/lampp start
hostname
Starting XAMPP for Linux 1.4.4...
hostname
XAMPP: Starting Apache with SSL...
XAMPP: Error 127! Couldn't start Apache!
XAMPP: Starting diagnose...
XAMPP: Your /etc/hosts is not okay. I will fix it.
XAMPP: See also http://www.apachefriends.org/faq-lampp-en.html#failed
XAMPP: Next try...
hostname


was fehlt noch?
cola
 
Posts: 74
Joined: 19. February 2004 08:38

Postby Oswald » 08. April 2004 12:32

Huhu Cola!

Steht irgendwas in der /opt/lampp/logs/error_log?

Pc-Dummy meinte ein echo `hostname` und nicht echo 'hostname'. Letzteres ist was ganz anderes.

Liebe Grüße
Oswald
User avatar
Oswald
Apache Friends
 
Posts: 2718
Joined: 26. December 2002 19:51
Location: Berlin, Germany
Operating System: Linux

Next

Return to XAMPP für Linux

Who is online

Users browsing this forum: No registered users and 16 guests