Beruflich Dokumente
Kultur Dokumente
Podemos instalar Postfix, Courier, saslauthd, MySQL, phpMyAdmin, rkhunter, y binutils con un solo comando:
Nota: Unas de las grandes ventajas de linux es instalar todo los programas de una sola vez.
aptitude 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 sudo
Se le preguntara lo siguientes:
Tipo General de configuracin de correo: <-- Sitio de Internet
Sistema de nombres de correo electrnico: <-- server1.alojamiento.org
Nueva contrasea para el MySQL usuario "root": <-- Su contrasea de root para MySQL
Repita la contrasea para el MySQL usuario "root": <-- Su contrasea de root para MySQL
Crear directorios para la administracin basada en la web? <-- No
SSL requiere certificado <- Ok
Queremos MySQL para escuchar en todas las interfaces, no solo localhost, por lo que editar el archivo /etc/mysql/my.cnf y
comentar la lnea de bind-address = 127.0.0.1:
nano /etc/mysql/my.cnf
Debera de verse as
[...]
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
[...]
Entonces reinicie MySQL con el comando:
invoke-rc.d mysql restart
Ahora compruebe que la red est habilitada. Ejecutando esto
netstat -tap | grep mysql
La salida debe ser similar a esto:
root@server1:~# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 10457/mysqld
root@server1:~#
Durante la instalacin, los certificados de SSL para IMAP y POP3-SSL SSL se crean con el nombre de host localhost. Para
cambiar esto con el nombre de host correcto (server1.alojamiento.org en este tutorial), eliminar los certificados...
cd /etc/courier
rm -f /etc/courier/imapd.pem
rm -f /etc/courier/pop3d.pem
... y modificar los dos archivos siguientes, reemplace CN=localhost con CN=server1.alojamiento.org (tambin puede modificar
los valores, si es necesario):
nano /etc/courier/imapd.cnf
[...]
CN=server1.alojamiento.org
[...]
/etc/courier/pop3d.cnf
[...]
CN=server1.alojamiento.org
[...]
A continuacin, volver a crear los certificados...
mkimapdcert
mkpop3dcert
Y reinicie el Courier-IMAP-SSL y SSL-Courier-POP3:
invoke-rc.d courier-imap-ssl restart
invoke-rc.d courier-pop-ssl restart
Instalacin de Amavisd-new, SpamAssassin, y Clamav
Amavisd-new: Es una aplicacin de alto rendimiento y una interfaz segura entre cliente de correo (MTA) y una o ms fichas de contenido: escneres de virus y
/ o Mail:: SpamAssassin mdulo de Perl. Est escrito en Perl, asegurando una alta fiabilidad de portabilidad y facilidad de mantenimiento. Habla a travs de la
MTA (E) SMTP o protocolos LMTP, o mediante programas de ayuda.
SpamAssassin: Esta programa puede ser integrado con el servidor de correo para filtrar automticamente todo el correo de un sitio. Tambin puede ser
administrado por los usuarios individuales en su propio buzn y se integra con varios programas de correo. SpamAssassin es altamente configurable, si se
utiliza como filtro de todo el sistema.
Clamav: Software multi-plataforma de software antivirus tiene un juego de herramientas capaces de detectar muchos tipos de software malicioso, como virus.
Uno de sus principales usos es en los servidores de correo como un antivirus en el servidor de correo electrnico. La aplicacin fue desarrollada para Unix y
tiene versiones de terceros disponible para AIX, BSD, HP-UX, Linux, Mac OS X, OpenVMS, OSF y Solaris. Desde la versin 0.96 de ClamAV construye y se
ejecuta en Microsoft Windows. Tanto ClamAV y sus actualizaciones estn disponibles de forma gratuita.
Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, y puede ser instalado de la siguiente manera:
aptitude install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libruby libapache2-mod-ruby
Podrs ver las siguientes preguntas:
Reconfigurar automticamente Servidor Web: <- apache2
Configurar la base de datos de phpmyadmin con dbconfig-comn? <- No
A continuacin, ejecute el comando siguiente para activar el de mdulos de Apache suexec, rewrite, ssl, actions, e incluye
(tambien dav, dav_fs, y auth_digest si desea utilizar WebDAV):
a2enmod suexec rewrite ssl actions include
a2enmod dav_fs dav auth_digest
Reinicie Apache despus:
invoke-rc.d apache2 restart
Instalacin PureFTPd y Quota
PureFTPd: Es un servidor FTP libre (licencia BSD). Puede ser compilado y ejecutado en una variedad de sistemas operativos tipo Unix computadora,
incluyendo Linux, OpenBSD, NetBSD, FreeBSD, BSD, FreeBSD, Solaris, Tru64, Darwin, Irix y HP-UX
Quota: Cuota se implementa mediante el sistema BSD interfaz de llamada como el medio de comunicacin con el nivel de usuario. Esto se basa en el sistema
de cuotas de Melbourne, que utiliza tanto el usuario y los archivos de grupo de cuotas.
Jailkit slo es necesario si quieres hacer chroot a usuarios SSH. Se puede instalar de la siguiente manera (importante: Jailkit
debe estar instalado antes de ISPConfig - no se puede instalar despus!):
aptitude install build-essential autoconf automake1.9 libtool flex bison debhelper
cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.13.tar.gz
tar xvfz jailkit-2.13.tar.gz
cd jailkit-2.13
./debian/rules binary
cd ..
dpkg -i jailkit_2.13-1_*.deb
rm -rf jailkit-2.13*
Instalacin fail2ban
fail2ban: Es una aplicacin escrita en Python para la prevencin de intrusos en un sistema, que se basa en la penalizacin de conexin (bloquear conexin) a
los orgenes que intentan accesos por fuerza bruta.
filter = courierpop3s
logpath = /var/log/mail.log
maxretry = 5
[courierimap]
enabled = true
port = imap2
filter = courierimap
logpath = /var/log/mail.log
maxretry = 5
[courierimaps]
enabled = true
port = imaps
filter = courierimaps
logpath = /var/log/mail.log
maxretry = 5
[...]
A continuacin, cree los siguientes cinco archivos de filtro:
nano /etc/fail2ban/filter.d/pureftpd.conf
[...]
[Definition]
failregex = .*pure-ftpd: \(.*@\) \[WARNING\] Authentication failed for user.*
ignoreregex =
[...]
nano /etc/fail2ban/filter.d/courierpop3.conf
[...]
# Fail2Ban configuration file
#
# $Revision: 100 $
#
[Definition]
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P\S+)
# Values: TEXT
#
failregex = pop3d: LOGIN FAILED.*ip=\[.*:\]
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
[...]
nano /etc/fail2ban/filter.d/courierpop3s.conf
[...]
# Fail2Ban configuration file
#
# $Revision: 100 $
#
[Definition]
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P\S+)
# Values: TEXT
#
failregex = pop3d-ssl: LOGIN FAILED.*ip=\[.*:\]
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
[...]
nano /etc/fail2ban/filter.d/courierimap.conf
[...]
# Fail2Ban configuration file
#
# $Revision: 100 $
#
[Definition]
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P\S+)
# Values: TEXT
#
failregex = imapd: LOGIN FAILED.*ip=\[.*:\]
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
[...]
nano /etc/fail2ban/filter.d/courierimaps.conf
[...]
# Fail2Ban configuration file
#
# $Revision: 100 $
#
[Definition]
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile. The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P\S+)
# Values: TEXT
#
failregex = imapd-ssl: LOGIN FAILED.*ip=\[.*:\]
# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
[...]
Reiniciamos fail2ban despus:
invoke-rc.d fail2ban restart
Instalacin SquirrelMail
SquirrelMail: Es una aplicacin webmail escrita en PHP. Puede ser instalado en la mayora de servidores web siempre y cuando ste soporte PHP y el
servidor web tenga acceso a un servidor IMAP y a otro SMTP.
C Turn color on
S Save data
Q Quit
Command >> <-- D
SquirrelMail Configuration : Read: config.php
--------------------------------------------------------While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others. If you select your IMAP server, this option will
set some pre-defined settings for that server.
Please note that you will still need to go through and make sure
everything is correct. This does not change everything. There are
only a few settings that this will change.
Please select your IMAP server:
bincimap = Binc IMAP server
courier = Courier IMAP server
cyrus = Cyrus IMAP server
dovecot = Dovecot Secure IMAP server
exchange = Microsoft Exchange IMAP server
hmailserver = hMailServer
macosx = Mac OS X Mailserver
mercury32 = Mercury/32
uw = University of Washington's IMAP server
gmail = IMAP access to Google mail (Gmail) accounts
quit = Do not change anything
Command >> <-- courier
SquirrelMail Configuration : Read: config.php
--------------------------------------------------------While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others. If you select your IMAP server, this option will
set some pre-defined settings for that server.
Please note that you will still need to go through and make sure
everything is correct. This does not change everything. There are
only a few settings that this will change.
Please select your IMAP server:
bincimap = Binc IMAP server
courier = Courier IMAP server
cyrus = Cyrus IMAP server
dovecot = Dovecot Secure IMAP server
exchange = Microsoft Exchange IMAP server
hmailserver = hMailServer
macosx = Mac OS X Mailserver
mercury32 = Mercury/32
uw = University of Washington's IMAP server
gmail = IMAP access to Google mail (Gmail) accounts
quit = Do not change anything
Command >> courier
imap_server_type = courier
default_folder_prefix = INBOX.
trash_folder = Trash
sent_folder = Sent
draft_folder = Drafts
show_prefix_option = false
default_sub_of_inbox = false
show_contain_subfolders_option = false
optional_delimiter = .
delete_folder = true
Press any key to continue... <-- press a key
SquirrelMail Configuration : Read: config.php (1.4.0)
--------------------------------------------------------Main Menu -1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q Quit
Command >> <-- S
SquirrelMail Configuration : Read: config.php (1.4.0)
--------------------------------------------------------Main Menu -1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q Quit
Command >> <-- Q
Posteriormente se puede acceder a SquirrelMail en http://server1.alojamiento.org/webmail o http://172.16.1.2/webmail:
Instalando ISPConfig 3
Para instalar ISPConfig 3 de la ltima versin publicada, haga lo siguiente:
cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/
El siguiente paso es ejecutar:
php -q install.php
Esto iniciar el programa de instalacin de ISPConfig 3. El instalador configurara todos los servicios como Postfix, Dovecot, etc
por usted.
root@server1:/tmp/ispconfig3_install/install# php -q install.php
ISPConfig 3
>> Inicializando configuracin
Sistema operativo: Debian 6.0 (Squeeze/Sid) o compatible
Le sern realizadas unas series de preguntas para la configuracin principal as que tenga cuidado.
Los valores por defecto estn entre [corchetes] y puede ser aceptada con .
Pulse en "salir" (sin las comillas) para Parando el programa de instalacin.
Seleccione el idioma (en,de) [en]: <-- ENTER
El modo de instalacin (experto,estndar)[estndar]: <-- ENTER
Nombre completo (FQDN) del servidor, por ejemplo, server1.domain.tld [server1.alojamiento.org]: <-- ENTER
Nombre de host del servidor MySQL [localhost]: <-- ENTER
Nombre de usuario root de MySQL [root]: <-- ENTER