Skip to content

Commit 40cc848

Browse files
author
dxr
committed
Update CHROOTED_DEBIAN_5.0.txt_beta
1 parent 062aeb3 commit 40cc848

File tree

1 file changed

+39
-22
lines changed

1 file changed

+39
-22
lines changed

docs/CHROOTED_DEBIAN_5.0.txt_beta

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ BACKUP BACKUP BACKUP BACKUP BACKUP BACKUP
5050
/var/www/html/ Chroot system
5151
/var/www/html/var/log/apache2 Log partition (ext3)
5252
/var/www/html/var/www/html Webs partition (xfs)
53-
/var/www/html/tmp Temporal dir (tmpfs, optiones: )
53+
/var/www/html/tmp Temporal dir (tmpfs, options: )
5454

5555
/dev/lvm_foobar1/chroot_lv -> /var/www/ (ext3)
5656
/dev/lvm_foobar2/apachelogs_lv -> /var/www/html/var/log/apache2 (ext3)
@@ -68,7 +68,25 @@ dpkg -l|egrep --color -i 'apache|php'
6868

6969

7070
4. Prepair Chroot enviroment
71-
apt-get install debootstrap libpcre3 libaprutil1 libxml2 mime-support patch make gcc mysql-server subversion
71+
72+
# Install packages in real system
73+
apt-get install debootstrap libpcre3 libaprutil1 libxml2 mime-support patch make gcc mysql-server subversion ssh openssh-server ntp ntpdate vim libdbd-mysql libdbi-perl dnsutils
74+
# The non webserver will install outside of chroot
75+
apt-get install postfix postfix-mysql postfix-doc mysql-client openssl getmail4 rkhunter amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl pure-ftpd-common pure-ftpd-mysql quota quotatool
76+
# If you will use courier:
77+
apt-get install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop
78+
# If you will use dovecot:
79+
#apt-get install dovecot-imapd dovecot-pop3d
80+
# If you will use BIND:
81+
apt-get install bind9 bind9utils
82+
83+
#
84+
# If we want execute php from real system (crontabs for example) we need install php dependencies in real system:
85+
# libgd2-xpm libt1-5 libmagick10 libc-client2007b libmcrypt4
86+
# cat /var/log/ispconfig/cron.log
87+
# ldd /usr/lib/php5/20060613/mcrypt.so
88+
#
89+
7290
time debootstrap --arch=amd64 lenny /var/www/html/ ftp://ftp.fr.debian.org/debian/
7391

7492
echo "/proc /var/www/html/proc proc defaults 0 0">>/etc/fstab
@@ -79,9 +97,6 @@ mount -a
7997
# We must create sshusers group
8098
echo "@sshusers - chroot /var/www/html/">>/etc/security/limits.conf
8199

82-
# After copy, we must clean unnecessary users and groups
83-
cp -r /etc/{passwd,group,apt} /var/www/html/etc/
84-
85100
chroot /var/www/html apt-get update
86101
chroot /var/www/html apt-get install fakeroot --force-yes -y
87102
chroot /var/www/html apt-get install locales
@@ -95,15 +110,7 @@ mv /usr/lib/php5 /usr/lib/php5_old
95110
mv /etc/apache2 /etc/apache2_old
96111
mv /etc/suphp /etc/suphp_old
97112

98-
chroot /var/www/html apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libopenssl-ruby libapache2-mod-chroot php-apc vim libdbd-mysql libdbi-perl
99-
# The non webserver will install outside of chroot
100-
apt-get install postfix pure-ftpd-mysql amavisd-new clamav-getfiles clamav clamav-freshclam
101-
# If you will use courier:
102-
apt-get install courier-ssl courier-pop-ssl courier-pop courier-imap-ssl courier-imap courier-authdaemon
103-
# If you will use dovecot:
104-
apt-get install dovecot-imapd dovecot-pop3d
105-
# If you will use BIND:
106-
apt-get install bind9 bind9utils
113+
chroot /var/www/html apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libopenssl-ruby libapache2-mod-chroot php-apc libtimedate-perl
107114

108115
chroot /var/www/html /etc/init.d/apache2 stop
109116

@@ -137,6 +144,7 @@ ln -s /var/www/html/var/log/apache2 /var/log/apache2
137144
ln -s /var/www/html/var/lock/apache2 /var/lock/apache2
138145
ln -s /var/www/html/var/lib/apache2 /var/lib/apache2
139146
ln -s /var/www/html/usr/lib/php5 /usr/lib/php5
147+
ln -s /var/www/html/etc/init.d/apache2 /etc/init.d/apache2
140148
# Neccessary for to install ispconfig3 from real system:
141149
ln -s /var/www/html/usr/bin/php5 /usr/bin/php5
142150
ln -s /var/www/html/etc/alternatives/php /etc/alternatives/php
@@ -158,28 +166,25 @@ mv /var/www/html/usr/lib/sendmail /var/www/html/usr/lib/sendmail_old
158166
mv /var/www/html/usr/sbin/sendmail /var/www/html/usr/sbin/sendmail_old
159167
cp mini_sendmail /var/www/html/usr/sbin/mini_sendmail
160168
cd /var/www/html/usr/lib/ && ln -s ../sbin/mini_sendmail sendmail
161-
/var/www/html/usr/sbin && ln -s mini_sendmail sendmail
169+
cd /var/www/html/usr/sbin && ln -s mini_sendmail sendmail
162170

163171
# ./mini_sendmail -h
164172
# usage: ./mini_sendmail [-f<name>] [-t] [-s<server>] [-p<port>] [-T<timeout>] [-v] [address ...]
165173

166174
#add to php.ini (/var/www/html/etc/php5/apache2/php.ini /var/www2/etc/php5/cli/php.ini /var/www2/etc/php5/cgi/php.ini line :672)
167-
168-
sendmail_path = /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1
175+
# sendmail_path = /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1
169176

170177
sed -i -e 's#^;sendmail_path =$#sendmail_path = /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1#' /var/www/html/etc/php5/apache2/php.ini /var/www/html/etc/php5/cli/php.ini /var/www/html/etc/php5/cgi/php.ini
171178

172179

173180
7.
174181
# Test
175182
apache2ctl restart
176-
chroot /var/www/html/
177183

178184
# php -i|grep --color sendmail
179-
sendmail_from => no value => no value
180-
sendmail_path => /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1 => /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1
181-
Path to sendmail => /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1
182-
#
185+
#sendmail_from => no value => no value
186+
#sendmail_path => /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1 => /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1
187+
#Path to sendmail => /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.com -s127.0.0.1
183188

184189
# Sould be good idea check /var/www/html/usr/lib/sendmail /var/www/html/usr/sbin/sendmail and /var/www/html/usr/sbin/mini_sendmail with nagios alarm ;)
185190

@@ -188,8 +193,20 @@ Path to sendmail => /usr/sbin/mini_sendmail -t -i -fhosting@alojamientotecnico.c
188193

189194
cd /tmp/
190195
svn co svn://svn.ispconfig.org/ispconfig3 svn.ispconfig.org
196+
191197
mv /usr/local/ispconfig /var/www/html/usr/local/
192198
ln -s /var/www/html/usr/local/ispconfig /usr/local/ispconfig
199+
mv /var/www/apps /var/www/html/var/www/
200+
mv /var/www/php-fcgi-scripts /var/www/html/var/www/
201+
mv /var/www/ispconfig /var/www/html/var/www/
202+
ln -s /var/www/html//var/www/ispconfig /var/www/ispconfig
203+
ln -s /var/www/html/var/www/php-fcgi-scripts /var/www/php-fcgi-scripts
204+
ln -s /var/www/html/var/www/apps /var/www/apps
205+
# After copy, we must clean unnecessary users and groups
206+
cp -r /etc/{passwd,group,apt} /var/www/html/etc/
207+
apache2ctl stop
208+
apache2ctl start
209+
193210

194211
### Migration to other server ###
195212
Really easy:

0 commit comments

Comments
 (0)