tbrehm
2009-02-15 2ce1583e0b72b221257633c37271890018e2651c
commit | author | age
3d130f 1 ===============================================================================
T 2
3 Installation
4 ===============================================================================
5
6 It is recommended to use a clean (fresh) Ubuntu 8.04 LTS install where you selected no additional packages or servers during setup. Then follow the steps below to setup your server with ISPConfig 3:
7
8 1) Prepare your OS
9 *******************************************************************************
10 Become root user by executing:
11 ___
12 sudo su
13 ___
14
15 and entering the password of the user that you created during setup.
16
17 Edit the file /etc/apt/sources.list and comment out the line beginning with "deb cdrom:....", then run:
18 ___
19 apt-get update
20 apt-get -u upgrade
21 ___
22
23 1.1) Change The Default Shell
24 *******************************************************************************
25 There are alway Shell-Scripts which are not POSIX-compatible and only run when using BASH instead of DASH!
26 ___
27 sudo dpkg-reconfigure dash
28                            <-- ANSWER WITH: No
29 ___
30
31 1.1) Install some software
32 *******************************************************************************
33 ___
34 apt-get install wget
35 ___
36
37
38 2) Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin
39 *******************************************************************************
40 (1 line!)
41 ___
42 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 maildrop getmail4
43 ___
44
45 Answer the questions from the package manager as follows.
46
47 Enter the mysql root password. <-- Enter your mysql-root Password
48 Create directories for web-based administration ? <-- No
49 General type of configuration? <-- Internet site
50 Mail name? <-- server1.mydomain.tld
51 SSL certificate required <-- Ok
52
53 ... use your own domain name of course ;)
54
55 Authentication will be done by saslauthd. We have to change a few things to make it work properly. Because Postfix runs chrooted in /var/spool/postfix  we have to do the following:
56 ___
57 echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
58 echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf
59
60 mkdir -p /var/spool/postfix/var/run/saslauthd
61 chmod 4755 /var/run/courier/authdaemon
62
63 ___
64 Now we have to edit /etc/default/saslauthd in order to activate saslauthd. Set
65 ###
66 START=yes
67 ###
68
69 and change the line OPTIONS="-c -m /var/run/saslauthd" to
70 ###
71 OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"
72 ###
73
74 Next add the postfix user to the sasl group (this makes sure that Postfix has the permission to access saslauthd):
75 ___
76 adduser postfix sasl
77 ___
78
79 Now restart Postfix and start saslauthd:
80 ___
81 /etc/init.d/postfix restart
82 /etc/init.d/saslauthd start
83 ___
84
85
86 3) Install Amavisd-new, Spamassassin and Clamav
87 *******************************************************************************
88 (1 line!)
89 ___
90 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
91 ___
92
93
94 4) Install apache, PHP5 and phpmyadmin
95 *******************************************************************************
96 (1 line!)
97 ___
98 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
99 ___
100
101 Then run the following to enable the Apache modules:
102 ___
103 a2enmod suexec
104 a2enmod rewrite
105 a2enmod ssl
106 a2enmod include
107 a2enmod actions
108 a2enmod headers
109 ___
110
111 4.1) Optional: Install SuPHP
112 *******************************************************************************
113 ___
114 apt-get install libapache2-mod-suphp
115 vi /etc/suphp/suphp.conf
116 ___
117
118 set docroot to:
119 ###
120 docroot=/var/clients
121 ###
122
123 Change: application/x-httpd-php=php:/usr/bin/php-cgi to:
124 ###
125 x-httpd-php=php:/usr/bin/php-cgi
126 ###
127
128 4.2) Optional: Install Fast-CGI
129 *******************************************************************************
130 ___
131 apt-get install libapache2-mod-fcgid
132 ___
133
134
135 5) Install pure-ftpd and quota
136 *******************************************************************************
137 ___
138 apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool
139 echo 'yes' > /etc/pure-ftpd/conf/DontResolve
140 ___
141
142
143 6) Install mydns
144 *******************************************************************************
145 ___
146 apt-get install g++ libc6 gcc gawk make texinfo libmysqlclient15-dev
147 cd /tmp
148 wget http://heanet.dl.sourceforge.net/sourceforge/mydns-ng/mydns-1.2.8.15.tar.gz
149 tar xvfz mydns-1.2.8.15.tar.gz
150 cd mydns-1.2.8
151 ./configure
152 make
153 make install
154 ___
155
156 Now create the start / stop script for mydns:
157 ___
158 vi /etc/init.d/mydns
159 ___
160
161 and enter the following lines (between the "---"-lines):
162
163 -------------------------------------------------------------------------------
164 #! /bin/bash
165 #
166 # mydns         Start the MyDNS server
167 #
168 # Author:       Philipp Kern <phil@philkern.de>.
169 #               Based upon skeleton 1.9.4 by Miquel van Smoorenburg
170 #               <miquels@cistron.nl> and Ian Murdock <imurdock@gnu.ai.mit.edu>.
171 #
172
173 set -e
174
175 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
176 DAEMON=/usr/local/sbin/mydns
177 NAME=mydns
178 DESC="DNS server"
179
180 SCRIPTNAME=/etc/init.d/$NAME
181
182 # Gracefully exit if the package has been removed.
183 test -x $DAEMON || exit 0
184
185 case "$1" in
186   start)
187         echo -n "Starting $DESC: $NAME"
188         start-stop-daemon --start --quiet \
189                 --exec $DAEMON -- -b
190         echo "."
191         ;;
192   stop)
193         echo -n "Stopping $DESC: $NAME"
194         start-stop-daemon --stop --oknodo --quiet \
195                 --exec $DAEMON
196         echo "."
197         ;;
198   reload|force-reload)
199         echo -n "Reloading $DESC configuration ..."
200         start-stop-daemon --stop --signal HUP --quiet \
201                 --exec $DAEMON
202         echo "done."
203         ;;
204   restart)
205         echo -n "Restarting $DESC: $NAME"
206         start-stop-daemon --stop --quiet --oknodo \
207                 --exec $DAEMON
208         sleep 1
209         start-stop-daemon --start --quiet \
210                 --exec $DAEMON -- -b
211         echo "."
212         ;;
213   *)
214         echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
215         exit 1
216         ;;
217 esac
218
219 exit 0
220 -------------------------------------------------------------------------------
221
222 now execute:
223 ___
224 chmod +x /etc/init.d/mydns
225 update-rc.d mydns defaults
226 ___
227
228
229 7) Install vlogger, webalizer and firewall
230 *******************************************************************************
231 ___
232 apt-get install vlogger webalizer bastille
233 ___
234
235 7.1) OPTIONAL: Installing Jailkit
236 *******************************************************************************
237 ___
238 apt-get install build-essential autoconf automake1.9 libtool flex bison
239 cd /tmp
240 wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz
241 tar xvfz jailkit-2.5.tar.gz
242 cd jailkit-2.5
243 ./configure
244 make
245 make install
246 ___
247
248
249 8) Install ISPConfig 3
250 *******************************************************************************
251 There are two possile scenarios a) or b), but not both:
252
253 a) Installation of beta 3
254 ___
255 cd /tmp
2ce158 256 wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz
T 257 tar xvfz ISPConfig_3.0.0.9-rc2.tar.gz
3d130f 258 cd ispconfig3_install/install/
T 259 ___
260
261 b) Installation from SVN
262 ___
263 apt-get install subversion
264 cd /tmp
265 svn export svn://svn.ispconfig.org/ispconfig3/trunk/
266 cd trunk/install
267 ___
268
269 after a) or b)
270
271 proceed with the ISPConfig installation. Now start the installation process by executing:
272 ___
273 php -q install.php
274 ___
275
276 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!):
277
278 http://server1.mydomain.tld:8080/
279
280 the default login is:
281
282 user: admin
283 password: admin
284
285 In case you get a permission denied error from apache, please restart the apache webserver process.
286
287
288 8) Further Configuration-Tips
289 *******************************************************************************
290 8.1) Apache
291 *******************************************************************************
292 edit /etc/apache2/sites-available/default
293 change the first lines to match your system.
294
295 Replace 0.0.0.0 with your IP.
296 Change Document root to /var/www/apache2-default/
297 This directory is now the standard-hompage for your Server.
298 ###
299 NameVirtualHost 0.0.0.0:80
300
301 <VirtualHost 0.0.0.0:80>
302     ServerAdmin webmaster@localhost
303
304     DocumentRoot /var/www/apache2-default/
305
306 ###
307
308 8.2) Postfix - Aliases
309 *******************************************************************************
310 change /etc/aliases
311 ###
312 # See man 5 aliases for format
313 postmaster:    root
314 clamav: root
315
316 root: webmaster@yourdomain.tld
317 ###
318
319 Then run:
320 ___
321 newaliases
322 ___
323
324 8.3) Php.ini
325 *******************************************************************************
326 I changed the following in the php.ini-Files in the following directorys:
327 /etc/php5/apache2/
328 /etc/php5/cgi/
329 /etc/php5/cli/
330
331 It is important to search the following parameters in the php.ini and replace them!!!
332 Don't just copy the whole stuff to the end of the file.
333
334 ###
335 memory_limit = 64M      ; Maximum amount of memory a script may consume (16MB)
336
337 display_errors = Off
338
339 log_errors = On
340
341 upload_max_filesize = 32M
342
343 allow_url_fopen = On
344 allow_url_include = On
345
346 date.timezone = Europe/Berlin
347
348 extension = imap.so
349 extension = mcrypt.so
350
351 ;Typo3 fast-cgi PHP5 bug fix
352 cgi.fix_pathinfo = 0
353
354 ###
355
356 add to the end of the file:
357 ###
358 [htscanner]
359 Extension = "htscanner.so"
360 config_file = ".htaccess"
361 default_docroot = "/var/www"
362 ###
363
364
365 9) Additional Software
366 *******************************************************************************
367 9.1) NTP, Denyhosts
368 *******************************************************************************
369 __
370 apt-get install ntp denyhosts
371 __
372
373 in /etc/ntp.conf replace the server-line with:
374 ###
375 server 0.pool.ntp.org
376 server 1.pool.ntp.org
377 server 2.pool.ntp.org
378 ###
379
380 9.2) Typo3 - typo3.org
381 *******************************************************************************
382 ___
383 apt-get install imagemagick php5-gd php5-imagick gs gs-esp
384 ___
385
386 There is a bug in the php5-library under Ubuntu 8.04. You can fix it by changing "cgi.fix_pathinfo = 0" in the php.ini. Look at 8.4).
387
388 10.2) Horde (Webmail) - horde.org
389 *******************************************************************************
390 First of all, install the horde3 and Imp4 packages (Ubuntu/Debian)
391 ___
392 apt-get install horde3 imp4 gollem kronolith2 mnemo2 nag2 turba2
393 pear install --onlyreqdeps Log Mail Mail_Mime MDB2 File Date
394 ___
395
396 It is then necessary to setup an Alias for Apache. 
397 If you want horde only on single pages, that are created with ispc3:
398 Add the following line to ISPConfig->Sites->Web Domain->Options->Apache directives
399 If you want to access webmail on all pages add the following line to /etc/apache2/apache2.conf
400 ###
401 Alias /horde3 /usr/share/horde3
402 ###
403
404 Allow Apache to write horde configuration files :
405 ___
406 chown -R www-data:www-data /etc/horde
407 ___
408
409 Important parameters to change are (in Horde setup) :
410 ###
411 Horde URL (change it to /horde3)
412 Enable Database Access. Do Not use MySQL Improved (4+), my attempts at using it failed. MySQL Standard runs fine however
413 Enable Authentication. I recommend IMAP authentication (something like {localhost:143/imap/notls}. Do not forget the /notls, not specifying failed on my setup). Also make sure to add your username to the list of Administrators, otherwise, you won’t have access to horde/imp4 parameters. Using anything else than IMAP seeemed to fail on my setup
414 Generate the configuration
415 Horde should now be setup. You now have to configure imp4
416 generate a configuration using the horde administration panel
417 modify the /etc/horde/imp4/servers.php file. Instruction are given inside the file concerning the syntax. If you run Courier-IMAP, and want Imp to automatically authenticate using horde credentials :
418 $servers[’imap’] = array(
419 ‘name’ => ‘IMAP Server’,
420 ’server’ => ‘localhost’,
421 ‘hordeauth’ => true,
422 ‘protocol’ => ‘imap/notls’,
423 ‘port’ => 143,
424 ‘folders’ => ‘INBOX.’,
425 ‘namespace’ => ‘’,
426 ‘maildomain’ => ‘domain.com’,
427 ’smtphost’ => ‘localhost’,
428 ’smtpport’ => 25,
429 ‘realm’ => ‘’,
430 ‘preferred’ => ‘’,
431 ‘dotfiles’ => false,
432 ‘hierarchies’ => array()
433 );
434 ###
435
436
437 11) have fun and drink a cup of coffee
438 *******************************************************************************
439 :-)