Author: F4RR3LL|Sven
E-Mail: sven.richter@nixhelp.de
Stand: 29.11.2009
Diese Installation wurde auf Debian LENNY getestet
Dokumentation: Fleissige Mitschreiber gesucht: http://ispc-wiki.org/
Auf gehts, wir installieren den Indianer mit ein paar Modulen:
aptitude install openbsd-inetd apache2 apache2.2-common apache2-doc apache2-mpm-prefork \ apache2-utils libexpat1 ssl-cert apache2-suexec libapache2-mod-php5 php5 \ php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi \ php5-mcrypt mcrypt libapache2-mod-fcgid php-pear php-auth php5-imagick \ imagemagick libapache2-mod-suphp mysql-server mysql-client libmysqlclient15-dev
a2enmod suexec rewrite ssl actions include
rm -rf /etc/phpmyadmin/htpasswd.setup
nano /etc/phpmyadmin/apache.conf
# # Authorize for setup # <Files setup.php> # # For Apache 1.3 and 2.0 # <IfModule mod_auth.c> # AuthType Basic # AuthName "phpMyAdmin Setup" # AuthUserFile /etc/phpmyadmin/htpasswd.setup # </IfModule> # # For Apache 2.2 # <IfModule mod_authn_file.c> # AuthType Basic # AuthName "phpMyAdmin Setup" # AuthUserFile /etc/phpmyadmin/htpasswd.setup # </IfModule> # Require valid-user # </Files>
nano /etc/mime.types
#application/x-ruby rb
Soo nun ists zeit für nen Apache neustart:
/etc/init.d/apache2 restart
Symlink für phpmyadmin
ln -s /usr/share/phpmyadmin /var/www/phpmyadmin
Wer Proxmox/Openvz benutzt findet hier noch die zu setzenden Capabilities die im Host zu setzen sind.
Sonst startet der FTP ned.→ Pureftpd CAPABILITYs
aptitude install pure-ftpd-common pure-ftpd-mysql
nano /etc/default/pure-ftpd-common
STANDALONE_OR_INETD=standalone VIRTUALCHROOT=true
cd /etc/pure-ftpd/conf echo 1 > TLS mkdir -p /etc/ssl/private/ openssl req -x509 -nodes -newkey rsa:1024 -keyout \ /etc/ssl/private/pure-ftpd.pem \ -out /etc/ssl/private/pure-ftpd.pem chmod 600 /etc/ssl/private/*.pemEs bietet sich noch an die Passive Portrange des FTP auch gleich mit anzugeben.
cd /etc/pure-ftpd/conf echo 4000 4020 > PassivePortRangeNun öffne die Datei:
nano /etc/inetd.confhier folgende Zeile auskommentieren:
#ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/pure-ftpd-wrappernun initd und den ftp neu starten
/etc/init.d/openbsd-inetd restart /etc/init.d/pure-ftpd-mysql start
aptitude install quota quotatoolHier nun die /etc/fstab anpassen:
nano /etc/fstabeinfach bei der betreffenden Passage usrquota,grpquota mit anfügen.
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/sda1 / ext3 errors=remount-ro,usrquota,grpquota 0 1 /dev/sda2 /tmp ext3 defaults,noexec 0 2 /dev/sda3 none swap sw 0 0
Zuerstmal die Abhängigkeiten
aptitude install g++ libc6 gcc gawk make texinfo libmysqlclient15-dev
cd /usr/src/ wget http://heanet.dl.sourceforge.net/sourceforge/mydns-ng/mydns-1.2.8.27.tar.gz tar xvfz mydns-1.2.8.27.tar.gz cd mydns-1.2.8 ./configure make make installNun noch ein Script erstellen mit dem man mydns starten und stoppen kann
cat > /etc/init.d/mydns << "EOF"
#!/bin/sh
#
# mydns Start the MyDNS server
#
# Author: Philipp Kern <phil@philkern.de>.
# Based upon skeleton 1.9.4 by Miquel van Smoorenburg
# <miquels@cistron.nl> and Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/mydns
NAME=mydns
DESC="DNS server"
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
start-stop-daemon --start --quiet --exec $DAEMON -- -b
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
echo "."
;;
reload|force-reload)
echo -n "Reloading $DESC configuration..."
start-stop-daemon --stop --signal HUP --quiet --exec $DAEMON
echo "done."
;;
restart)
echo -n "Restarting $DESC: $NAME"
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --exec $DAEMON -- -b
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
EOF
Nun noch das Script ausführbar machen und die *Autostart Links* erstellen und natürlich auch starten von myDNS:chmod +x /etc/init.d/mydns update-rc.d mydns defaults
Hier mal ne leichte Passage zum Erholen →
aptitude install fail2ban vlogger webalizer build-essential autoconf automake1.9 libtool flex bison
cd /usr/src/ wget http://olivier.sessink.nl/jailkit/jailkit-2.8.tar.gz tar xvfz jailkit-2.8.tar.gz cd jailkit-2.8 ./configure make make install
aptitude install postfix postfix-mysql libsasl2-2 sasl2-bin libsasl2-modules-sql libsasl2-modules procmail \ courier-authdaemon courier-base courier-imap courier-imap-ssl courier-pop \ courier-pop-ssl courier-ssl courier-maildrop gamin libgamin0 libglib2.0-0 amavisd-new \ spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch \ 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 getmail4
cd /etc/courier rm -f /etc/courier/imapd.pem rm -f /etc/courier/pop3d.pemöffne folgende Datei:
nano /etc/courier/imapd.cnfhier die Zeile CN=localhost in CN=deine.domain.tld ändern
nano /etc/courier/pop3d.cnfhier ebenfalls die Zeile CN=localhost in CN=deine.domain.tld ändern
mkimapdcert mkpop3dcertDie Dienste müssen nun noch neu gestartet werden und das wars denn schon →
/etc/init.d/courier-imap-ssl restart /etc/init.d/courier-pop-ssl restart
aptitude install squirrelmail ln -s /usr/share/squirrelmail/ /var/www/webmailAnschließend muss man noch den Squirrel einrichten:
squirrelmail-configure
D drücken
courier reinschreiben
bestätigen mit anyeinem key ;)
speichern mit S
und schließen mit Q
! Vorsicht Roundcube ist bissl tricky ;) !!!
cd /usr/src/ wget wget http://downloads.sourceforge.net/roundcubemail/roundcubemail-0.3-stable.tar.gz?use_mirror=freefr tar xvzf roundcubemail-0.3-stable.tar.gz -C /var/www/ mv /var/www/roundcubemail-0.3-stable/ /var/www/webmail/ chmod 777 /var/www/webmail/temp/ chmod 777 /var/www/webmail/logs/
Die Configs die bei der Installation erstellt werden müssen bei Schritt 2 nach
nano /var/www/webmail/config/main.inc.phpund
nano /var/www/webmail/config/db.inc.phpkopiert werden.
rm -rf /var/www/webmail/installer/
Schau am besten vor der Installation nach das Du auch die neuste Version benutzt http://www.ispconfig.org/
Derzeit ist Version 3.0.1.6 aktuell und dient als Grundlage für die Installation:
cd /usr/src/ wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz tar xvfz ISPConfig-3-stable.tar.gz cd ispconfig3_install/install/ php -q install.php
php -q install.php
--------------------------------------------------------------------------------
_____ ___________ _____ __ _
|_ _/ ___| ___ \ / __ \ / _(_)
| | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` |
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| |
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, |
__/ |
|___/
--------------------------------------------------------------------------------
>> Initial configuration
Operating System: Debian Lenny/Sid or compatible
Following will be a few questions for primary configuration so be careful.
Default values are in [brackets] and can be accepted with <ENTER>.
Tap in ”quit” (without the quotes) to stop the installer.
Select language (en,de) [en]: **de**
Installation mode (standard,expert) [standard]: **ENTER**
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.example.com]: **ENTER**
MySQL server hostname [localhost]: **ENTER**
MySQL root username [root]: **ENTER**
MySQL root password []: **deinsupergeheimesrootpasswortfürmysql**
MySQL database to create [dbispconfig]: **ENTER**
MySQL charset [utf8]: **ENTER**
Generating a 2048 bit RSA private key
……………………………………………………………………………………………………+++
……………………………………………………………………………………………+++
writing new private key to ’smtpd.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ’.', the field will be left blank.
—–
Country Name (2 letter code) [AU]: **ENTER**
State or Province Name (full name) [Some-State]: **ENTER**
Locality Name (eg, city) []: **ENTER**
Organization Name (eg, company) [Internet Widgits Pty Ltd]: **ENTER**
Organizational Unit Name (eg, section) []: **ENTER**
Common Name (eg, YOUR name) []: **ENTER**
Email Address []: **ENTER**
Configuring Jailkit
Configuring SASL
Configuring PAM
Configuring Courier
Configuring Spamassassin
Configuring Amavisd
Configuring Getmail
Configuring Pureftpd
Configuring MyDNS
Configuring Apache
Configuring Firewall
Installing ISPConfig
ISPConfig Port [8080]: **ENTER**
Configuring DBServer
Installing Crontab
no crontab for root
no crontab for getmail
Restarting services …
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
Stopping Postfix Mail Transport Agent: postfix.
Starting Postfix Mail Transport Agent: postfix.
Stopping SASL Authentication Daemon: saslauthd.
Starting SASL Authentication Daemon: saslauthd.
Stopping amavisd: amavisd-new.
Starting amavisd: amavisd-new.
Stopping ClamAV daemon: clamd.
Starting ClamAV daemon: clamd .
Stopping Courier authentication services: authdaemond.
Starting Courier authentication services: authdaemond.
Stopping Courier IMAP server: imapd.
Starting Courier IMAP server: imapd.
Stopping Courier IMAP-SSL server: imapd-ssl.
Starting Courier IMAP-SSL server: imapd-ssl.
Stopping Courier POP3 server: pop3d.
Starting Courier POP3 server: pop3d.
Stopping Courier POP3-SSL server: pop3d-ssl.
Starting Courier POP3-SSL server: pop3d-ssl.
Restarting web server: apache2 … waiting .
Restarting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot
-l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -E -A -u 1000 -O clf:/var/log/pure-ftpd/transfer.log -b -B
Installation completed.
Für diese Passage bedanke ich mich bei Alexander Fox der diese Anleitung als gesondertes Howto auf howtoforge.de veröffentlicht hat. Da ich der Meinung bin das dies wichtiger Bestandteil der Hauptinstallation ist habe ich es hier direkt integriert.
mkdir /etc/apache2/ssl cd /etc/apache2/sslZertifikate erstellen:
openssl genrsa -des3 -out ispserver.key 4096 openssl req -new -key ispserver.key -out ispserver.csr openssl x509 -req -days 3650 -in ispserver.csr -signkey ispserver.key -out ispserver.crt openssl rsa -in ispserver.key -out ispserver.key.insecure mv ispserver.key ispserver.key.secure mv ispserver.key.insecure ispserver.keyDas Apache ssl Modul aktivieren falls es noch inaktiv ist:
a2enmod sslDen vhost von ISPCONFIG anpassen
nano /etc/apache2/sites-available/ispconfig.vhostfüge die folgenden Zeilen innerhalb von “<VirtualHost ….></VirtualHost>” hinzu
SSLEngine On SSLCertificateFile /etc/apache2/ssl/ispserver.crt SSLCertificateKeyFile /etc/apache2/ssl/ispserver.key SSLProtocol All -SSLv2 SSLCipherSuite ALL:!EXP:!NULL:!ADH:!LOW SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdownWebmail und Phpmyadmin ebenfalls auf https switchen:
nano /etc/apache2/sites-enabled/000-defaultfügt hier folgendes hinzu wieder wie oben zwischen “<VirtualHost ….></VirtualHost>”
<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /phpmyadmin>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}:8080/phpmyadmin [R]
</Location>
</IfModule>
</IfModule>
<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /webmail>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}:8080/webmail [R]
</Location>
</IfModule>
</IfModule>
Neustarten des Apache
/etc/init.d/apache2 restart
Das wars, viel Spaß mit ISPConfig 3
Gruß Sven
Es kann bei Debian Lenny zu diesem Fehler kommen:
php -q install.php
--------------------------------------------------------------------------------
_____ ___________ _____ __ _
|_ _/ ___| ___ \ / __ \ / _(_)
| | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` |
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| |
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, |
__/ |
|___/
--------------------------------------------------------------------------------
>> Initial configuration
Notice: Undefined variable: distver in /usr/src/ispconfig3_install/install/lib/install.lib.php on line 135
Notice: Undefined variable: distid in /usr/src/ispconfig3_install/install/lib/install.lib.php on line 135
Notice: Undefined variable: distbaseid in /usr/src/ispconfig3_install/install/lib/install.lib.php on line 135
if(trim(file_get_contents('/etc/debian_version')) == '5.0' || trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
$distname = 'Debian';
$distver = 'Lenny/Sid';
$distid = 'debian40';
$distbaseid = 'debian';
swriteln("Operating System: Debian Lenny/Sid or compatible\n");
}
PureFTPD greift auf gewisse Schnittstellen zurück die der Virtuellen Maschine nicht vom Standard aus gegeben sind.
Hierzu muss im Host die Config der VM bearbeitet bzw. ergänzt werden.
Die Configs liegen unter /etc/vz/conf !
CAPABILITY=”CHOWN:on DAC_READ_SEARCH:on SETGID:on SETUID:on NET_BIND_SERVICE:on NET_ADMIN:on SYS_CHROOT:on SYS_NICE:on “
Zurück zum Index