66
2013 Universidad Politécnica de Tulancingo ISC93 DOCUMENTACIÓN DE [ INSTALACIÓN DEL SISTEMA OPERATIVO CENTOS 6.2 E INSTALACIÓN DE ISPCONFIG3] Integrantes: González Romero Ricardo Elías San Juan San Agustín José Alberto Santuario Meneses Dora Vianey

Servidor Ispconfig

Embed Size (px)

DESCRIPTION

servidor realizado en centos6 en español

Citation preview

Page 1: Servidor Ispconfig

2013

Universidad Politécnica

de Tulancingo

ISC93

DOCUMENTACIÓN DE [INSTALACIÓN DEL SISTEMA

OPERATIVO CENTOS 6.2 E

INSTALACIÓN DE ISPCONFIG3 ] Integrantes:

González Romero Ricardo Elías

San Juan San Agustín José Alberto

Santuario Meneses Dora Vianey

Page 2: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

1

Indice Introducción ........................................................................................................................................ 2

1 Requisitos ......................................................................................................................................... 2

2 Nota preliminar ................................................................................................................................ 2

3 Instalar el sistema base ..................................................................................................................... 2

5 Configurar el Firewall .................................................................................................................... 27

6 Desactive SELinux ......................................................................................................................... 28

7 Active repositorios adicionales e instalar algunas Software ................................................. 29

8 cuotas.............................................................................................................................................. 30

9 Instalar Apache, MySQL, phpMyAdmin ....................................................................................... 31

10 Instalar Courier-IMAP, Courier-Authlib y Maildrop ................................................................... 31

11 Instalación de Postfix ............................................................................................................... 36

12 Instalar GetMail ........................................................................................................................... 36

13 Establecimiento de contraseñas de MySQL y configuración de phpMyAdmin .......................... 37

14 Instalar Amavisd nuevo, SpamAssassin y ClamAV .................................................................... 39

15 Instalación de Apache2 Con mod_php, mod_fcgi/PHP5, Y suPHP ............................................ 40

15.1 Ruby ...................................................................................................................................... 43

15.2 Python ................................................................................................................................... 44

15.3 WebDAV ............................................................................................................................... 44

16 Instalar PureFTPd ......................................................................................................................... 45

17 Instalación de BIND ..................................................................................................................... 47

18 Instalar Vlogger, Webalizer, AWStats English Y ........................................................................ 50

19 Instalar Jailkit ............................................................................................................................. 50

20 Instalar fail2ban ............................................................................................................................ 51

21 Instalar rkhunter ........................................................................................................................... 52

22 Instalación de Mailman ................................................................................................................ 52

23 Instalar SquirrelMail .................................................................................................................... 55

Instalar ISPconfig 3 ........................................................................................................................... 60

Page 3: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

2

Introducción

En este documento se muestra cómo preparar un servidor CentOS x86_64 6.2 para la

instalación de ISPConfig 3.

ISPConfig 3 es un panel de control de alojamiento web que le permite configurar los siguientes

servicios a través de un navegador web: servidor web Apache, el servidor de correo

Postfix, MySQL, servidor de nombres BIND, PureFTPd, SpamAssassin, ClamAV,

Mailman, y muchos más.

Desde la versión 3.0.4, ISPConfig viene con soporte completo para el servidor web Nginx,

además de Apache, este tutorial cubre la instalación de un servidor que utiliza Apache, no nginx.

1 Requisitos

Para instalar este sistema necesitará lo siguiente:

Descarga los dos CentOS 6.2 DVD de un espejo al lado de usted (la lista de réplicas se

puede encontrar aquí:http://isoredirect.centos.org/centos/6/isos/x86_64/ ).

una conexión rápida a Internet.

2 Nota preliminar

En esta documentación se utilizo el nombre de host server1.ricardo.com con la dirección

IP 172.16.1.7 y la puerta de enlace 172.16.7.254 . Estos ajustes pueden ser diferentes para

usted, así que hay que sustituirlos en su caso.

3 Instalar el sistema base

Arrancar desde su primera CentOS 6.2 DVD (DVD 1). Seleccione Install and Update an

existing software:

Page 4: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

3

Puede tomar mucho tiempo para poner a prueba el soporte de instalación, así que saltamos esta

prueba aquí:

Aparece la pantalla de bienvenida del instalador de CentOS. Haga clic en Siguiente :

Page 11: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

10

Marque la Conexión automática casilla y vaya a la IPv4 Settings pestaña y

seleccione Manual en el Método del menú desplegable. Introduzca una, dos, o tres servidores de

nombres (separados por comas) en el servidor DNS de campo (por

ejemplo 8.8.8.8,8.8.4.4 ), a continuación, haga clic en el Agregar botón junto a

la direcciones de área:

Page 12: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

11

Ahora dale la tarjeta de red de una dirección IP estática y máscara de red (en este tutorial estoy

usando la dirección IP 172.16.1.7 y la máscara 255.255.248.0 para fines de demostración, Si

usted no está seguro acerca de los valores adecuados, http://www.subnetmask.info podría

ayudarle). También escriba su puerta de enlace (por ejemplo, 172.16.1.7) y haga clic en

el Apply ... botón:

Page 15: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

14

Dale arraigar una contraseña:

Page 16: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

15

A continuación hacemos la partición. Seleccione Replace Linux existing system(s)Esto le

dará una pequeña/ boot partición y un gran / partición que está bien para nuestros propósitos:

Page 19: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

18

Ahora seleccionamos el programa que queremos instalar. Seleccione Basic Server , a

continuación, compruebe CentOS en el campo repositorios adicionales, seleccione Personalizar

adelante y haga clic en Next:

Page 22: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

21

Después de reiniciar, inicie una sesión como root.

Quiero instalar ISPConfig al final de este tutorial que viene con su propio firewall. Es por eso que

desactivar el cortafuegos por defecto CentOS ahora. Por supuesto, usted es libre de dejarlo

encendido y configurar a sus necesidades (pero entonces usted no debe usar ningún otro firewall

más adelante, ya que es muy probable que interfiera con el firewall CentOS).

Ejecutar ...

system-config-firewall-tui

... y desactivar el firewall. Pulse Ok después:

Page 23: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

22

Confirme su elección seleccionando Yes :

Si no ha configurado la tarjeta de red durante la instalación, puede hacerlo ahora. Ejecutar ...

system-config-red

... y vaya a Device configuration :

Page 24: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

23

Seleccione la interfaz de red:

Page 25: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

24

A continuación, rellene sus datos de red - deshabilitar DHCP y completar una dirección IP

estática, una máscara de red, puerta de enlace, y uno o dos nombres, después haga clic en OK :

A continuación, seleccione Save:

Page 26: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

25

También puede especificar servidores adicionales. Seleccione DNS configuration

Ahora usted puede llenar los servidores de nombres adicionales y pulsa Ok :

Page 27: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

26

Pulse Save&quit después:

Debe ejecutar

ifconfig

Ahora para comprobar si el instalador tiene la dirección IP correcta:

[Root @ server1 ~] # ifconfig

eth0 Link encap: Ethernet HWaddr 00:0 C: 29:1 D: 4F: 46

inet addr: 172.16.1.7 BCAST: 172.16.1.255 Máscara: 255.255.248.0

inet6 addr: fe80 :: 20c: 29ff : fe1d: 4f46/64 Alcance: Vínculo

ARRIBA DIFUSIÓN RUNNING MULTICAST MTU: 1500 Métrica: 1

RX paquetes: 144 errors: 0 Eliminado: 0 sobrecostos: 0 frame: 0

paquetes TX: 42 errores: 0 caído: 0 sobrecostos: 0 portador: 0

colisiones: 0 txqueuelen: 1000

RX bytes: 10753 (10.5 KB) TX bytes: 5087 (4.9 KiB) lo Link encap: Bucle

local inet addr: 127.0.0.1 Máscara: 255.0.0.0 inet6 ::: 1/128

Alcance: Anfitrión ARRIBA LOOPBACK RUNNING MTU: 16436 Metric:

1 RX paquetes: 32 errors: 0 Eliminado: 0 sobrecostos: 0 frame:

0 paquetes TX: 32 errores: 0 caído: 0 sobrecostos: 0 portador:

0 colisiones: 0 txqueuelen: 0 RX bytes : 2270 (2.2 KiB) TX

bytes: 2270 (2.2 KiB) [root @ server1 ~] #

Page 28: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

27

Compruebe su /etc/resolv.conf si muestra todos los servidores de nombres que ha

configurado previamente:

cat /etc/resolv.conf

Si faltan los servidores de nombres, ejecute

system-config-red

y agregue los servidores de nombres desaparecidos nuevamente.

Ahora, volviendo a la configuración ...

edite /etc/hosts . Hacer que se vea así:

vi/etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4

localhost4.localdomain4

192.168.0.100 server1.example.com server1

:: 1 localhost localhost.localdomain localhost6

localhost6.localdomain6

5 Configurar el Firewall

(Puede saltarse este parte si ya se ha desactivado el firewall al final de la instalación básica del sistema.)

Quiero instalar ISPConfig al final de este tutorial que viene con su propio firewall. Es por eso que

desactivare el cortafuegos por defecto de CentOS ahora. Por supuesto, usted es libre de dejarlo

encendido y configurar a sus necesidades (pero entonces usted no debe usar ningún otro firewall

más adelante, ya que es muy probable que interfiera con el firewall CentOS).

Ejecutate:

system-config-firewall

y desactivar el firewall.

Para comprobar que el servidor de seguridad realmente se ha desactivado, puede ejecutar

iptables-L

Page 29: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

28

después. La salida debe ser similar a esto:

[Root @ server1 ~] # iptables-L

Chain INPUT (policy ACCEPT)

objetivo prot origen destino optan cadena FORWARD (policy ACCEPT) objetivo prot

optar fuente destino cadena OUTPUT (policy ACCEPT) objetivo prot origen destino

optan [root @ server1 ~] #

6 Desactive SELinux

SELinux es una extensión de seguridad de CentOS que deberían proporcionar seguridad

ampliada. En mi opinión no lo necesita para configurar un sistema seguro, y por lo general

provoca más problemas que ventajas (pensar en él después de haber hecho una semana

después de la resolución de problemas ya que algunos servicios no funcionaba como era de

esperar, y luego saber que todo estaba bien, sólo SELinux estaba causando el problema). Por lo

tanto puedo desactivar (esto es una necesidad si se desea instalar ISPConfig más adelante).

Editar /etc/selinux/config y establecer SELINUX = disabled:

vi /etc/selinux/config

# This file controls the state of SELinux on the

system.

# SELINUX= can take one of these three values:

# enforcing - SELinux security policy is enforced.

# permissive - SELinux prints warnings instead of

enforcing.

# disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

# targeted - Targeted processes are protected,

# mls - Multi Level Security protection.

SELINUXTYPE=targeted

Después tenemos que reiniciar el sistema:

reboot

Page 30: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

29

7 Active repositorios adicionales e instalar algunas Software

Primero importamos las claves GPG para los paquetes de software:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

A continuación, hacemos posible que el rpmforge y repositorios EPEL en nuestro sistema CentOS

como muchos de los paquetes que vamos a instalar en el transcurso de este tutorial no están

disponibles en los repositorios oficiales de CentOS 6.2:

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

cd /tmp

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-

2.el6.rf.x86_64.rpm

rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

(Si el enlace anterior no funciona, se puede encontrar la versión actual de rpmforge-

release aquí:http://packages.sw.be/rpmforge-release/ )

rpm --import https://fedoraproject.org/static/0608B895.txt

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm

rpm -ivh epel-release-6-5.noarch.rpm

yum install yum-priorities

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -ivh epel-release-6-8.noarch.rpm

nota: para las primeras dos lineas las versiones deben ser las 6-8 como se indica

en las dos líneas enmarcadas anterirmente. De lo cotrario arrojara un mensaje

indicado que no se encuentra el paquete o sitio.

Editar /etc/yum.repos.d/epel.repo ...

Page 31: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

30

vi /etc/yum.repos.d/epel.repo

Agregue la línea priority = 10 a la [EPEL] sección:

[epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

#baseurl=http://download.fedoraproject.org/pub/epel/6/$basear

ch

mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=ep

el-6&arch=$basearch

failovermethod=priority

enabled=1

priority=10

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[...]

Luego actualizamos nuestros paquetes existentes en el sistema:

yum update

Ahora instalamos algunos paquetes de software que seran necesarios más adelante:

yum groupinstall 'Development Tools'

8 cuotas

(Si usted ha elegido un esquema de particionamiento diferente de lo que hice, debe ajustar este capítulo para

que la cuota se aplica a las particiones donde usted lo necesita.)

Para instalar la cuota, se corre el siguiente comando:

yum install quota

Editar /etc/fstab y añadir, usrjquota = aquota.user, grpjquota = aquota.group, jqfmt

= vfsv0 a la / partición ( /dev/mapper/vg_server1-lv_root ):

vi /etc/fstab

#

# / Etc / fstab

# Creado por anaconda el Vie Dic 16 00:22:26 2011

#

Page 32: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

31

Sistemas de archivos # accesibles, por referencia, se

mantienen en '/ dev / disk'

# Vea las páginas man fstab (5), findfs (8), mount (8)

y / o blkid (8) para más información

#

/ Dev/mapper/vg_server1-lv_root / ext4 por defecto,

usrjquota = aquota.user, grpjquota = aquota.group,

jqfmt = vfsv0 1 1

UUID = d995c881-fbc7-409F-BCAD-86d255331a3f / boot ext4

defaults 1 2

/ Dev/mapper/vg_server1-lv_swap swap swap defaults 0 0

tmpfs / dev / shm tmpfs defaults 0 0

devpts / dev / pts devpts gid = 5, mode = 620 0 0

sysfs / sys sysfs defaults 0 0

proc / proc proc defaults 0 0

A continuación, ejecute

mount-o remount /

quotacheck-avugm

quotaon-avug

para habilitar las cuotas.

9 Instalar Apache, MySQL, phpMyAdmin

Podemos instalar los paquetes necesarios con un solo comando:

yum install ntp httpd mod_ssl mysql-server php php-mysql php-mbstring phpmyadmin

10 Instalar Courier-IMAP, Courier-Authlib y Maildrop

Lamentablemente no hay paquetes rpm para Courier-IMAP, Courier-authlib y Maildrop, por lo

tanto, tenemos que construirlos nosotros mismos.

Primero quite Dovecot (CentOS 6.2 viene con 2.x Dovecot, por desgracia, ISPConfig 3 es

compatible con 1.2.x Dovecot, pero no 2.x):

yum remove dovecot dovecot-mysql

A continuación, instale los requisitos previos que necesitamos para construir paquetes rpm de

mensajería:

Page 33: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

32

yum install rpm-build gcc mysql-devel openssl-devel cyrus-sasl-devel pkgconfig

zlib-devel pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel

openldap-servers libtool gdbm-devel pam-devel gamin-devel libidn-devel

Paquetes RPM no deben ser construidos como root, courier-imap incluso se niegan a compilar

si detecta que la compilación se ejecuta como el usuario root. Por lo tanto, creamos una cuenta

de usuario normal ahora ( falko en este ejemplo) y le damos una contraseña:

useradd-m-s / bin / bash falko

passwd falko

Necesitaremos el comando sudo más adelante para que el usuario falko puede compilar e

instalar los paquetes rpm. Pero primero, debemos permitir a falko ejecutar todos los comandos

con sudo :

Ejecutar:

visudo

En el archivo que se abre hay una línea root ALL = (ALL) TODO . Agregar una línea similar

para falko justo debajo de esa línea:

[...]

## Allow root to run any commands anywhere

root ALL=(ALL) ALL

falko ALL=(ALL) ALL

[...]

Ahora estamos listos para crear nuestro paquete rpm. En primer lugar convertirse en el

usuario falko :

su falko

A continuación, creamos nuestro entorno de compilación:

mkdir $HOME/rpm

mkdir $HOME/rpm/SOURCES

mkdir $HOME/rpm/SPECS

mkdir $HOME/rpm/BUILD

mkdir $HOME/rpm/BUILDROOT

mkdir $HOME/rpm/SRPMS

mkdir $HOME/rpm/RPMS

mkdir $HOME/rpm/RPMS/i386

mkdir $HOME/rpm/RPMS/x86_64

echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros

Page 34: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

33

Ahora creamos un directorio downloads y descargamos los archivos de origen

de http://www.courier-mta.org/download.php :

mkdir $HOME/downloads

cd $HOME/downloads

wget https://sourceforge.net/projects/courier/files/authlib/0.63.0/courier-

authlib-0.63.0.tar.bz2/download

wget https://sourceforge.net/projects/courier/files/imap/4.9.3/courier-imap-

4.9.3.tar.bz2/download

wget https://sourceforge.net/projects/courier/files/maildrop/2.5.5/maildrop-

2.5.5.tar.bz2/download

A todos los enlaces anteriores se les agrega espacio al final y lo siguiente para

se ejcuten de manera correcta ’—no-check-certificate--’. Ojo los apostrofes

también van escritos.

(Tenga en cuenta que yo uso Courier-IMAP 4.9.3 aquí en vez de la más reciente 4.10.0 por

4.10.0 depende systemctl que existe para Fedora, pero no para CentOS).

Ahora (aún en $ HOME/downloads ) podemos construir courier-authlib:

sudo rpmbuild-ta courier-authlib-0.63.0.tar.bz2

Después de que el proceso de construcción, los paquetes rpm se pueden encontrar

en /root/rpmbuild/RPMS/x86_64 ( /root/rpmbuild/RPMS/i686 si usted está en un sistema

i686). El comando

sudo ls-l / root/rpmbuild/RPMS/x86_64

que muestra los paquetes rpm disponibles:

[falko@server1 downloads]$ sudo ls -l /root/rpmbuild/RPMS/x86_64

total 528

-rw-r--r-- 1 root root 124008 Dec 16 01:10 courier-authlib-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 270860 Dec 16 01:10 courier-authlib-debuginfo-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 35072 Dec 16 01:10 courier-authlib-devel-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 17368 Dec 16 01:10 courier-authlib-ldap-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 13928 Dec 16 01:10 courier-authlib-mysql-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 13076 Dec 16 01:10 courier-authlib-pgsql-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 8312 Dec 16 01:10 courier-authlib-pipe-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 34064 Dec 16 01:10 courier-authlib-userdb-0.63.0-

Page 35: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

34

1.el6.x86_64.rpm

[falko@server1 downloads]$

Selecciona los que desee instalar, y los instala de esta manera:

sudo rpm -ivh /root/rpmbuild/RPMS/x86_64/courier-authlib-0.63.0-1.el6.x86_64.rpm

/root/rpmbuild/RPMS/x86_64/courier-authlib-mysql-0.63.0-1.el6.x86_64.rpm

/root/rpmbuild/RPMS/x86_64/courier-authlib-devel-0.63.0-1.el6.x86_64.rpm

Ahora volvemos a nuestra carpeta downloads:

cd $HOME/downloads

Ejecute los siguientes comandos para crear directorios necesarios / cambiar los permisos de

directorio (porque de lo contrario el proceso de generación de Courier-IMAP fallará):

sudo mkdir-p /vat/cache/ccache/tmp

sudo chmod o + rwx /var/cache/ccache/

sudo chmod 777 /var/cache/ccache/tmp

Ahora ejecutar rpmbuild nuevamente, esta vez sin sudo , de lo contrario la compilación fallará

porque se ejecuta como root:

rpmbuild-ta courier-imap-4.9.3.tar.bz2

Después del proceso de construcción, los paquetes rpm se pueden encontrar

en $HOME/rpm/RPMS/x86_64 ( $ HOME/rpm/RPMS/i686 si usted está en un sistema i686):

cd $ HOME/rpm/RPMS/x86_64

Ejecute el comando

ls-l

Que muestra los paquetes rpm disponibles:

[falko@server1 x86_64]$ ls -l

total 1116

Page 36: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

35

-rw-rw-r-- 1 falko falko 331908 Dec 16 01:33 courier-imap-4.9.3-1.x86_64.rpm

-rw-rw-r-- 1 falko falko 800864 Dec 16 01:33 courier-imap-debuginfo-4.9.3-

1.x86_64.rpm

[falko@server1 x86_64]$

Puede instalar courier-imap como esto:

sudo rpm-ivh courier-imap-4.9.3-1.x86_64.rpm

Ahora volvemos a nuestro directorio Downloads:

cd $HOME/downloads

y ejecutar rpmbuild de nuevo, esta vez para crear un paquete de buzón:

sudo rpmbuild-ta maildrop-2.5.5.tar.bz2

Después de que el proceso de construcción, los paquetes rpm se pueden encontrar

en /root/rpmbuild/RPMS/x86_64 ( / root/rpmbuild/RPMS/i686 si usted está en un sistema

i686). Ejecute el comando

sudo ls-l / root/rpmbuild/RPMS/x86_64

Que muestra los paquetes rpm disponibles:

[falko@server1 downloads]$ sudo ls -l /root/rpmbuild/RPMS/x86_64

total 1712

-rw-r--r-- 1 root root 124008 Dec 16 01:10 courier-authlib-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 270860 Dec 16 01:10 courier-authlib-debuginfo-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 35072 Dec 16 01:10 courier-authlib-devel-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 17368 Dec 16 01:10 courier-authlib-ldap-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 13928 Dec 16 01:10 courier-authlib-mysql-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 13076 Dec 16 01:10 courier-authlib-pgsql-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 8312 Dec 16 01:10 courier-authlib-pipe-0.63.0-

1.el6.x86_64.rpm

-rw-r--r-- 1 root root 34064 Dec 16 01:10 courier-authlib-userdb-0.63.0-

1.el6.x86_64.rpm

Page 37: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

36

-rw-r--r-- 1 root root 286480 Dec 16 01:40 maildrop-2.5.5-1.x86_64.rpm

-rw-r--r-- 1 root root 751376 Dec 16 01:40 maildrop-debuginfo-2.5.5-1.x86_64.rpm

-rw-r--r-- 1 root root 102104 Dec 16 01:40 maildrop-devel-2.5.5-1.x86_64.rpm

-rw-r--r-- 1 root root 65940 Dec 16 01:40 maildrop-man-2.5.5-1.x86_64.rpm

[falko@server1 downloads]$

Ahora puede instalar el buzón de esta manera:

sudo rpm-ivh /root/rpmbuild/RPMS/x86_64/maildrop-2.5.5-1.x86_64.rpm

Después de haber compilado e instalado todos los paquetes necesarios, puede convertirse en

root de nuevo escribiendo

exit

Ahora empieza Courier-IMAP/-POP3 de la siguiente manera:

/etc/init.d/courier-imap start

11 Instalación de Postfix

Postfix se puede instalar de la siguiente manera:

yum install postfix

A continuación, apague Sendmail y Postfix y empezar a MySQL:

chkconfig --levels 235 mysqld on

/etc/init.d/mysqld start

chkconfig --levels 235 sendmail off

chkconfig --levels 235 postfix on

/etc/init.d/sendmail stop

/etc/init.d/postfix restart

12 Instalar GetMail

Page 38: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

37

GetMail se puede instalar de la siguiente manera:

yum install getmail

13 Establecimiento de contraseñas de MySQL y configuración de

phpMyAdmin

Establezca contraseñas para la cuenta root de MySQL:

mysql_secure_installation

[root@server1 tmp]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current

password for the root user. If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n] <-- ENTER

New password: <-- yourrootsqlpassword

Re-enter new password: <-- yourrootsqlpassword

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them. This is intended only for testing, and to make the installation

Page 39: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

38

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] <-- ENTER

... Success!

Normally, root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <-- ENTER

... Success!

By default, MySQL comes with a database named 'test' that anyone can

access. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] <-- ENTER

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] <-- ENTER

... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

[root@server1 tmp]#

Ahora podemos configurar phpMyAdmin. Cambiamos la configuración de Apache para que

phpMyAdmin permite conexiones no sólo desde localhost (comentando la estrofa <Directory

"/usr/share/phpmyadmin">):

Page 40: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

39

vi / etc / httpd / conf.d / phpmyadmin.conf

#

# Web application to manage MySQL

#

#<Directory "/usr/share/phpmyadmin">

# Order Deny,Allow

# Deny from all

# Allow from 127.0.0.1

#</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin

Alias /phpMyAdmin /usr/share/phpmyadmin

Alias /mysqladmin /usr/share/phpmyadmin

A continuación cambiamos la autenticación phpMyAdmin de cookie a http :

vi /usr/share/phpmyadmin/config.inc.php

[...]

/* Authentication type */

$cfg['Servers'][$i]['auth_type'] = 'http';

[...]

Luego creamos los enlaces de inicio del sistema para Apache y ponerlo en marcha:

chkconfig --levels 235 httpd on

/etc/init.d/httpd start

Ahora usted puede dirigir su

navegador http://server1.ricardo.com/phpmyadmin/ o http://172.16.1.7/phpmyadmin/e

inicie sesión con el nombre de usuario root y su nueva contraseña root de MySQL.

14 Instalar Amavisd nuevo, SpamAssassin y ClamAV

Para instalar amavisd-new, clamav y spamassassin, ejecute el siguiente comando:

Page 41: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

40

yum install amavisd-new spamassassin clamav clamd unzip bzip2 unrar perl-DBD-

mysql

Entonces comenzamos freshclam, amavisd y clamd.amavisd:

sa-update

chkconfig --levels 235 amavisd on

chkconfig --del clamd

chkconfig --levels 235 clamd.amavisd on

/usr/bin/freshclam

/etc/init.d/amavisd start

/etc/init.d/clamd.amavisd start

15 Instalación de Apache2 Con mod_php, mod_fcgi/PHP5, Y

suPHP

ISPConfig 3 permite utilizar mod_php, mod_fcgi/PHP5, cgi/PHP5 y suPHP en una base por sitio

web.

Podemos instalar Apache2with mod_php5, mod_fcgid y PHP5 como sigue:

yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear

php-xml php-xmlrpc php-xcache php-mbstring php-mcrypt php-mssql php-snmp php-soap

php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel

mod_fcgid php-cli httpd-devel

A continuación abrimos /etc/php.ini ...

vi /etc/php.ini

... y cambiar el informe de errores (para que los avisos no se muestran ya) y

quite cgi.fix_pathinfo=1 :

[...]

;error_reporting = E_ALL & ~E_DEPRECATED

error_reporting = E_ALL & ~E_NOTICE

[...]

; cgi.fix_pathinfo provides *real*

PATH_INFO/PATH_TRANSLATED support for CGI. PHP's

; previous behaviour was to set PATH_TRANSLATED to

SCRIPT_FILENAME, and to not grok

Page 42: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

41

; what PATH_INFO is. For more information on

PATH_INFO, see the cgi specs. Setting

; this to 1 will cause PHP CGI to fix its paths to

conform to the spec. A setting

; of zero causes PHP to behave as before. Default is

1. You should fix your scripts

; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.

;

http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-

pathinfo

cgi.fix_pathinfo=1

[...]

A continuación instalamos suPHP (hay un mod_suphp de paquetes disponibles en los repositorios,

pero por desgracia no es compatible con ISPConfig, por lo tanto, tenemos que construir nosotros

mismos suPHP):

cd /tmp

wget http://suphp.org/download/suphp-0.7.1.tar.gz

tar xvfz suphp-0.7.1.tar.gz

cd suphp-0.7.1/

./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --

with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=owner --

with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-

SUPHP_USE_USERGROUP=yes

make

make install

Luego añadimos el módulo suPHP a nuestra configuración de Apache ...

vi /etc/httpd/conf.d/suphp.conf

LoadModule suphp_module modules/mod_suphp.so

... y crear el fichero /etc/suphp.conf la siguiente manera:

vi /etc/suphp.conf

[global]

;Path to logfile

logfile=/var/log/httpd/suphp.log

;Loglevel

Page 43: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

42

loglevel=info

;User Apache is running as

webserver_user=apache

;Path all scripts have to be in

docroot=/

;Path to chroot() to before executing script

;chroot=/mychroot

; Security options

allow_file_group_writeable=true

allow_file_others_writeable=false

allow_directory_group_writeable=true

allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT

check_vhost_docroot=true

;Send minor error messages to browser

errors_to_browser=false

;PATH environment variable

env_path=/bin:/usr/bin

;Umask to set, specify in octal notation

umask=0077

; Minimum UID

min_uid=100

; Minimum GID

min_gid=100

[handlers]

;Handler for php-scripts

x-httpd-suphp="php:/usr/bin/php-cgi"

;Handler for CGI-scripts

x-suphp-cgi="execute:!self"

Finalmente reiniciamos Apache:

/etc/init.d/httpd restart

Page 44: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

43

15.1 Ruby

Desde la versión 3.0.3, ISPConfig 3 ha incorporado soporte para Ruby. En lugar de utilizar CGI /

FastCGI, ISPConfig depende de mod_ruby estar disponible en el servidor Apache.

Para CentOS 6.2, no hay paquete mod_ruby disponible, así que hay que compilarlo nosotros

mismos. Primero instalamos algunos requisitos previos:

yum install httpd-devel ruby ruby-devel

A continuación, descarga e instala mod_ruby la siguiente manera:

cd /tmp

wget http://modruby.net/archive/mod_ruby-1.3.0.tar.gz

Nota: el link anterior no descraga ningun archive, para realizer este proceso se

utilize el siguiente enlace:

wget http://fossies.org/unix/www/apache_httpd_modules/mod_ruby-1.3.0.tar.gz/

tar zxvf mod_ruby-1.3.0.tar.gz

cd mod_ruby-1.3.0/

./configure.rb --with-apr-includes=/usr/include/apr-1

make

make install

Por último hay que añadir el módulo mod_ruby a la configuración de Apache, así que vamos a

crear el archivo /etc/httpd/conf.d/ruby.conf ...

vi /etc/httpd/conf.d/ruby.conf

LoadModule ruby_module modules/mod_ruby.so

RubyAddPath /1.8

... y reiniciar Apache:

Page 45: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

44

/etc/init.d/httpd restart

(Si se omite el RubyAddPath /1.8 Directiva, verá errores como los siguientes en el error de

registro de Apache cuando se llama a los archivos de Rubí:

[Thu May 26 02:05:05 2011] [error] mod_ruby: ruby:0:in `require': no such file to

load -- apache/ruby-run (LoadError)

[Thu May 26 02:05:05 2011] [error] mod_ruby: failed to require apache/ruby-run

[Thu May 26 02:05:05 2011] [error] mod_ruby: error in ruby

)

15.2 Python

Para instalar mod_python, simplemente nos quedamos ...

yum install mod_python

... y reiniciar Apache después:

/etc/init.d/httpd restart

15.3 WebDAV

WebDAV ya debería estar habilitado, pero para comprobar esto,

abra /etc/httpd/conf/httpd.conf y asegúrese de que los tres módulos siguientes están

activas:

vi /etc/httpd/conf/httpd.conf

[...]

LoadModule auth_digest_module

modules/mod_auth_digest.so

[...]

LoadModule dav_module modules/mod_dav.so

[...]

LoadModule dav_fs_module modules/mod_dav_fs.so

[...]

Si tiene que modificar /etc/httpd/conf/httpd.conf , no se olvide de reiniciar Apache después:

Page 46: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

45

/etc/init.d/httpd restart

16 Instalar PureFTPd

PureFTPd se puede instalar con el siguiente comando:

yum install pure-ftpd

A continuación, cree los enlaces de inicio del sistema e iniciar PureFTPd:

chkconfig --levels 235 pure-ftpd on

/etc/init.d/pure-ftpd start

Ahora configuramos PureFTPd para permitir sesiones FTP y TLS. FTP es un protocolo muy

inseguro porque todas las contraseñas y los datos se transfieren en texto claro. Mediante el uso

de TLS, toda la comunicación puede ser encriptada, por lo que FTP mucho más seguro.

OpenSSL es necesario para TLS, para instalar OpenSSL, simplemente ejecutamos:

yum install openssl

Abrir /etc/pure-ftpd/pure-ftpd.conf ...

vi /etc/pure-ftpd/pure-ftpd.conf

Si desea permitir FTP y sesiones TLS, configurar TLS para 1 :

[...]

# This option can accept three values :

# 0 : disable SSL/TLS encryption layer (default).

# 1 : accept both traditional and encrypted sessions.

# 2 : refuse connections that don't use SSL/TLS

security mechanisms,

Page 47: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

46

# including anonymous sessions.

# Do _not_ uncomment this blindly. Be sure that :

# 1) Your server has been compiled with SSL/TLS support

(--with-tls),

# 2) A valid certificate is in place,

# 3) Only compatible clients will log in.

TLS 1

[...]

Para utilizar TLS, debemos crear un certificado SSL. Creo en /etc/ssl/private/ , por lo tanto

creo que directorio primero:

mkdir-p /etc/ssl/private/

Después, podemos generar el certificado SSL de la siguiente manera:

openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout

/etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem

Country Name (2 letter code) [XX]: <-- Enter your Country Name (e.g., "DE").

State or Province Name (full name) []: <-- Enter your State or Province Name.

Locality Name (eg, city) [Default City]: <-- Enter your City.

Organization Name (eg, company) [Default Company Ltd]: <-- Enter your Organization Name

(e.g., the name of your company).

Organizational Unit Name (eg, section) []: <-- Enter your Organizational Unit Name (e.g. "IT

Department").

Common Name (eg, your name or your server's hostname) []: <-- Enter the Fully Qualified

Domain Name of the system (e.g. "server1.example.com").

Email Address []: <-- Enter your Email Address.

Cambie los permisos del certificado SSL:

chmod 600 /etc/ssl/private/pure-ftpd.pem

Finalmente reiniciar PureFTPd:

/etc/init.d/pure-ftpd restart

Page 48: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

47

Eso es todo. Ahora usted puede tratar de conectarse a través de su cliente de FTP, sin embargo,

se debe configurar el cliente FTP para usar TLS.

17 Instalación de BIND

Podemos instalar BIND de la siguiente manera:

yum install bind bind-utils

Siguiente abierto /etc/sysconfig/named ...

vi /etc/sysconfig/named

... y asegurarse de que el ROOTDIR =/var/named/chroot línea se comente:

# BIND named process options

# ~~~~~~~~~~~~~~~~~~~~~~~~~~

# Currently, you can use the following options:

#

# ROOTDIR="/var/named/chroot" -- will run named in a chroot

environment.

# you must set up the chroot

environment

# (install the bind-chroot

package) before

# doing this.

# NOTE:

# Those directories are automatically mounted to

chroot if they are

# empty in the ROOTDIR directory. It will simplify

maintenance of your

Page 49: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

48

# chroot environment.

# - /var/named

# - /etc/pki/dnssec-keys

# - /etc/named

# - /usr/lib64/bind or /usr/lib/bind (architecture

dependent)

#

# Those files are mounted as well if target file

doesn't exist in

# chroot.

# - /etc/named.conf

# - /etc/rndc.conf

# - /etc/rndc.key

# - /etc/named.rfc1912.zones

# - /etc/named.dnssec.keys

# - /etc/named.iscdlv.key

#

# Don't forget to add "$AddUnixListenSocket

/var/named/chroot/dev/log"

# line to your /etc/rsyslog.conf file. Otherwise your

logging becomes

# broken when rsyslogd daemon is restarted (due update,

for example).

#

# OPTIONS="whatever" -- These additional options will be

passed to named

# at startup. Don't add -t here,

use ROOTDIR instead.

#

# KEYTAB_FILE="/dir/file" -- Specify named service keytab

file (for GSS-TSIG)

#

# DISABLE_ZONE_CHECKING -- By default, initscript calls

named-checkzone

# utility for every zone to ensure

all zones are

# valid before named starts. If you

set this option

# to 'yes' then initscript doesn't

perform those

# checks.

Haga una copia de seguridad del existente /etc/named.conf archivo y crear uno nuevo de la

siguiente manera:

Page 50: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

49

cp /etc/named.conf /etc/named.conf_bak

cat /dev / null> /etc/named.conf

vi /etc/named.conf

//

// named.conf

//

// Provided by Red Hat bind package to configure the

ISC BIND named(8) DNS

// server as a caching only nameserver (as a localhost

DNS resolver only).

//

// See /usr/share/doc/bind*/sample/ for example named

configuration files.

//

options {

listen-on port 53 { any; };

listen-on-v6 port 53 { any; };

directory "/var/named";

dump-file

"/var/named/data/cache_dump.db";

statistics-file

"/var/named/data/named_stats.txt";

memstatistics-file

"/var/named/data/named_mem_stats.txt";

allow-query { any; };

recursion yes;

};

logging {

channel default_debug {

file "data/named.run";

severity dynamic;

};

};

zone "." IN {

type hint;

file "named.ca";

};

include "/etc/named.conf.local";

Cree el archivo named.conf.local/etc / que se incluye al final

de /etc/named.conf ( /etc/named.conf.local será más tarde conseguir poblada por ISPConfig

si crea zonas DNS en ISPConfig):

Page 51: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

50

touch /etc/named.conf.local

Luego creamos los enlaces de inicio y comenzar a BIND:

chkconfig --levels 235 named on

/etc/init.d/named start

18 Instalar Vlogger, Webalizer, AWStats English Y

Este proceso no se realizó debido a fallas en la ejecución de los comandos. Puedes saltartelo si

no quieres revisarlo.

Vlogger, Webalizer y AWStats se pueden instalar de la siguiente manera:

yum install webalizer awstats perl-DateTime-Format-HTTP perl-DateTime-Format-

Builder

cd / tmp

wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz

tar xvfz vlogger-1.3.tar.gz

vlogger-1.3/vlogger mv / usr / sbin /

rm-rf vlogger *

19 Instalar Jailkit

Jailkit sólo es necesario si quieres usuarios chroot SSH. Se puede instalar de la siguiente manera

( importante: Jailkit debe instalarse antes de ISPConfig - no se puede instalar después! )

cd / tmp

wget http://olivier.sessink.nl/jailkit/jailkit-2.14.tar.gz

tar xvfz jailkit-2.14.tar.gz

Page 52: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

51

cd jailkit-2.14

. / configure

make

make install

cd ..

rm-rf jailkit- 2,14 *

20 Instalar fail2ban

Esto es opcional, pero se recomienda, ya que el monitor ISPConfig trata de mostrar el registro:

yum install fail2ban

Debemos configurar fail2ban para registrar en el archivo de

registro /var/log/fail2ban.log porque este es el archivo de registro que es controlado por el

módulo Monitor de ISPConfig. Abrir /etc/fail2ban/fail2ban.conf ...

vi / etc/fail2ban/fail2ban.conf

... y comentar la línea LOGTARGET = SYSLOG y añadir LOGTARGET = / var/log/fail2ban.log :

[...]

# Option: logtarget

# Notes.: Set the log target. This could be a file,

SYSLOG, STDERR or STDOUT.

# Only one log target can be specified.

# Values: STDOUT STDERR SYSLOG file Default:

/var/log/fail2ban.log

#

#logtarget = SYSLOG

logtarget = /var/log/fail2ban.log

[...]

A continuación, cree los enlaces de inicio del sistema para fail2ban y ponerlo en marcha:

chkconfig --levels 235 fail2ban on

/etc/init.d/fail2ban start

Page 53: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

52

21 Instalar rkhunter

rkhunter se puede instalar de la siguiente manera:

yum install rkhunter

22 Instalación de Mailman

Desde la versión 3.0.4, ISPConfig también le permite gestionar (crear / modificar / eliminar) las

listas de distribución de Mailman. Si desea hacer uso de esta función, instale Mailman de la

siguiente manera:

yum install mailman

Antes de que podamos comenzar a Mailman, una primera lista de correo llamada mailman debe

ser creado:

/usr/lib/mailman/bin/newlist mailman

[root@server1 tmp]# /usr/lib/mailman/bin/newlist mailman

Enter the email of the person running the list: <--

admin email address, e.g. [email protected]

Initial mailman password: <-- admin password for the mailman list

To finish creating your mailing list, you must edit your /etc/aliases (or

equivalent) file by adding the following lines, and possibly running the

`newaliases' program:

## mailman mailing list

mailman: "|/usr/lib/mailman/mail/mailman post mailman"

mailman-admin: "|/usr/lib/mailman/mail/mailman admin mailman"

Page 54: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

53

mailman-bounces: "|/usr/lib/mailman/mail/mailman bounces mailman"

mailman-confirm: "|/usr/lib/mailman/mail/mailman confirm mailman"

mailman-join: "|/usr/lib/mailman/mail/mailman join mailman"

mailman-leave: "|/usr/lib/mailman/mail/mailman leave mailman"

mailman-owner: "|/usr/lib/mailman/mail/mailman owner mailman"

mailman-request: "|/usr/lib/mailman/mail/mailman request mailman"

mailman-subscribe: "|/usr/lib/mailman/mail/mailman subscribe mailman"

mailman-unsubscribe: "|/usr/lib/mailman/mail/mailman unsubscribe mailman"

Hit enter to notify mailman owner... <-- ENTER

Abra /etc/aliases después ...

vi /etc/aliases

... y añadir las siguientes líneas:

[...]

mailman: "|/usr/lib/mailman/mail/mailman

post mailman"

mailman-admin: "|/usr/lib/mailman/mail/mailman

admin mailman"

mailman-bounces: "|/usr/lib/mailman/mail/mailman

bounces mailman"

mailman-confirm: "|/usr/lib/mailman/mail/mailman

confirm mailman"

mailman-join: "|/usr/lib/mailman/mail/mailman

join mailman"

mailman-leave: "|/usr/lib/mailman/mail/mailman

leave mailman"

mailman-owner: "|/usr/lib/mailman/mail/mailman

owner mailman"

mailman-request: "|/usr/lib/mailman/mail/mailman

request mailman"

mailman-subscribe: "|/usr/lib/mailman/mail/mailman

subscribe mailman"

mailman-unsubscribe: "|/usr/lib/mailman/mail/mailman

unsubscribe mailman"

Ejecutar

newaliases

Después y reiniciar Postfix:

Page 55: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

54

/etc/init.d/postfix restart

Ahora abra el archivo de configuración de Mailman

Apache /etc/httpd/conf.d/mailman.conf ...

vi /etc/httpd/conf.d/mailman.conf

... y añada la línea ScriptAlias/cgi-bin/mailman/ /usr/lib/mailman/cgi-

bin/ . Comente Alias /pipermail/ /var/lib/mailman/archives/public/ y agregue la

línea Alias/pipermail/var/lib/mailman/archives/public/ :

#

# httpd configuration settings for use with mailman.

#

ScriptAlias /mailman/ /usr/lib/mailman/cgi-bin/

ScriptAlias /cgi-bin/mailman/ /usr/lib/mailman/cgi-bin/

<Directory /usr/lib/mailman/cgi-bin/>

AllowOverride None

Options ExecCGI

Order allow,deny

Allow from all

</Directory>

#Alias /pipermail/ /var/lib/mailman/archives/public/

Alias /pipermail /var/lib/mailman/archives/public/

<Directory /var/lib/mailman/archives/public>

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

AddDefaultCharset Off

</Directory>

# Uncomment the following line, to redirect queries to

/mailman to the

# listinfo page (recommended).

# RedirectMatch ^/mailman[/]*$ /mailman/listinfo

Reinicie Apache:

Page 56: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

55

/etc/init.d/httpd restart

Crear los enlaces de inicio del sistema de Mailman y ponerlo en marcha:

chkconfig --levels 235 mailman on

/etc/init.d/mailman start

Después de instalar ISPConfig 3, puede acceder a Mailman de la siguiente manera:

Usted puede utilizar el alias / cgi-bin/mailman para todos los vhosts Apache (por favor, tenga

en cuenta que suExec y CGI deben desactivar para todos vhosts desde la que desea acceder

Mailman!), lo que significa que puede acceder a la interfaz de administración Mailman para una

lista en http://<vhost>/cgi-bin/mailman/admin/<listname> , y la página web para los

usuarios de una lista de correo puede encontrarse

en http://<vhost>/cgibin/mailman/listinfo/<listname> .

En http://<vhost>/pipermail/<listname> se encuentran los archivos de la lista de correo.

23 Instalar SquirrelMail

Para instalar el cliente webmail SquirrelMail, correr ...

yum install squirrelmail

... y reiniciar Apache:

/etc/init.d/httpd restart

A continuación, configure SquirrelMail:

/usr/share/squirrelmail/config/conf.pl

Tenemos que decir a SquirrelMail que estamos utilizando Courier-IMAP/-POP3:

SquirrelMail Configuration : Read: config.php (1.4.0)

---------------------------------------------------------

Page 57: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

56

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 off

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

Page 58: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

57

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 enter to continue... <-- press ENTER

SquirrelMail Configuration : Read: config.php (1.4.0)

---------------------------------------------------------

Main Menu --

1. Organization Preferences

2. Server Settings

3. Folder Defaults

Page 59: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

58

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 off

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 off

S Save data

Q Quit

Command >> <--Q

Una última cosa que necesitamos hacer es modificar el

archivo /etc/squirrelmail/config_local.php y comente

la $default_folder_prefix variables - si usted no hace esto, verá el siguiente mensaje de

error en SquirrelMail después de haber iniciado sesión : Consulta: Crear "Enviados" Razón

Given: Invalid mailbox name.

Page 60: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

59

vi /etc/squirrelmail/config_local.php

<?php

/**

* Local config overrides.

*

* You can override the config.php settings here.

* Don't do it unless you know what you're doing.

* Use standard PHP syntax, see config.php for

examples.

*

* @copyright &copy; 2002-2006 The SquirrelMail Project

Team

* @license http://opensource.org/licenses/gpl-

license.php GNU Public License

* @version $Id: config_local.php,v 1.2 2006/07/11

03:33:47 wtogami Exp $

* @package squirrelmail

* @subpackage config

*/

//$default_folder_prefix = '';

?>

Ahora puedes

escribir http://server1.ricardo.com/webmail o http://172.16.1.7/webmail en su

navegador para acceder a SquirrelMail.

Page 61: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

60

Instalar ISPconfig 3

Descargue la versión actual ISPConfig 3 e instalarlo. El instalador ISPConfig configurará todos

los servicios como Postfix, Courier, etc para usted. Una configuración manual según sea

necesario para ISPConfig 2 ya no es necesario.

Ahora también tiene la posibilidad de dejar que el instalador cree un host virtual SSL para el

panel de control de ISPConfig para que ISPConfig se puede acceder mediante https:// en lugar

de http:// . Para ello, sólo tiene que pulsar ENTER cuando vea la siguiente pregunta: Do you

want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]:.

Para instalar ISPConfig 3 de la última versión 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 instalador ISPConfig 3:

[Root @ server1 install] # php-q install.php

Page 62: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

61

------------------------------------- -------------------------------------------

____________________________ | __ / ___ | ___ \ / __ \ / _ (_) / __ \ | | \

`- |. | _ / / | / \ / ______ | | ______ / / | | `- -. \ __ / | | / _ \ | '_ \ |

_ | | / _ `| | _ | _ | | _ / \ __ / / | | \ __ / \ (_) | | | | | | | (_ | | ___

\ \ \ ___ / \ ____ / \ _ | \ ____ / \ ___ / | _ | | _ | _ | | _ | \ __, | \ ____

/ __ /

| | ___ / ------ -------------------

------------------------------- ------------------------

>> Initial configuration

Operating System: Redhat or compatible, unknown version.

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]: <-- ENTER

Installation mode (standard,expert) [standard]: <-- ENTER

Full qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.exa

mple.com]: <-- ENTER

MySQL server hostname [localhost]: <-- ENTER

MySQL root username [root]: <-- ENTER

MySQL root password []: <-- yourrootsqlpassword

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

Page 63: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

62

For some fields there will be a default value,

If you enter '.', the field will be left blank.

-----

Country Name (2 letter code) [XX]: <-- ENTER

State or Province Name (full name) []: <-- ENTER

Locality Name (eg, city) [Default City]: <-- ENTER

Organization Name (eg, company) [Default Company Ltd]: <-- ENTER

Organizational Unit Name (eg, section) []: <-- ENTER

Common Name (eg, your name or your server's hostname) []: <-- ENTER

Email Address []: <-- ENTER

Configuring Jailkit

Configuring SASL

Configuring PAM

Configuring Courier

Configuring Spamassassin

Configuring Amavisd

Configuring Getmail

Configuring Pureftpd

Configuring BIND

Configuring Apache

Configuring Vlogger

Configuring Apps vhost

Configuring Bastille Firewall

Configuring Fail2ban

Installing ISPConfig

ISPConfig Port [8080]: <-- ENTER

Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: <-

- ENTER

Generating RSA private key, 4096 bit long modulus

.....................................++

.....................................................++

e is 65537 (0x10001)

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) [XX]: <-- ENTER

State or Province Name (full name) []: <-- ENTER

Locality Name (eg, city) [Default City]: <-- ENTER

Organization Name (eg, company) [Default Company Ltd]: <-- ENTER

Organizational Unit Name (eg, section) []: <-- ENTER

Common Name (eg, your name or your server's hostname) []: <-- ENTER

Page 64: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

63

Email Address []: <-- ENTER

Please enter the following 'extra' attributes

to be sent with your certificate request

A challenge password []: <-- ENTER

An optional company name []: <-- ENTER

writing RSA key

Configuring DBServer

Installing ISPConfig crontab

no crontab for root

no crontab for getmail

Restarting services ...

Stopping mysqld: [ OK ]

Starting mysqld: [ OK ]

Shutting down postfix: [ OK ]

Starting postfix: [ OK ]

Stopping saslauthd: [FAILED]

Starting saslauthd: [ OK ]

Shutting down amavisd: Daemon [1415] terminated by SIGTERM

[ OK ]

amavisd stopped

Starting amavisd: [ OK ]

Stopping clamd.amavisd: [ OK ]

Starting clamd.amavisd: [ OK ]

Stopping Courier authentication services: authdaemond

Starting Courier authentication services: authdaemond

Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl

SyntaxError: ('invalid syntax', ('/usr/lib/mailman/Mailman/mm_cfg.py', 76, 27, 'D

EFAULT_SERVER_LANGUAGE = \n'))

Traceback (most recent call last):

File "/usr/lib/mailman/bin/mailmanctl", line 109, in <module>

from Mailman import mm_cfg

File "/usr/lib/mailman/Mailman/mm_cfg.py", line 76

DEFAULT_SERVER_LANGUAGE =

^

SyntaxError: invalid syntax

Shutting down mailman: [FAILED]

SyntaxError: ('invalid syntax', ('/usr/lib/mailman/Mailman/mm_cfg.py', 76, 27, 'D

Page 65: Servidor Ispconfig

Universidad Politécnica de Tulancingo |

64

EFAULT_SERVER_LANGUAGE = \n'))

Traceback (most recent call last):

File "/usr/lib/mailman/bin/mailmanctl", line 109, in <module>

from Mailman import mm_cfg

File "/usr/lib/mailman/Mailman/mm_cfg.py", line 76

DEFAULT_SERVER_LANGUAGE =

^

SyntaxError: invalid syntax

Starting mailman: [FAILED]

Stopping httpd: [ OK ]

[Sun Dec 18 23:47:41 2011] [warn] NameVirtualHost *:80 has no VirtualHosts

Starting httpd: [ OK ]

Stopping pure-ftpd: [ OK ]

Starting pure-ftpd: [ OK ]

Installation completed.

[root@server1 install]#

Para corregir los errores de Mailman que podría recibir durante la instalación de ISPConfig,

abierto /usr/lib/mailman/Mailman/mm_cfg.py ...

vi /usr/lib/mailman/Mailman/mm_cfg.py

... y establecer DEFAULT_SERVER_LANGUAGE = 'en' :

[...]

# ------------------------------------------------- ---

---------

# The default language for this server.

DEFAULT_SERVER_LANGUAGE = 'en'

[...]

Reiniciar Mailman:

/etc/init.d/mailman restart

Después se puede acceder ISPConfig 3

bajo http(s)://server1.ricardo.com:8080/ o http(s)://192.168.0.100:8080/

( http o https depende de lo que eligió durante la instalación). Inicie sesión con el nombre de

usuario administrador y la contraseña de administrador (debe cambiar la contraseña por

defecto después de su primera sesión):