Post on 03-Mar-2015
transcript
Universidad tecnoligica Lic en Redes
Melquiades García
Instalación de ISPCONFIG y sus Dependencias en Ubuntu
Para esto use Ubuntu 10.04 LTS
Instalar todo como root para evitar problemas de permisos
Después de haber instalado el sistema operativo de Linux distribución Ubuntu
Y haberse logeado hay que obtener los privilegios de root para eso escribimos en la termina
Sudo su
Si no tiene password el root deben darle una con el siguiente comando en terminal
sudo passwd root
Bueno después de esto hay que modificar el archivo que está en la siguiente ruta /etc/hosts
modificar la línea en rojo hay ira el nombre de su server y donde está el IP 192.168.0.100 es el IP
de su máquina donde esta Ubuntu para esto deben tener una IP estática
127.0.0.1 localhost.localdomain localhost
192.168.0.100 server1.example.com server1
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Ahora ejecutar estas líneas en terminal
echo server1.example.com > /etc/hostname
/etc/init.d/hostname restart
Después de esto correr el comando
hostname
Y luego
hostname -f
El debería mostrar las 2 veces el nombre del server1.example.com de nuestro server dependiendo
de qué nombre le hayan puesto.
Universidad tecnoligica Lic en Redes
Melquiades García
Luego hay que actualizar la instalación de Linux Ubuntu específicamente.
Para eso no vamos a /etc/apt/sources.list
Verificamos que el archivo tenga el siguiente contenido y si no lo tiene lo debemos remplazar y
ponerlo tal como lo voy a poner aquí.
# deb cdrom:[Ubuntu-Server 10.04 LTS _Lucid Lynx_ - Release amd64
(20100427)]/ lucid main restricted
#deb cdrom:[Ubuntu-Server 10.04 LTS _Lucid Lynx_ - Release amd64
(20100427)]/ lucid 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/ lucid main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-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/ lucid universe
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid universe
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-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/ lucid multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
## Uncomment the following two lines to add software from the 'backports'
## repository.
## 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/ lucid-backports main
restricted universe multiverse
Universidad tecnoligica Lic en Redes
Melquiades García
# deb-src http://de.archive.ubuntu.com/ubuntu/ lucid-backports main
restricted universe 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 lucid partner
# deb-src http://archive.canonical.com/ubuntu lucid partner
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
Entonces nos vamos a terminal y ejecutamos
aptitude update
Para actualizar y también ejecutamos
aptitude safe-upgrade
después de esto es recomendable reiniciar la máquina para esto en terminal escribimos
reboot
Cambiar el Shell
Despues que se reinicia nuevamente ir a la terminal y ejecutar
dpkg-reconfigure dash
En esta parte nos preguntara lo siguiente
Install dash as /bin/sh? <-- No le ponemos que no
Si no haces esto tu instalación de ISPCONFIG va a fallar
Vamos a deshabilitar el AppArmor
AppArmor es una extensión de seguridad (Similar a SElinux) usualmente causa problemas
y por este motivo lo vamos a deshabilitar
Universidad tecnoligica Lic en Redes
Melquiades García
La vamos a deshabilitar ejecutando el siguiente comando en terminal
/etc/init.d/apparmor stop
update-rc.d -f apparmor remove
aptitude remove apparmor apparmor-utils
Sincronizado el reloj del sistema
Es bueno sincronizar el reloj del sistema con un NTP (Protocolo de tiempo de red)
aptitude install ntp ntpdate
Ahora vamos a Instalar Postfix, Courier, Saslauthd, MySQL, rkhunter,
binutils
Se puede instalar con un único comando para esto en terminal escribimos lo siguiente
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
getmail4 rkhunter binutils maildrop
nos va hacer las siguientes preguntas las cuales respondemos así
New password for the MySQL "root" user: <-- contraseña de mysql que valla a poner
Repeat password for the MySQL "root" user: <-- repetir contraseña de mysql
Create directories for web-based administration? <-- No
General type of mail configuration: <-- Internet Site
System mail name: <-- server1.example.com o el nombre de su server el que habian puesto
anteriormente
SSL certificate required <-- Ok
Si queremos que nuestro mysql se vea fuera del localhost tendremos que
editar el archivo /etc/mysql/my.cnf y comentar en la línea bind-address
agregando antes del bind el símbolo #
Deberá quedar asi
# 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
Universidad tecnoligica Lic en Redes
Melquiades García
Hay que reiniciar la base de datos con el siguiente comando
/etc/init.d/mysql restart
Ahora hay que verificar que la base de datos esta funcionando con el
siguiente comando
netstat -tap | grep mysql
les deberá mostar un mensaje parecido a este
tcp 0 0 *:mysql *:* LISTEN 9732/mysqld
Durante la instalación de los certificados de SSL para IMAP-SSL y POP3-SSL fueron
creados para localhost para cambiarlos con el host correcto en mi caso
server1.example.com hay que borrarlos con el siguiente comando en terminal
cd /etc/courier
rm -f /etc/courier/imapd.pem
rm -f /etc/courier/pop3d.pem
Y hay que modificar 2 líneas cambiar CN: localhost Por CN:server1.example.com
Para esto buscamos los siguientes archivos
/etc/courier/imapd.cnf
/etc/courier/pop3d.cnf
Y modificar y en la línea CN debe quedar así “Dependiendo del nombre de host que le
Allan puesto a su server”
CN=server1.example.com
Luego hay que recrear los certificados que borramos arriba para esto
ejecutamos en terminal
Mkimapdcert
mkpop3dcert
Y reiniciar el Courier-IMAP-SSL y Courier-POP3-SSL con el comando
Universidad tecnoligica Lic en Redes
Melquiades García
/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop-ssl restart
Installation de Amavisd-new, SpamAssassin, And Clamav
Para instalar esto ejecutamos lo siguiente en terminal
aptitude 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
Instalación de Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And
mcrypt
Para instalar esto ejecutamos lo siguiente en terminal
aptitude install apache2 apache2.2-common apache2-doc apache2-mpm-prefork
apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-
gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid
apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick
imagemagick libapache2-mod-suphp libopenssl-ruby libapache2-mod-ruby
al instalar esto nos preguntara lo siguiente y respondemos como pongo a
continuación.
Web server to reconfigure automatically: <-- apache2
Configure database for phpmyadmin with dbconfig-common? <-- No
Hay que correr el siguiente comando para activar los siguiente módulos de
apache2 suexec, rewrite, ssl, actions
a2enmod suexec rewrite ssl actions include
a2enmod dav_fs dav auth_digest
Después ahí que reiniciar apache escribimos en terminal
/etc/init.d/apache2 restart
Universidad tecnoligica Lic en Redes
Melquiades García
Instalando PureFTPd y Quota
Se instala con el siguiente comando
aptitude install pure-ftpd-common pure-ftpd-mysql quota quotatool
Después de esto ahí que editar el archive /etc/default/pure-ftpd-common
Buscar estas líneas que que quede así
STANDALONE_OR_INETD=standalone
Y la otra línea
VIRTUALCHROOT=true
Después de esto hay que reiniciar el PureFTPd con el siguiente comando
/etc/init.d/pure-ftpd-mysql restart
Luego hay que editar el siguiente archive /etc/fstab
Debe quedar igual a lo que pondré a continuación
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/mapper/server1-root / ext4 errors=remount-
ro,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 1
# /boot was on /dev/sda1 during installation
UUID=9eef7b6b-5688-456c-8fe2-05ae739e3635 /boot ext2
defaults 0 2
/dev/mapper/server1-swap_1 none swap sw 0
0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0
0
Para habilitar Quota hay que correr el siguiente comando en Terminal
Universidad tecnoligica Lic en Redes
Melquiades García
touch /aquota.user /aquota.group
chmod 600 /aquota.*
mount -o remount /
Luego
quotacheck -avugm
quotaon -avug
Instalacion deBIND DNS Server
Con el siguiente comando en terminal se instala
aptitude install bind9 dnsutils
Instalacion Vlogger, Webalizer, y AWstats
Con el siguiente comando en terminal
aptitude install vlogger webalizer awstats
y luego
cp -prf /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl
/usr/share/awstats/tools/awstats_buildstaticpages.pl
Isntalacion de JailKit
Jailkit es para usuarios ssh no se puede instalar después de instalar el ISPConfig
si no antes
Para instalar corremos el siguiente comando
aptitude install build-essential autoconf automake1.9 libtool flex bison debhelper
y Luego
cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.11.tar.gz
tar xvfz jailkit-2.11.tar.gz
cd jailkit-2.11
Universidad tecnoligica Lic en Redes
Melquiades García
./debian/rules binary
cd ..
dpkg -i jailkit_2.11-1_*.deb
rm -rf jailkit-2.11*
Instalar fail2ban
Es un monitor muy bueno es opcional pero recomendable para los los de
ISPCONFIG
En terminal escribimos lo siguiente
aptitude install fail2ban
Instalación de squirrelmail clienteWeb de Email
En terminal ejecutamos lo siguiente
aptitude install squirrelmail
Luego
ln -s /usr/share/squirrelmail/ /var/www/webmail
Luego debemos configurar Squirrelmail ejecutamos
squirrelmail-configure
Observen que al momento de configurar deben solo poner como les pongo a
continuación
quirrelMail 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
Universidad tecnoligica Lic en Redes
Melquiades García
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 >> <-- D Selecionar 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 Escribir la Palabra Courier
SquirrelMail Configuration : Read: config.php
---------------------------------------------------------
Universidad tecnoligica Lic en Redes
Melquiades García
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
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... <-- ENTER Precionar ENTER
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
Universidad tecnoligica Lic en Redes
Melquiades García
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 Seleccionar 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 >> S
Data saved in config.php
Press enter to continue... <-- ENTER Presionar Enter
Universidad tecnoligica Lic en Redes
Melquiades García
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 Seleccionar Q
Despues de esto ya esta su cliente web de email el cual pueden probar en la
maquina de 2 formas uno escribiendo el nombre del host que le hemos puesto en
mi caso seria http://server1.example.com/webmail o bien
http://192.168.0.100/webmail “la IP es diferente dependiendo de que ip
tenga en la pc”
Ahora comenzaremos con la instalación de ISPCONFIG
Descargamos la Ultima versión desde la siguiente url
http://sourceforge.net/projects/ispconfig/files/ISPConfig%203/ISPConfig-3.0.3.3/ISPConfig-
3.0.3.3.tar.gz/download
Por lo general van a tener el ISPConfig en la carpeta Downloads luego allí lo descomprimen
Asumiendo que lo tienen de esa manera nos dirigimos a esa carpeta por medio del comando cd en
terminal
Universidad tecnoligica Lic en Redes
Melquiades García
Un ejemplo seria
Cd - /home/aquí va el nombre de la carpeta de user/Downloads/ispconfig3_install/install/
Luego
php -q Install-php
Les saldrá lo siguiente en el cual deberán poner los datos como pongo a continuación la
configuración cambiara dependiendo a los datos que cada uno ponga como nombre de server y
base de datos
--------------------------------------------------------------------------------
_____ ___________ _____ __ _
|_ _/ ___| ___ \ / __ \ / _(_)
| | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` |
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| |
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, |
__/ |
|___/
--------------------------------------------------------------------------------
>> Initial configuration
Operating System: Debian Squeeze/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]: <-- ENTER Presionar Enter dejar Igual
Installation mode (standard,expert) [standard]: <-- ENTER Presionar Enter dejar Igual
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.example.com]: <--
Aqui deberan poner el nombre del server que allan puesto anteriormente en mi caso siempre fue
server1.example.com asi que solamente le doy enter
MySQL server hostname [localhost]: <-- ENTER Presionar Enter dejar Igual
Universidad tecnoligica Lic en Redes
Melquiades García
MySQL root username [root]: <-- ENTER Presionar Enter dejar Igual
MySQL root password []: <-- Aquí deben poner la contraseña de su base de datos que
anteriormente pusimos “Recomenddable”
MySQL database to create [dbispconfig]: <-- ENTER Presionar Enter dejar Igual
MySQL charset [utf8]: <-- ENTER Presionar Enter dejar Igual
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 Presionar Enter dejar Igual
State or Province Name (full name) [Some-State]: <-- ENTER Presionar Enter dejar Igual
Locality Name (eg, city) []: <-- ENTER Presionar Enter dejar Igual
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- ENTER Presionar Enter dejar Igual
Organizational Unit Name (eg, section) []: <-- ENTER Presionar Enter dejar Igual
Common Name (eg, YOUR name) []: <-- ENTER Presionar Enter dejar Igual
Email Address []: <-- ENTER Presionar Enter dejar Igual
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 Firewall
Installing ISPConfig
Universidad tecnoligica Lic en Redes
Melquiades García
ISPConfig Port [8080]: <-- ENTER Presionar Enter dejar Igual
Configuring DBServer
Installing Crontab
no crontab for root
no crontab for getmail
Restarting services ...
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart mysql
mysql start/running, process 24840
* Stopping Postfix Mail Transport Agent postfix
...done.
* Starting Postfix Mail Transport Agent postfix
...done.
* Stopping SASL Authentication Daemon saslauthd
...done.
* Starting SASL Authentication Daemon saslauthd
...done.
Stopping amavisd: amavisd-new.
Starting amavisd: amavisd-new.
* Stopping ClamAV daemon clamd
...done.
* Starting ClamAV daemon clamd
...done.
* Stopping Courier authentication services authdaemond
...done.
* Starting Courier authentication services authdaemond
...done.
* Stopping Courier IMAP server...
...done.
* Starting Courier IMAP server...
...done.
* Stopping Courier IMAP-SSL server...
...done.
* Starting Courier IMAP-SSL server...
...done.
* Stopping Courier POP3 server...
...done.
* Starting Courier POP3 server...
...done.
Universidad tecnoligica Lic en Redes
Melquiades García
* Stopping Courier POP3-SSL server...
...done.
* Starting Courier POP3-SSL server...
...done.
* Restarting web server apache2
... waiting .. ...done.
Restarting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l mysql:/etc/pure-
ftpd/db/mysql.conf -l pam -H -E -b -O clf:/var/log/pure-ftpd/transfer.log -8 UTF-8 -u 1000 -A -B
Installation completed.
root@server1:/tmp/ispconfig3_install/install#
Con esto ya está la instalación complete y deberá funcionar bien para verificar y entrar al ispconfig
deberán entrar a su navegador y pueden entrar de 2 maneras localhost:8080 o en mi caso
server1.example.com:8080
Problemas y Soluciones
Al momento de entrar a phpmyadmin le puede tirar un error con el siguiente mensaje
The requested URL /phpmyadmin was not found on this server.
Se soluciona colocando el siguiente comando en terminal
ln -s /usr/share/phpmyadmin /var/www/phpmyadmin