Este tutorial existe para estas versiones de SO
- Ubuntu 18.04 (castor biónico)
- Ubuntu 16.04 (Xenial Xerus)
- Ubuntu 15.10 (Hombre lobo astuto)
- Ubuntu 15.04 (verde vivo)
- Ubuntu 14.10 (Unicornio utópico)
- Ubuntu 14.04 LTS (Trusty Tahr)
En esta página
- Manual de ISPConfig 3
Este tutorial muestra cómo preparar un servidor Ubuntu 14.10 (Utopic Unicorn) (con nginx, BIND, Dovecot) para la instalación de ISPConfig 3 y cómo instalar ISPConfig 3. ISPConfig 3 es un panel de control de alojamiento web que le permite configurar lo siguiente servicios a través de un navegador web:servidor web Apache o nginx, servidor de correo Postfix, servidor Courier o Dovecot IMAP/POP3, servidor de nombres MySQL, BIND o MyDNS, PureFTPd, SpamAssassin, ClamAV y muchos más. Esta configuración cubre nginx (en lugar de Apache), BIND (en lugar de MyDNS) y Dovecot (en lugar de Courier).
Manual de ISPConfig 3
Para aprender a usar ISPConfig 3, recomiendo descargar el Manual de ISPConfig 3.
En más de 300 páginas, cubre el concepto detrás de ISPConfig (administrador, revendedores, clientes), explica cómo instalar y actualizar ISPConfig 3, incluye una referencia para todos los formularios y campos de formulario en ISPConfig junto con ejemplos de entradas válidas y proporciona tutoriales para las tareas más comunes en ISPConfig 3. También explica cómo hacer que su servidor sea más seguro y viene con una sección de solución de problemas al final.
1. Nota Preliminar
En este tutorial utilizo el nombre de host server1.example.com con la dirección IP 192.168.0.100 y la puerta de enlace 192.168.0.1. Estas configuraciones pueden diferir para usted, por lo que debe reemplazarlas cuando corresponda. Antes de continuar, debe tener una instalación mínima básica de Ubuntu 14.10 como se explica en el tutorial.
2. Edite /etc/apt/sources.list y actualice su instalación de Linux
Edite /etc/apt/sources.list. Comente o elimine el CD de instalación del archivo y asegúrese de que los repositorios Universe y Multiverse estén habilitados. Debería verse así:
nano /etc/apt/sources.list
# # deb cdrom:[Ubuntu-Server 14.10 _Utopic Unicorn_ - Release amd64 (20141022.2)]/ utopic main restricted #deb cdrom:[Ubuntu-Server 14.10 _Utopic Unicorn_ - Release amd64 (20141022.2)]/ utopic main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://de.archive.ubuntu.com/ubuntu/ utopic main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ utopic main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://de.archive.ubuntu.com/ubuntu/ utopic-updates main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://de.archive.ubuntu.com/ubuntu/ utopic universe deb-src http://de.archive.ubuntu.com/ubuntu/ utopic universe deb http://de.archive.ubuntu.com/ubuntu/ utopic-updates universe deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://de.archive.ubuntu.com/ubuntu/ utopic multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ utopic multiverse deb http://de.archive.ubuntu.com/ubuntu/ utopic-updates multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://de.archive.ubuntu.com/ubuntu/ utopic-backports main restricted universe multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu utopic-security main restricted deb-src http://security.ubuntu.com/ubuntu utopic-security main restricted deb http://security.ubuntu.com/ubuntu utopic-security universe deb-src http://security.ubuntu.com/ubuntu utopic-security universe deb http://security.ubuntu.com/ubuntu utopic-security multiverse deb-src http://security.ubuntu.com/ubuntu utopic-security multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu utopic partner # deb-src http://archive.canonical.com/ubuntu utopic partner ## Uncomment the following two lines to add software from Ubuntu's ## 'extras' repository. ## This software is not part of Ubuntu, but is offered by third-party ## developers who want to ship their latest software. # deb http://extras.ubuntu.com/ubuntu utopic main # deb-src http://extras.ubuntu.com/ubuntu utopic main ~
Entonces corre
apt-get update
para actualizar la base de datos de paquetes apt y
apt-get upgrade
para instalar las últimas actualizaciones (si las hay). Si ve que se instala un nuevo kernel como parte de las actualizaciones, debe reiniciar el sistema después:
reboot
3. Cambiar el caparazón predeterminado
/bin/sh es un enlace simbólico a /bin/dash, sin embargo, necesitamos /bin/bash, no /bin/dash. Por lo tanto hacemos esto:
dpkg-reconfigure dash
¿Usar guión como shell del sistema predeterminado (/bin/sh)? <-- No
Si no hace esto, la instalación de ISPConfig fallará.
4. Deshabilitar AppArmor
AppArmor es una extensión de seguridad (similar a SELinux) que debería proporcionar seguridad extendida. No se instala por defecto a partir de la 13.10. Verificaremos si está instalado. En mi opinión, no lo necesitas para configurar un sistema seguro, y suele causar más problemas que ventajas (piensa en ello después de haber realizado una semana de resolución de problemas porque algún servicio no estaba funcionando como se esperaba, y luego descubra que todo estaba bien, solo AppArmor estaba causando el problema). Por lo tanto, lo deshabilito (esto es obligatorio si desea instalar ISPConfig más adelante).
Podemos desactivarlo así:
service apparmor stop
update-rc.d -f apparmor remove
apt-get remove apparmor apparmor-utils
5. Sincronizar el reloj del sistema
Es una buena idea sincronizar el reloj del sistema con un NTP (n red t tiempo p rotocol) servidor a través de Internet. Simplemente ejecuta
apt-get install ntp ntpdate
y la hora de su sistema siempre estará sincronizada.
6. Instale Postfix, Dovecot, MySQL, phpMyAdmin, rkhunter, binutils
Podemos instalar Postfix, Dovecot, MySQL, rkhunter y binutils con un solo comando:
apt-get install postfix postfix-mysql postfix-doc mariadb-client mariadb-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve sudo
Se le harán las siguientes preguntas:
Nueva contraseña para el usuario "root" de MySQL:<-- yourrootsqlpassword
Repetir la contraseña para el usuario "root" de MySQL:<-- yourrootsqlpassword
¿Crear un certificado SSL autofirmado?:<-- Sí
Nombre de host:<-- server1.example.com
Solo local:<-- OK
Tipo general de configuración de correo:<-- Sitio de Internet
Nombre de correo del sistema:<- - servidor1.ejemplo.com
A continuación, abra TLS/SSL y los puertos de envío en Postfix:
nano /etc/postfix/master.cf
Descomente las secciones de envío y smtps de la siguiente manera:agregue la línea -o smtpd_client_restrictions=permit_sasl_authenticated, rechace ambas secciones y deje todo lo comentado a partir de entonces:
[...] submission inet n - - - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o smtpd_reject_unlisted_recipient=no # -o smtpd_client_restrictions=$mua_client_restrictions # -o smtpd_helo_restrictions=$mua_helo_restrictions # -o smtpd_sender_restrictions=$mua_sender_restrictions # -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING smtps inet n - - - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o smtpd_reject_unlisted_recipient=no # -o smtpd_client_restrictions=$mua_client_restrictions # -o smtpd_helo_restrictions=$mua_helo_restrictions # -o smtpd_sender_restrictions=$mua_sender_restrictions # -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING [...]
Reinicie Postfix después:
service postfix restart
Queremos que MySQL escuche en todas las interfaces, no solo en localhost, por lo tanto, editamos /etc/mysql/my.cnf y comentamos la línea bind-address =127.0.0.1:
nano /etc/mysql/my.cnf
[...] # 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 [...]
Luego reiniciamos MySQL:
service mysql restart
Ahora verifique que la red esté habilitada. Ejecutar
netstat -tap | grep mysql
La salida debería verse así:
[email protected]:~# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 23785/mysqld
[email protected]:~#
7. Instale Amavisd-new, SpamAssassin y Clamav
Para instalar amavisd-new, SpamAssassin y ClamAV, ejecutamos
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
La configuración de ISPConfig 3 usa amavisd que carga la biblioteca de filtros de SpamAssassin internamente, por lo que podemos detener SpamAssassin para liberar algo de RAM:
service spamassassin stop
update-rc.d -f spamassassin remove
Para ejecutar el uso de clamav
freshclam
service clamav-daemon start