Marius Cramer
2013-10-14 d9bcf68e395d6156645a7974b1a992aa6e6c00aa
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 #
abec04 172 ### BEGIN INIT INFO
T 173 # Provides:          MyDNS
174 # Required-Start:    $syslog
175 # Should-Start:
176 # Required-Stop:
177 # Should-Stop:
178 # Default-Start:     2 3 4 5
179 # Default-Stop:      0 1 6
180 # Short-Description: MyDNS Server
181 # Description:       MyDNS DNS Server
182 ### END INIT INFO
3d130f 183
T 184 set -e
185
186 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
187 DAEMON=/usr/local/sbin/mydns
188 NAME=mydns
189 DESC="DNS server"
190
191 SCRIPTNAME=/etc/init.d/$NAME
192
193 # Gracefully exit if the package has been removed.
194 test -x $DAEMON || exit 0
195
196 case "$1" in
197   start)
198         echo -n "Starting $DESC: $NAME"
199         start-stop-daemon --start --quiet \
200                 --exec $DAEMON -- -b
201         echo "."
202         ;;
203   stop)
204         echo -n "Stopping $DESC: $NAME"
205         start-stop-daemon --stop --oknodo --quiet \
206                 --exec $DAEMON
207         echo "."
208         ;;
209   reload|force-reload)
210         echo -n "Reloading $DESC configuration ..."
211         start-stop-daemon --stop --signal HUP --quiet \
212                 --exec $DAEMON
213         echo "done."
214         ;;
215   restart)
216         echo -n "Restarting $DESC: $NAME"
217         start-stop-daemon --stop --quiet --oknodo \
218                 --exec $DAEMON
219         sleep 1
220         start-stop-daemon --start --quiet \
221                 --exec $DAEMON -- -b
222         echo "."
223         ;;
224   *)
225         echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
226         exit 1
227         ;;
228 esac
229
230 exit 0
231 -------------------------------------------------------------------------------
232
233 now execute:
234 ___
235 chmod +x /etc/init.d/mydns
236 update-rc.d mydns defaults
237 ___
238
239
240 7) Install vlogger, webalizer and firewall
241 *******************************************************************************
242 ___
6eb625 243 apt-get install vlogger webalizer bastille awstats geoip-bin
3d130f 244 ___
T 245
246 7.1) OPTIONAL: Installing Jailkit
247 *******************************************************************************
248 ___
249 apt-get install build-essential autoconf automake1.9 libtool flex bison
250 cd /tmp
251 wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz
252 tar xvfz jailkit-2.5.tar.gz
253 cd jailkit-2.5
254 ./configure
255 make
256 make install
257 ___
258
259
260 8) Install ISPConfig 3
261 *******************************************************************************
262 There are two possile scenarios a) or b), but not both:
263
264 a) Installation of beta 3
265 ___
266 cd /tmp
2ce158 267 wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz
T 268 tar xvfz ISPConfig_3.0.0.9-rc2.tar.gz
3d130f 269 cd ispconfig3_install/install/
T 270 ___
271
272 b) Installation from SVN
273 ___
274 apt-get install subversion
275 cd /tmp
276 svn export svn://svn.ispconfig.org/ispconfig3/trunk/
277 cd trunk/install
278 ___
279
280 after a) or b)
281
282 proceed with the ISPConfig installation. Now start the installation process by executing:
283 ___
284 php -q install.php
285 ___
286
6aac1a 287 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 necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!):
3d130f 288
T 289 http://server1.mydomain.tld:8080/
290
291 the default login is:
292
293 user: admin
294 password: admin
295
296 In case you get a permission denied error from apache, please restart the apache webserver process.
297
298
299 8) Further Configuration-Tips
300 *******************************************************************************
301 8.1) Apache
302 *******************************************************************************
303 edit /etc/apache2/sites-available/default
304 change the first lines to match your system.
305
306 Replace 0.0.0.0 with your IP.
307 Change Document root to /var/www/apache2-default/
308 This directory is now the standard-hompage for your Server.
309 ###
310 NameVirtualHost 0.0.0.0:80
311
312 <VirtualHost 0.0.0.0:80>
313     ServerAdmin webmaster@localhost
314
315     DocumentRoot /var/www/apache2-default/
316
317 ###
318
319 8.2) Postfix - Aliases
320 *******************************************************************************
321 change /etc/aliases
322 ###
323 # See man 5 aliases for format
324 postmaster:    root
325 clamav: root
326
327 root: webmaster@yourdomain.tld
328 ###
329
330 Then run:
331 ___
332 newaliases
333 ___
334
335 8.3) Php.ini
336 *******************************************************************************
337 I changed the following in the php.ini-Files in the following directorys:
338 /etc/php5/apache2/
339 /etc/php5/cgi/
340 /etc/php5/cli/
341
342 It is important to search the following parameters in the php.ini and replace them!!!
343 Don't just copy the whole stuff to the end of the file.
344
345 ###
346 memory_limit = 64M      ; Maximum amount of memory a script may consume (16MB)
347
348 display_errors = Off
349
350 log_errors = On
351
352 upload_max_filesize = 32M
353
354 allow_url_fopen = On
355 allow_url_include = On
356
357 date.timezone = Europe/Berlin
358
359 extension = imap.so
360 extension = mcrypt.so
361
362 ;Typo3 fast-cgi PHP5 bug fix
363 cgi.fix_pathinfo = 0
364
365 ###
366
367 add to the end of the file:
368 ###
369 [htscanner]
370 Extension = "htscanner.so"
371 config_file = ".htaccess"
372 default_docroot = "/var/www"
373 ###
374
375
376 9) Additional Software
377 *******************************************************************************
378 9.1) NTP, Denyhosts
379 *******************************************************************************
380 __
381 apt-get install ntp denyhosts
382 __
383
384 in /etc/ntp.conf replace the server-line with:
385 ###
386 server 0.pool.ntp.org
387 server 1.pool.ntp.org
388 server 2.pool.ntp.org
389 ###
390
391 9.2) Typo3 - typo3.org
392 *******************************************************************************
393 ___
394 apt-get install imagemagick php5-gd php5-imagick gs gs-esp
395 ___
396
397 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).
398
399 10.2) Horde (Webmail) - horde.org
400 *******************************************************************************
401 First of all, install the horde3 and Imp4 packages (Ubuntu/Debian)
402 ___
403 apt-get install horde3 imp4 gollem kronolith2 mnemo2 nag2 turba2
404 pear install --onlyreqdeps Log Mail Mail_Mime MDB2 File Date
405 ___
406
407 It is then necessary to setup an Alias for Apache. 
408 If you want horde only on single pages, that are created with ispc3:
409 Add the following line to ISPConfig->Sites->Web Domain->Options->Apache directives
410 If you want to access webmail on all pages add the following line to /etc/apache2/apache2.conf
411 ###
412 Alias /horde3 /usr/share/horde3
413 ###
414
415 Allow Apache to write horde configuration files :
416 ___
417 chown -R www-data:www-data /etc/horde
418 ___
419
420 Important parameters to change are (in Horde setup) :
421 ###
422 Horde URL (change it to /horde3)
423 Enable Database Access. Do Not use MySQL Improved (4+), my attempts at using it failed. MySQL Standard runs fine however
424 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
425 Generate the configuration
426 Horde should now be setup. You now have to configure imp4
427 generate a configuration using the horde administration panel
428 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 :
429 $servers[’imap’] = array(
430 ‘name’ => ‘IMAP Server’,
431 ’server’ => ‘localhost’,
432 ‘hordeauth’ => true,
433 ‘protocol’ => ‘imap/notls’,
434 ‘port’ => 143,
435 ‘folders’ => ‘INBOX.’,
436 ‘namespace’ => ‘’,
437 ‘maildomain’ => ‘domain.com’,
438 ’smtphost’ => ‘localhost’,
439 ’smtpport’ => 25,
440 ‘realm’ => ‘’,
441 ‘preferred’ => ‘’,
442 ‘dotfiles’ => false,
443 ‘hierarchies’ => array()
444 );
445 ###
446
447
448 11) have fun and drink a cup of coffee
449 *******************************************************************************
450 :-)