lillop 10 Report post Posted October 6, 2010 Salve Come sempre ritorno per avere altre risposte alle mie domande Ho appena rinstallato sulla mia vps debian. Apache2 php5 mysql e phpmyadmin Poi ho voluto chroottare apache2 seguendo questa guida http://www.salaserver.com/10531/conf...oot-su-debian/ Chroot serve per isolare un determinata "applicazione" però se provo ad entrare in var/www troverò: index.php e la cartella /var all'interno di var: /run /www E fin qui tutto bene... all'interno di www: backups cache lib local lock log mail opt run spool tmp www All'interno di www: index.php /var e così via... in modo infinito... è normale? Dove devo poi copiare i file per il web? Share this post Link to post Share on other sites
cxcs 10 Report post Posted October 6, 2010 Quelli che trovi di seguito sono degli appunti di una procedura che utilizzavo per il chroot di Apache qualche tempo fa.Dovrebbe essere ancora valida,vedi se riesci a ricavarne qualche spunto utile per la tua configurazione. :ciao: # vi /etc/apache2/apache2.conf PidFile /var/run/apache2.pid ChrootDir /var/www/apache LoadFile /lib/libgcc_s.so.1 LoadFile /lib/libnss_dns.so.2 #ServerRoot "/etc/apache2" mkdir -p /var/chroot/apache/var/www cd /var/chroot/apache mkdir bin dev etc lib tmp usr var mount -t auto -o bind /var/www /var/chroot/apache/var/www mount -t auto -o bind /tmp /var/chroot/apache/tmp/ cd /var/chroot/apache/usr mkdir bin lib sbin share cd /var/chroot/apache/share mkdir curl misc php mount -t auto -o bind /usr/share/php /var/chroot/apache/usr/share/php cp -a /etc/mime.types /var/chroot/etc/ cp -a /usr/share/zoneinfo/Europe/Madrid /var/chroot/usr/share/zoneinfo/Europe/ cp -a /etc/adjtime /var/chroot/etc/ # vi /etc/fstab and add mount points /var/www /var/chroot/apache/var/www auto bind 0 0 /usr/share/php /var/chroot/apache/usr/share/php auto bind 0 0 /tmp /var/chroot/apache/tmp auto bind 0 0 cd /var/chroot/apache/var mkdir run cache mkdir /var/chroot/apache/var/cache/apache2 chown apache:root /var/chroot/apache/var/cache/apache2 [color=#000000][size=2]chown -R www-data:www-data /home/www/var/www/[/size][/color] cd /var/chroot/apache/var/run mkdir mysqld chown mysql:mysql /var/chroot/apache/var/run/mysqld cd /var/chroot/apache/lib cp /lib/ld-linux.so.2 . cp /lib/libc.so.6 . cp /lib/libdl.so.2 . cp /lib/libncurses.so.5 . cp /lib/libnsl.so.1 . cp /lib/libnss_compat.so.2 . cp /lib/libnss_dns.so.2 . cp /lib/libnss_files.so.2 . cp /lib/libnss_nis.so.2 . cp /lib/libz.so.1 . cd /var/chroot/apache/etc cp /etc/hosts . cp /etc/ld.so.cache . cp /etc/localtime . cp /etc/nsswitch.conf . cp /etc/passwd . # vi passwd (leave bin, mail, postmaster, nobody and apache) cp /etc/resolv.conf . cp /etc/services . cd /var/chroot/apache/dev mknod -m 444 urandom c 1 9 mknod -m 666 null c 1 3 cd /var/chroot/apache/bin cp /bin/sh . # vi /etc/mysql/my.cnf [client] socket = /var/chroot/apache/var/run/mysqld/mysqld.sock [server] socket = /var/chroot/apache/var/run/mysqld/mysqld.sock /etc/init.d/mysql restart # make sure you're env knows to where it's at.. simple create alias vi /root/.bashrc alias mysql="mysql -S /var/chroot/apache/var/run/mysqld/mysqld.sock" Errore : [u]Please verify that the current setting of session.save_path is correct[/u] Soluzione : # vim /etc/php5/apache2/php.ini #MODIFICATO PER MOD_CHROOT APACHE ;session.save_path = /var/lib/php5 session.save_path = /tmp ae2nmod mod_chroot apache2ctl stop apache2ctl start # vim /etc/apache2/envvars export APACHE_PID_FILE=/var/www/apache/var/run/apache2.pid #export APACHE_PID_FILE=/var/run/apache2.pid /etc/init.d/apache2 stop /etc/init.d/apache2 start Share this post Link to post Share on other sites
lillop 10 Report post Posted October 7, 2010 Faccio fatica a seguirti :( Ti posso chiedere gentilmente per 1 secondo di dare uno sguardo al tutorial che ho linkato? Share this post Link to post Share on other sites
xAnder 10 Report post Posted October 7, 2010 Mi sembra proprio un clone di chroot debian - Forum OVH Share this post Link to post Share on other sites
lillop 10 Report post Posted October 7, 2010 Non si poteva fare? Scusatemi :( Lo faccio per avere più info :( Non capiterà più Share this post Link to post Share on other sites