informatica:linux:mediawiki
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
informatica:linux:mediawiki [2013/06/26 09:54] – javi | informatica:linux:mediawiki [2015/04/13 20:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 136: | Line 136: | ||
$wgLDAPBaseDNs = array( | $wgLDAPBaseDNs = array( | ||
' | ' | ||
+ | ); | ||
+ | # Optional: to pull e-mail address for the user from LDAP | ||
+ | $wgLDAPPreferences = array( | ||
+ | ' | ||
); | ); | ||
Line 151: | Line 155: | ||
# TODO: fix this, needed by LDAP in mediawiki | # TODO: fix this, needed by LDAP in mediawiki | ||
- | TLS_REQCERT | + | TLS_REQCERT |
5.2. Reinicio Apache | 5.2. Reinicio Apache | ||
sudo / | sudo / | ||
+ | | ||
+ | ==== Restringir login en funcion del grupo ==== | ||
+ | |||
+ | * En este ejemplo ademas tomamos el e-mail de LDAP | ||
+ | * Grupo LDAP requerido: " | ||
+ | * Usuario LDAP de ejemplo: " | ||
+ | |||
+ | 1. Objetos LDAP: | ||
+ | |||
+ | < | ||
+ | # LDAP user | ||
+ | dn: cn=LDAP_USER_1, | ||
+ | cn: LDAP_USER_1 | ||
+ | gidnumber: 10001 | ||
+ | givenname: Name | ||
+ | homedirectory: | ||
+ | loginshell: /bin/bash | ||
+ | mail: LDAP_USER_1@example.com | ||
+ | objectclass: | ||
+ | objectclass: | ||
+ | objectclass: | ||
+ | sn: Surename | ||
+ | uid: LDAP_USER_1 | ||
+ | uidnumber: 10001 | ||
+ | userpassword: | ||
+ | |||
+ | # LDAP group | ||
+ | dn: cn=ldapwiki, | ||
+ | cn: ldapwiki | ||
+ | gidnumber: 10004 | ||
+ | memberuid: LDAP_USER_1 | ||
+ | memberuid: LDAP_USER_2 | ||
+ | objectclass: | ||
+ | objectclass: | ||
+ | </ | ||
+ | |||
+ | 2. Configuracion mediawiki (archivo " | ||
+ | |||
+ | < | ||
+ | # LDAP | ||
+ | require_once ' | ||
+ | require_once ' | ||
+ | $wgAuth = new LdapAuthenticationPlugin(); | ||
+ | $wgLDAPDomainNames = array( | ||
+ | ' | ||
+ | ); | ||
+ | $wgLDAPServerNames = array( | ||
+ | ' | ||
+ | ); | ||
+ | $wgLDAPUseLocal = false; | ||
+ | $wgLDAPEncryptionType = array( | ||
+ | ' | ||
+ | ); | ||
+ | $wgLDAPPort = array( | ||
+ | ' | ||
+ | ); | ||
+ | $wgLDAPProxyAgent = array( | ||
+ | ' | ||
+ | ); | ||
+ | $wgLDAPProxyAgentPassword = array( | ||
+ | ' | ||
+ | ); | ||
+ | $wgLDAPSearchAttributes = array( | ||
+ | ' | ||
+ | ); | ||
+ | $wgLDAPBaseDNs = array( | ||
+ | ' | ||
+ | ); | ||
+ | # To pull e-mail address from LDAP | ||
+ | $wgLDAPPreferences = array( | ||
+ | ' | ||
+ | ); | ||
+ | # Group based restriction | ||
+ | $wgLDAPGroupUseFullDN = array( " | ||
+ | $wgLDAPGroupObjectclass = array( " | ||
+ | $wgLDAPGroupAttribute = array( " | ||
+ | $wgLDAPGroupSearchNestedGroups = array( " | ||
+ | $wgLDAPGroupNameAttribute = array( " | ||
+ | $wgLDAPRequiredGroups = array( " | ||
+ | $wgLDAPLowerCaseUsername = array( | ||
+ | ' | ||
+ | ); | ||
+ | </ | ||
+ | ===== Reducir el numero de encabezados que genera un TOC (Table Of Contents) ===== | ||
+ | |||
+ | Por defecto 4+ encabezados generan un TOC. | ||
+ | |||
+ | Si se quiere alterar al alza, probar esta extension: | ||
+ | |||
+ | https:// | ||
+ | |||
+ | Si se quiere reducir: | ||
+ | |||
+ | 1. Backup files | ||
+ | |||
+ | cp ~/ | ||
+ | sudo vim ~/ | ||
+ | |||
+ | 2. Replace the ' | ||
+ | |||
+ | ( ( $numMatches >= 4 ) || $this-> | ||
+ | |||
+ | With the number that you want, for instance 2: | ||
+ | |||
+ | ( ( $numMatches >= 2 ) || $this-> | ||
+ | |||
+ | ===== Redirecciones ===== | ||
+ | |||
+ | #REDIRECT [[pagename]] | ||
+ | | ||
+ | ===== 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: | ||
+ | |||
+ | sudo aptitude update; sudo aptitude install php-pear | ||
+ | | ||
+ | 2. Instalar paquetes PEAR: | ||
+ | |||
+ | sudo pear install mail net_smtp | ||
+ | |||
+ | ==== Postfix ==== | ||
+ | |||
+ | 1. Editar: | ||
+ | |||
+ | sudo cp / | ||
+ | sudo vim / | ||
+ | | ||
+ | Y anyadir las siguientes lineas: | ||
+ | |||
+ | < | ||
+ | |||
+ | $wgEnableEmail = true; | ||
+ | $wgEnableUserEmail = true; | ||
+ | $wgEmergencyContact = " | ||
+ | $wgPasswordSender = " | ||
+ | $wgEnotifUserTalk = true; | ||
+ | $wgEnotifWatchlist = true; | ||
+ | $wgEmailAuthentication = true; | ||
+ | $wgSMTP = array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | </ | ||
+ | |||
+ | **IMPORTANTE**: | ||
+ | |||
+ | 2. Editar el archivo de config de postfix: | ||
+ | |||
+ | sudo cp / | ||
+ | sudo vim / | ||
+ | | ||
+ | Y asegurarse que las lineas quedan asi: | ||
+ | |||
+ | myhostname = www-1.dev.local.example.com | ||
+ | mydestination = www-1.dev.local.example.com | ||
+ | |||
+ | 3. Reiniciar servicios: | ||
+ | |||
+ | sudo / | ||
+ | sudo / | ||
+ | |||
+ | ==== Ssmtp ==== | ||
+ | |||
+ | 1. Editar: | ||
+ | |||
+ | sudo cp / | ||
+ | sudo vim / | ||
+ | | ||
+ | Y anyadir las siguientes lineas: | ||
+ | |||
+ | < | ||
+ | |||
+ | $wgEnableEmail = true; | ||
+ | $wgEnableUserEmail = true; | ||
+ | $wgEmergencyContact = " | ||
+ | $wgPasswordSender = " | ||
+ | $wgEnotifUserTalk = true; | ||
+ | $wgEnotifWatchlist = true; | ||
+ | </ | ||
+ | |||
+ | ==== Comprobar sistema de correo ==== | ||
+ | |||
+ | 1. Configurar el usuario " | ||
+ | |||
+ | 1.1. Iniciar sesion en mediawiki | ||
+ | |||
+ | 1.2. Ir a " | ||
+ | |||
+ | 1.3. Asegurarse que tiene direccion de correo valida y marcar todas las opciones de la caja "Email options" | ||
+ | |||
+ | 1.4. Editar " | ||
+ | |||
+ | 2. Iniciar sesion Con el usuario " | ||
+ | |||
+ | Deberia enviarse el correo. Si no es asi, por si acaso cerrar sesion con ambos usuarios, iniciar sesion con usuario " | ||
+ | ===== Contrasenas ===== | ||
+ | |||
+ | Seleccionar la base de datos correspondiente: | ||
+ | |||
+ | use mediawikidb; | ||
+ | |||
+ | Para cambiar la password de un user normal: | ||
+ | |||
+ | update user set user_password=md5(concat(user_id,' | ||
+ | |||
+ | Para cambiar la password del WikiSysop: | ||
+ | |||
+ | update user set user_password=md5(concat(' | ||
+ | |||
+ | Para agregar un user (un userName siempre debe comezar por mayúscula): | ||
+ | |||
+ | insert into user(user_name) values (" | ||
+ |
informatica/linux/mediawiki.1372240478.txt.gz · Last modified: 2015/04/13 20:19 (external edit)