tbrehm
2009-02-08 dab85326e23b684ecf731ce5be6b67a563a0f09f
commit | author | age
4cb0eb 1 Installation
T 2 -----------
3
9ba456 4 # It is recommended to use a clean (fresh) Debian lenny install where you just selected "Standard System" as the package selection during
A 5 # setup. Then follow the steps below to setup your server with ISPConfig 3. In this guide "vi" is used as texteditor, but you ofcourse
6 # you can use whatever you prefer. You should be root for doing all of this.
4cb0eb 7
9ba456 8
A 9 # Check we have Fully Qualified Domain Name
10
11 /bin/hostname
12
13 # it should return something like "ispconfig.example.com"
f79001 14 # if not, then we assign a hostname (for example ispconfig):
fdf891 15
F 16 echo ispconfig.example.com > /etc/hostname
17
18 vi /etc/hosts
4c9967 19
f79001 20 # and add lines similar but appropriate:
9ba456 21
fdf891 22 127.0.0.1       localhost.localdomain   localhost
F 23 192.168.0.100   ispconfig.example.com   ispconfig
24
4cb0eb 25
T 26
9ba456 27 # Some optional choices
A 28
29 opt0.1) Optionally install SSH-server to get remote shell
30
31 apt-get install ssh openssh-server
32
f79001 33 opt0.2) Optionally if you are not running in virtual machine you can set server clocksync via NTP. Virtual quests get this from the host.
9ba456 34
A 35 apt-get install ntp ntpdate
36
37
38
f79001 39 # Next is the real deal
9ba456 40
610bc7 41 1) Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin, rkhunter, binutils with the following command line (on one line!):
9ba456 42
76dcb7 43 apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server 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 openssl courier-maildrop getmail4 rkhunter binutils
9ba456 44
A 45 # Answer the questions from the package manager as follows.
4cb0eb 46
T 47 Create directories for web-based administration ? <-- No
48 General type of configuration? <-- Internet site
49 Mail name? <-- server1.mydomain.tld
50  SSL certificate required <-- Ok
51
4c9967 52 # ...use your own domain name of course ;)
4cb0eb 53
9ba456 54
A 55
56 # Edit the file /etc/mysql/my.cnf
d4c9b3 57
T 58 vi /etc/mysql/my.cnf
59
9ba456 60 # and comment out the line
d4c9b3 61
T 62 bind-address          = 127.0.0.1
63
9ba456 64 # then restart mysql
d4c9b3 65
T 66 /etc/init.d/mysql restart
67
9ba456 68 # Set the mysql database password:
f79001 69 # Again use your own domain name...
d4c9b3 70
T 71 mysqladmin -u root password yourrootsqlpassword
72 mysqladmin -h ispconfig.local -u root password yourrootsqlpassword
9ba456 73
d4c9b3 74
T 75
4cb0eb 76 2) Install Amavisd-new, Spamassassin and Clamav (1 line!):
T 77
ba66cd 78 apt-get install 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
4cb0eb 79
T 80
81
f79001 82 3) Install apache, PHP5, phpmyadmin, better fastCGI, suexec, Pear and mcrypt (1 line!):
4cb0eb 83
b5f091 84 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
9ba456 85
A 86
f79001 87 # When phpMyAdmin is asking weather to configure itself automatically, select "Apache2"
9ba456 88
A 89 # Then run the following to enable the Apache modules suexec, rewrite and ssl:
90
dab853 91 a2enmod suexec rewrite ssl actions include
9ba456 92
4c9967 93 # Secure phpMyAdmin by deleting setuppassword-file
A 94 # and removing/commenting Setup Authorization from apache.conf
95
96 rm /etc/phpmyadmin/htpasswd.setup
97
98 vi /etc/phpmyadmin/apache.conf
99
100 # delete/comment following lines (between the ----- lines):
101 ------------------------------------------------------
102         # Authorize for setup
103        <Files setup.php>
104            # For Apache 1.3 and 2.0
105            <IfModule mod_auth.c>
106                AuthType Basic
107                AuthName "phpMyAdmin Setup"
108                AuthUserFile /etc/phpmyadmin/htpasswd.setup
109            </IfModule>
110            # For Apache 2.2
111            <IfModule mod_authn_file.c>
112                AuthType Basic
113                AuthName "phpMyAdmin Setup"
114                AuthUserFile /etc/phpmyadmin/htpasswd.setup
115            </IfModule>
116            Require valid-user
117        </Files>
118 ------------------------------------------------------
119
120
f79001 121 opt3.1) Optionally install some image manipulation capabilities to make advanced web designers happy
9ba456 122
A 123 apt-get install php5-imagick imagemagick
124
4c9967 125 # restart apache before continuing
9ba456 126
4c9967 127 /etc/init.d/apache2 restart
A 128  
4cb0eb 129
T 130 4) Install pure-ftpd and quota
131
132 apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool
133
9ba456 134 # Edit the file /etc/default/pure-ftpd-common to change the start mode from "inetd" to "standalone".
af8f1b 135
T 136 vi /etc/default/pure-ftpd-common
137
9ba456 138 # Edit the file /etc/inetd.conf to prevent inetd from trying to start ftp.
A 139 # To do this, comment line starting like "ftp   stream  tcp" by adding "#"-sign in front of the line.
3845f1 140
T 141 vi /etc/inetd.conf
4fe973 142
9ba456 143 # Then execute:
af8f1b 144
T 145 /etc/init.d/openbsd-inetd restart
9ba456 146
af8f1b 147
4cb0eb 148
T 149 5) Install mydns
150
777da7 151 apt-get install g++ libc6 gcc gawk make texinfo libmysqlclient15-dev
4cb0eb 152
777da7 153 cd /tmp
76dcb7 154 wget http://heanet.dl.sourceforge.net/sourceforge/mydns-ng/mydns-1.2.8.15.tar.gz
A 155 tar xvfz mydns-1.2.8.15.tar.gz
777da7 156 cd mydns-1.2.8
T 157 ./configure
158 make
159 make install
d4c9b3 160
4c9967 161 # Now create the start / stop script for mydns:
4cb0eb 162
777da7 163 vi /etc/init.d/mydns
T 164
4c9967 165 # and enter the following lines (between the ----- lines):
777da7 166
T 167 ------------------------------------------------------
168 #! /bin/sh
169 #
170 # mydns         Start the MyDNS server
171 #
172 # Author:       Philipp Kern <phil@philkern.de>.
173 #               Based upon skeleton 1.9.4 by Miquel van Smoorenburg
174 #               <miquels@cistron.nl> and Ian Murdock <imurdock@gnu.ai.mit.edu>.
175 #
176
177 set -e
178
179 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
180 DAEMON=/usr/local/sbin/mydns
181 NAME=mydns
182 DESC="DNS server"
183
184 SCRIPTNAME=/etc/init.d/$NAME
185
186 # Gracefully exit if the package has been removed.
187 test -x $DAEMON || exit 0
188
189 case "$1" in
190   start)
191         echo -n "Starting $DESC: $NAME"
192         start-stop-daemon --start --quiet \
193                 --exec $DAEMON -- -b
194         echo "."
195         ;;
196   stop)
197         echo -n "Stopping $DESC: $NAME"
198         start-stop-daemon --stop --oknodo --quiet \
199                 --exec $DAEMON
200         echo "."
201         ;;
202   reload|force-reload)
203         echo -n "Reloading $DESC configuration..."
204         start-stop-daemon --stop --signal HUP --quiet \
205                 --exec $DAEMON
206         echo "done."
207         ;;
208   restart)
209         echo -n "Restarting $DESC: $NAME"
210         start-stop-daemon --stop --quiet --oknodo \
211                 --exec $DAEMON
212         sleep 1
213         start-stop-daemon --start --quiet \
214                 --exec $DAEMON -- -b
215         echo "."
216         ;;
217   *)
218         echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
219         exit 1
220         ;;
221 esac
222
223 exit 0
224 ---------------------------------------------------------------------------
225
4c9967 226 # now execute:
777da7 227
T 228 chmod +x /etc/init.d/mydns
229 update-rc.d mydns defaults
4cb0eb 230
T 231 6) Install vlogger and webalizer
232
233 apt-get install vlogger webalizer
234
476a60 235 7) Install Jailkit (optional, only needed if you want to use chrroting for SSH users)
4cb0eb 236
476a60 237 apt-get install build-essential autoconf automake1.9 libtool flex bison
V 238 cd /tmp
239 wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz
240 tar xvfz jailkit-2.5.tar.gz
241 cd jailkit-2.5
242 ./configure
243 make
244 make install
245 rm -rf jailkit-2.5*
246
247 8) Install fail2ban (optional but recomended, because the monitor tries to show the log)
248 More info at: http://www.howtoforge.com/fail2ban_debian_etch
249
250 apt-get install fail2ban
251
252 9) Install ISPConfig 3
4cb0eb 253
4c9967 254 # There are two possile scenarios, but not both:
476a60 255 9.1) Install the latest released version 
V 256 9.2) Install directly from SVN
4cb0eb 257
476a60 258 9.1) Installation of last version from tar.gz
4cb0eb 259
T 260   cd /tmp
bf50bc 261   wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.8-rc1.tar.gz
T 262   tar xvfz ISPConfig-3.0.0.8-rc1.tar.gz
3fac98 263   cd ispconfig3_install/install/
4cb0eb 264
476a60 265 9.2) Installation from SVN
4cb0eb 266
T 267   apt-get install subversion
268   cd /tmp
269   svn export svn://svn.ispconfig.org/ispconfig3/trunk/
270   cd trunk/install
271
272
476a60 273 9.1+9.2) Now proceed with the ISPConfig installation.
4cb0eb 274
4c9967 275 # Now start the installation process by executing:
4cb0eb 276
T 277 php -q install.php
278
4c9967 279 # The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not nescessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!):
4cb0eb 280
T 281 http://192.168.0.100:8080/
282
4c9967 283 # the default login is:
4cb0eb 284
T 285 user: admin
286 password: admin
287
4c9967 288 # In case you get a permission denied error from apache, please restart the apache webserver process.
ba66cd 289
9ba456 290
A 291
292 ----------------------------------------------------------------------------------------------------------
3845f1 293 Optional:
T 294
490039 295 Install a webbased Email Client
3845f1 296
T 297 apt-get install squirrelmail
298 ln -s /usr/share/squirrelmail/ /var/www/webmail
299
300 Access squirrelmail:
301
302 http://192.168.0.100/webmail
303
304
305 To configure squirrelmail, run:
306
307 /usr/sbin/squirrelmail-configure
308
ba66cd 309 ----------------------------------------------------------------------------------------------------------
T 310
311 Hints:
312
313 debian 4.0 under openvz:
314
8a6a58 315 VPSID=101
ba66cd 316 for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE
T 317 do
318   vzctl set $VPSID --capability ${CAP}:on --save
319 done
46bf55 320
T 321 ----------------------------------------------------------------------------------------------------------
322
14716c 323
f79001 324 Optional recommended packages:
14716c 325
F 326 denyhosts - a utility to help sys admins thwart ssh crackers
327 rsync - fast remote file copy program (for backup)