miércoles, 10 de noviembre de 2010

Instalacion de horde webmail

Despues de tanto tiempo vuelvo a postear en mi blog pero lo que tarda vale la pena asi que ahi vamos



Bueno lo que voy a explicar es como instalar en CentOS un webmail llamado horde, este sistema es muy completo:

Entre los proyectos Horde se encuentran:

* Horde – Se trata del framework sobre el que trabajan el resto de aplicaciones. Es el único módulo no opcional del sistema Horde.

* IMP – Sistema webmail que permite el acceso a buzones POP3 o IMAP.

* MIMP – Derivativo de IMP, con un interfaz mínimo para hacerlo usable en dispositivos móviles.

* DIMP – Derivativo de IMP, con interfaz basado en AJAX, con el objeto de hacerlo más dinámico y rápido.

* Ingo – Sistema de gestión y aplicación de reglas de filtrado de correo.

* Turba – Agenda de contactos.

* Mnemo – Gestor de notas.

* Kronolith – Gestión de agendas y calendarios con funciones de grupo.

* Nag – Gestor de listas de tareas.

Si tienen mas dudas sobre cada uno visiten la pagina de cada unos de los proyectos

Bueno lo primero que tenemos que hacer es verificar si nuestro dovecot este bien configurado en la opción del inbox, y que este activado el protocolo imap y imaps ya que es el mejor soportado por Horde, también soporta pop3 pero imap es el recomendable.



Una vez dicho lo anterior necesitamos instalar los siguientes:

apache
mysql
php y algunos de sus modulos

asi que manos a la obra

~]# yum install -y httpd mysql-server


~]# yum install -y php php-mysql php-xml php-imap php-mbstring php-mcrypt php-pecl-Fileinfo php-pecl-memcache php-pear-DB php-pear-File php-pear-Log php-pear-Mail-Mime php-pear-Auth-SASL php-pear-Date php-pear-HTTP-Request php-pear-Mail php-pear-Net-Sieve php-pear-Net-Socket php-pear-Net-SMTP

algunas bibliotecas y modulos extras para que todo funcione como debe

~]# yum install php-pear

~]# pear install DB Date File HTML_Common HTML_QuickForm HTML_QuickForm_Controller HTML_Table HTML_TreeMenu HTTP_Request Log MDB2 MDB2_Driver_mysql Mail Mail_Mime Mail_mimeDecode Net_SMTP Net_Sieve Net_Socket Net_URL XML_Parser Auth_SASL Mail_Mbox-0.5.1 Tree-0.3.3

Instalamos el Gd grafico para PHP

~]# yum install php-gd


bueno ya después de haber instalado los paquetes vamos a descargamos el paquete mas reciente de horde webmail eso lo podemos hacer desde este aqui


2.- CREACION DE LOS PERMISOS NECESARIOS EN LA BASE DE DATOS.

Horde utiliza una estructura predefinida para guardar la información que cada usuario necesita para usar su cuenta de correo, tales como configuraciones, preferencias, tipos de sesión, etc. Para esto es necesario el uso de una base de datos donde almacenar esta información.
Para esto se ha usado al servidor de base de datos dbserver
[root@dbserver ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 60
Server version: 5.0.45-log Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘User’@’192.168.1.%’ IDENTIFIED BY ‘claveroot’;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON horde.* TO hordeuser@’192.168.2.%’ IDENTIFIED BY ‘clavehorde’;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
Bye

3.- INSTALACION, CONFIGURACION Y PRUEBAS DE WEBMAIL HORDE.


Descomprimimos el horde webmail en la carpeta /var/www/html y renombramos esa carpeta en el directorio horde
[root@server horde]# tar xfv horde-webmail-x.x.x.tar.gz -C /var/www/html/
[root@server horde]# cd /var/www/html/
[root@server html]# ll
total 4
drwxr-xr-x 24 root root 4096 Jun 13 18:56 horde-webmail-1.1.1
[root@server html]# mv horde-webmail-x.x.x/ horde
Ahora configuramos los archivos necesarios para establecer la conexión con el mysql
[root@server scripts]# cd /var/www/html/horde/scripts/
[root@server scripts]# ./setup.php
What is the web root path on your web server for this installation, i.e. the path of the address you use to access Horde Groupware Webmail Edition in your browser? [/horde]
Horde Groupware Webmail Edition Configuration Menu
(0) Exit
(1) Configure database settings
(2) Create database or tables
(3) Configure administrator settings
Type your choice: 1
What database backend should we use? [false]
(false) [None]
(dbase) dBase
(ibase) Firebird/InterBase
(fbsql) Frontbase
(ifx) Informix
(msql) mSQL
(mssql) MS SQL Server
(mysql) MySQL
(mysqli) MySQL (mysqli)
(oci8) Oracle
(odbc) ODBC
(pgsql) PostgreSQL
(sqlite) SQLite
(sybase) Sybase
Type your choice: mysql
Request persistent connections? [0]
(1) Yes
(0) No
Type your choice: 0
Username to connect to the database as* [] hordeuser
Password to connect with [] clavehorde
How should we connect to the database? [unix]
(unix) UNIX Sockets
(tcp) TCP/IP
Type your choice: tcp
Database server/host* [] servidor que va a contener la base de datos (nombre)
Port the DB is running on, if non-standard [3306]
Database name to use* [] horde
Internally used charset* [iso-8859-1] ENTER
Split reads to a different server? [false] ENTER
(false) Disabled
(true) Enabled
Type your choice: ENTER
Done configuring database settings.
Horde Groupware Webmail Edition Configuration Menu
(0) Exit
(1) Configure database settings
(2) Create database or tables
(3) Configure administrator settings
Type your choice: 2
Should we create the database for you? If yes, you need to provide a database
user that has permissions to create new databases on your system. If no, we
will only create the database tables for you. [y]
(y) Yes
(n) No
Type your choice: y
Database user for creating the database if necessary for your database system: User
Specify a password for the database user: claveroot
Loading database module…
Creating database…
[ OK ] Successfully created the database.
[ OK ] Successfully created the tables for Mail (imp).
[ OK ] Successfully created the tables for Address Book (turba).
[ OK ] Successfully created the tables for Calendar (kronolith).
[ OK ] Successfully created the tables for Tasks (nag).
[ OK ] Successfully created the tables for Notes (mnemo).
Done creating database or tables.
Horde Groupware Webmail Edition Configuration Menu
(0) Exit
(1) Configure database settings
(2) Create database or tables
(3) Configure administrator settings
Type your choice: 0
Thank you for using Horde Groupware Webmail Edition!
Ahora creamos la zona de virtual host en el apache para que el directorio este protegido y disponible, y agregamos lo siguiente
[root@smtpin01 scripts]#nano /etc/httpd/conf.d/horde.conf
#
# Horde
#
Alias /horde /var/www/html/horde
#
# Horde
#
#Alias /horde /var/www/html/horde
# Uncomment the following 3 lines to make Horde locally accessible only
#Order Deny,Allow
#Deny from all
#Allow from 127.0.0.1
Options +FollowSymLinks
# horde.org’s recommended PHP settings:
php_admin_flag safe_mode off
php_admin_flag magic_quotes_runtime off
php_flag session.use_trans_sid off
php_flag session.auto_start off
php_admin_flag file_uploads on
# Optional – required for weather block in Horde to function
php_admin_flag allow_url_fopen on
# If horde dies while trying to handle large email file attachments,
# you are probably hitting PHP’s memory limit. Raise that limit here,
# but use caution
# Set to your preference – memory_limit should be at least 32M
# and be greater than the value set for post_max_size
#php_value memory_limit 32M
#php_value post_max_size 20M
#php_value upload_max_filesize 10M
# /usr/share/pear is needed for PEAR. /var/www/html/horde is needed for Horde itself
# TODO: Set an appropriate include_path, too. Might even increase speed a bit.
php_admin_value open_basedir “/var/www/html/horde:/var/www/html/horde/config:/usr/share/pear:/tmp”
php_admin_flag register_globals off
Order Deny,Allow
Deny from all
# Deny access to files that are not served directly by the webserver
Order Deny,Allow
Deny from all
# Deny access to the test.php files except from localhost
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Cambiamos los permisos horde.conf, para que este archivo se asegure de una manera adecuada
[root@smtpin01 ~]#chmod 0644 -v /etc/httpd/conf.d/horde.conf
Ahora incrementamos el parámetro memory_limit en /etc/php.ini a 64MB, como mínimo
memory_limit = 64M
Y restauramos al servicio de apache
[root@smtpin01 scripts]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Como el servidor va a solventar el ingreso a varios dominios, es necesario configurar los servidores a los cuales podrian ingresar desde la pagina principal del webmail.
[root@smtpin01 scripts]# nano /var/www/html/horde/imp/config/servers.php
$servers['imap00'] = array(
‘name’ => ‘SERVIDOR UNO’,
‘server’ => ‘serveruno.dominio1.com’,
‘hordeauth’ => false,
‘protocol’ => ‘imap/notls’,
‘port’ => 143,
‘maildomain’ => ‘dominio1.com’,
‘smtphost’ => ‘localhost’,
‘smtpport’ => 25,
‘realm’ => ”,
‘preferred’ => ”,
‘driver’ => array(
‘driver’ => ‘courier’,
‘params’ => array(),
),
);
$servers['imap01'] = array(
‘name’ => ‘SERVER-DOS’,
‘server’ => ‘serverdos.dominio2.com’,
‘hordeauth’ => false,
‘protocol’ => ‘imap/notls’,
‘port’ => 143,
‘maildomain’ => ‘dominio2.com’,
‘smtphost’ => ‘localhost’,
‘smtpport’ => 25,
‘realm’ => ”,
‘preferred’ => ”,
‘driver’ => array(
‘driver’ => ‘courier’,
‘params’ => array(),
),
);
);
Para que los servidores se muestren como una lista en el ingreso del webmail
[root@smtpin01 config]# nano /var/www/html/horde/imp/config/conf.php
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
// $Horde: imp/config/conf.xml,v 1.53.2.33 2008/05/06 17:54:04 slusarz Exp $
$conf['spell']['driver'] = ”;
$conf['utils']['gnupg_keyserver'] = array(‘pgp.mit.edu’);
$conf['utils']['gnupg_timeout'] = 10;
$conf['menu']['apps'] = array();
$conf['user']['select_sentmail_folder'] = false;
$conf['user']['allow_resume_all_in_drafts'] = false;
$conf['user']['allow_folders'] = true;
$conf['user']['allow_resume_all'] = false;
$conf['user']['allow_view_source'] = true;
$conf['user']['alternate_login'] = false;
$conf['user']['redirect_on_logout'] = false;
$conf['user']['select_view'] = true;
$conf['server']['change_server'] = false;
$conf['server']['change_port'] = false;
$conf['server']['change_protocol'] = false;
$conf['server']['change_smtphost'] = false;
$conf['server']['change_smtpport'] = false;
$conf['server']['server_list'] = ‘shown’;
$conf['server']['fixed_folders'] = array();
$conf['server']['sort_limit'] = 0;
$conf['server']['cache_folders'] = true;
$conf['server']['token_lifetime'] = 1800;
$conf['server']['cachejs'] = ‘none’;
$conf['server']['cachecss'] = ‘none’;
$conf['mailbox']['show_preview'] = false;
$conf['fetchmail']['show_account_colors'] = false;
$conf['fetchmail']['size_limit'] = 4000000;
$conf['msgcache']['use_msgcache'] = false;
$conf['mlistcache']['use_mlistcache'] = false;
$conf['msgsettings']['filtering']['words'] = ‘./config/filter.txt’;
$conf['msgsettings']['filtering']['replacement'] = ‘****’;
$conf['spam']['reporting'] = false;
$conf['notspam']['reporting'] = false;
$conf['print']['add_printedby'] = false;
$conf['msg']['prepend_header'] = true;
$conf['msg']['append_trailer'] = true;
$conf['compose']['allow_receipts'] = true;
$conf['compose']['special_characters'] = true;
$conf['compose']['use_vfs'] = false;
$conf['compose']['link_all_attachments'] = false;
$conf['compose']['link_attachments_notify'] = true;
$conf['compose']['link_attachments'] = true;
$conf['compose']['attach_size_limit'] = 0;
$conf['compose']['attach_count_limit'] = 0;
$conf['compose']['reply_limit'] = 200000;
$conf['hooks']['vinfo'] = false;
$conf['hooks']['postlogin'] = false;
$conf['hooks']['postsent'] = false;
$conf['hooks']['signature'] = false;
$conf['hooks']['trailer'] = false;
$conf['hooks']['fetchmail_filter'] = false;
$conf['hooks']['mbox_redirect'] = false;
$conf['hooks']['mbox_icon'] = false;
$conf['hooks']['spam_bounce'] = false;
$conf['hooks']['msglist_format'] = false;
$conf['maillog']['use_maillog'] = true;
$conf['sentmail']['driver'] = ‘none’;
$conf['tasklist']['use_tasklist'] = true;
$conf['notepad']['use_notepad'] = true;
/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */

4.- ASEGURAMIENTO DE ARCHIVOS EXPUESTOS AL INTERNET.

Ahora aseguramos los archivos y directorios expuestos al Internet, para que tengan las seguridades suficientes
[root@smtpin01]# chown apache:root -R /var/www/html/horde/config
[root@smtpin01]# chown apache:root -R /var/www/html/horde/*/config
[root@smtpin01]# chmod -R go-rwx /var/www/html/horde/config
[root@smtpin01]# chmod -R go-rwx /var/www/html/horde/*/config
[root@smtpin01]# chown -R root:root /var/www/html/horde/scripts
[root@smtpin01]# chown -R root:root /var/www/html/horde/*/scripts
[root@smtpin01]# chmod -R go-rwx /var/www/html/horde/scripts
[root@smtpin01]# chmod -R go-rwx /var/www/html/horde/*/scripts
[root@smtpin01]# chmod a-rwx /var/www/html/horde/test.php
[root@smtpin01]# chmod a-rwx /var/www/html/horde/*/test.php

ya despues solo entramos al navegador
http://tuip/horde/ o en su defecto http://localhost/horde

referencia http://juancagomez.wordpress.com/2008/08/19/instalacion-de-horde-webmail/

dudas comentarios ya saben

No hay comentarios: