User Tools

Site Tools


informatica:linux:mediawiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:linux:mediawiki [2013/08/27 11:28] – [Envio de correos] javiinformatica:linux:mediawiki [2015/04/13 20:19] (current) – external edit 127.0.0.1
Line 155: Line 155:
  
   # TODO: fix this, needed by LDAP in mediawiki   # TODO: fix this, needed by LDAP in mediawiki
-  TLS_REQCERT never+  TLS_REQCERT allow
  
 5.2. Reinicio Apache 5.2. Reinicio Apache
Line 161: Line 161:
   sudo /etc/init.d/apache2 restart   sudo /etc/init.d/apache2 restart
      
 +==== Restringir login en funcion del grupo ====
 +
 +  * En este ejemplo ademas tomamos el e-mail de LDAP
 +  * Grupo LDAP requerido: "ldapwiki"
 +  * Usuario LDAP de ejemplo: "LDAP_USER_1"
 +
 +1. Objetos LDAP:
 +
 +<code>
 +# LDAP user
 +dn: cn=LDAP_USER_1,ou=people,dc=example,dc=com
 +cn: LDAP_USER_1
 +gidnumber: 10001
 +givenname: Name
 +homedirectory: /home/LDAP_USER_1
 +loginshell: /bin/bash
 +mail: LDAP_USER_1@example.com
 +objectclass: inetOrgPerson
 +objectclass: posixAccount
 +objectclass: top
 +sn: Surename
 +uid: LDAP_USER_1
 +uidnumber: 10001
 +userpassword: ******
 +
 +# LDAP group
 +dn: cn=ldapwiki,ou=groups,dc=example,dc=com
 +cn: ldapwiki
 +gidnumber: 10004
 +memberuid: LDAP_USER_1
 +memberuid: LDAP_USER_2
 +objectclass: posixGroup
 +objectclass: top
 +</code>
 +
 +2. Configuracion mediawiki (archivo "Localsettings.php"):
 +
 +<code>
 +# LDAP
 +require_once 'extensions/LdapAuthentication/LdapAuthentication.php';
 +require_once 'includes/AuthPlugin.php';
 +$wgAuth = new LdapAuthenticationPlugin();
 +$wgLDAPDomainNames = array(
 +  'openldap_example_com',
 +);
 +$wgLDAPServerNames = array(
 +  'openldap_example_com' => 'ldap.example.com',
 +);
 +$wgLDAPUseLocal = false;
 +$wgLDAPEncryptionType = array(
 +  'openldap_example_com' => 'tls',
 +);
 +$wgLDAPPort = array(
 +  'openldap_example_com' => 389,
 +);
 +$wgLDAPProxyAgent = array(
 +  'openldap_example_com' => 'cn=readonly,dc=example,dc=com',
 +);
 +$wgLDAPProxyAgentPassword = array(
 +  'openldap_example_com' => '*****',
 +);
 +$wgLDAPSearchAttributes = array(
 +  'openldap_example_com' => 'uid'
 +);
 +$wgLDAPBaseDNs = array(
 +  'openldap_example_com' => 'dc=example,dc=com',
 +);
 +# To pull e-mail address from LDAP
 +$wgLDAPPreferences = array(
 +  'openldap_example_com' => array( 'email' => 'mail')
 +);
 +# Group based restriction
 +$wgLDAPGroupUseFullDN = array( "openldap_example_com"=>false );
 +$wgLDAPGroupObjectclass = array( "openldap_example_com"=>"posixgroup" );
 +$wgLDAPGroupAttribute = array( "openldap_example_com"=>"memberuid" );
 +$wgLDAPGroupSearchNestedGroups = array( "openldap_example_com"=>false );
 +$wgLDAPGroupNameAttribute = array( "openldap_example_com"=>"cn" );
 +$wgLDAPRequiredGroups = array( "openldap_example_com"=>array("cn=ldapwiki,ou=groups,dc=example,dc=com"));
 +$wgLDAPLowerCaseUsername = array(
 +  'openldap_example_com' => true,
 +);
 +</code>
 ===== Reducir el numero de encabezados que genera un TOC (Table Of Contents) ===== ===== Reducir el numero de encabezados que genera un TOC (Table Of Contents) =====
  
Line 189: Line 271:
      
 ===== Envio de correos ===== ===== Envio de correos =====
 +
 +**TODO**: comprobar si los pasos 1 y 2 son necesarios si se usa ssmtp en lugar de postfix
 +
  
 1. Instalar PHP PEAR: 1. Instalar PHP PEAR:
Line 197: Line 282:
  
   sudo pear install mail net_smtp   sudo pear install mail net_smtp
-   + 
-3. Editar:+==== Postfix ==== 
 + 
 +1. Editar:
  
   sudo cp /srv/www/wiki/LocalSettings.php /srv/www/wiki/LocalSettings.php.bak   sudo cp /srv/www/wiki/LocalSettings.php /srv/www/wiki/LocalSettings.php.bak
Line 216: Line 303:
 $wgSMTP = array( $wgSMTP = array(
  'host'     => "127.0.0.1",  'host'     => "127.0.0.1",
- 'IDHost'   => "www-1.dev.local.jamgo.org",+ 'IDHost'   => "www-1.dev.local.example.com",
  'port'     => 25,  'port'     => 25,
  'auth'     => false,  'auth'     => false,
Line 224: Line 311:
 **IMPORTANTE**: el valor "IDHost" debe coincidir con el hostname (ejecutar comando "hostname") **IMPORTANTE**: el valor "IDHost" debe coincidir con el hostname (ejecutar comando "hostname")
  
-4. Editar el archivo de config de postfix:+2. Editar el archivo de config de postfix:
  
   sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.bak   sudo cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
Line 231: Line 318:
 Y asegurarse que las lineas quedan asi: Y asegurarse que las lineas quedan asi:
  
-  myhostname = www-1.dev.local.jamgo.org +  myhostname = www-1.dev.local.example.com 
-  mydestination = www-1.dev.local.jamgo.org+  mydestination = www-1.dev.local.example.com
  
-5. Reiniciar servicios:+3. Reiniciar servicios:
  
   sudo /etc/init.d/postfix restart   sudo /etc/init.d/postfix restart
   sudo /etc/init.d/apache restart   sudo /etc/init.d/apache restart
 + 
 +==== Ssmtp ====
 +
 +1. Editar:
 +
 +  sudo cp /srv/www/wiki/LocalSettings.php /srv/www/wiki/LocalSettings.php.bak
 +  sudo vim /srv/www/wiki/LocalSettings.php
      
-6. Configurar el usuario "vigilante" para que reciba correos+Y anyadir las siguientes lineas:
  
-6.1. Iniciar sesion en mediawiki+<code> 
 +# Email 
 +$wgEnableEmail = true; 
 +$wgEnableUserEmail = true; 
 +$wgEmergencyContact = "admin@example.com"; 
 +$wgPasswordSender = "app_robot@www-1.dev.local.example.com"; 
 +$wgEnotifUserTalk = true; 
 +$wgEnotifWatchlist = true; 
 +</code>
  
-6.2. Ir a "preferences/user profile"+==== Comprobar sistema de correo ==== 
 +  
 +1Configurar el usuario "vigilantepara que reciba correos
  
-6.3Asegurarse que tiene direccion de correo valida y marcar todas las opciones de la caja "Email options"+1.1Iniciar sesion en mediawiki
  
-6.4Editar "paginay hacerle un watch.+1.2Ir a "preferences/user profile"
  
-7Iniciar sesion Con el usuario "A" editar "paginay grabar. +1.3. Asegurarse que tiene direccion de correo valida marcar todas las opciones de la caja "Email options"
  
-Deberia enviarse el correoSi no es asi, por si acaso cerrar sesion con ambos usuarios, iniciar sesion con usuario "vigilante", desmarcar volver a marcar la pagina "pagina" como "watch" y repetir el paso 7.+1.4. Editar "pagina" y hacerle un watch.
  
 +2. Iniciar sesion Con el usuario "A" y editar "pagina" y grabar. 
 +
 +Deberia enviarse el correo. Si no es asi, por si acaso cerrar sesion con ambos usuarios, iniciar sesion con usuario "vigilante", desmarcar y volver a marcar la pagina "pagina" como "watch" y repetir el paso 7.
 ===== Contrasenas ===== ===== Contrasenas =====
  
informatica/linux/mediawiki.txt · Last modified: 2015/04/13 20:19 by 127.0.0.1