[Reddes] [Reddes.bvs-tech] Tutorial de Compel para LILDBI

Facundo Matias Victor Turi fvictor at bblanca.com.ar
Mon Aug 19 15:33:49 BRST 2013


Estimado Suga,

No hay problema, mientras utilicen el tutorial contenido en archivo
Wordadjunto sin utilizar referencias a nuestros servidores,
IPs, ó dominios, solo por seguridad. Pueden traducirlo y publicarlo en la
wiki, en el idioma que necesiten.

Muchas gracias!
Saludos atte.
Lic. Facundo Victor
Compel Computación Electrónica S.R.L.


El 19 de agosto de 2013 12:24, Suga, Sueli Mitiko Yano (BIR) <
sugasuel at bireme.ops-oms.org> escribió:

>  Estimado Facundo Matias,
>
> Mori y yo tuvimos la misma idea... Ya estaba escribiendo este correo
> cuando veí la pregunta de él.
>
> Si nos permite, podemos traducir para portugués e inglés en nuestras wikis
> http://wiki.bireme.org/
>
> Gracias!
>
> Atentamente,
> Sueli Mitiko Yano Suga
> BIREME/OPS/OMS
>  ------------------------------
> *De:* reddes.bvs-tech-bounces at listas.bireme.br [
> reddes.bvs-tech-bounces at listas.bireme.br] em nome de Mori, Marcos (BIR) [
> morimarc at bireme.ops-oms.org]
> *Enviado:* segunda-feira, 19 de agosto de 2013 10:34
> *Para:* fvictor at bblanca.com.ar; Silva, Asael Costa da (BIR)
> *Cc:* reddes.bvs-tech at listas.bireme.br
> *Assunto:* [Reddes.bvs-tech] RES: Tutorial de Compel para LILDBI
>
>   Hola Facundo Matias, todo  bien?
>
> Muchas gracias por su contribución.
>
>  Para que su valiosa contribución no se quede solo en el email
> y así más difícil de buscar. Gustaría de preguntar si usted tiene un página
> con esa información o si usted autoriza a publicar en nuestra página wiki?
>
>  Saludos,
>
>  Marcos Luis Mori
> RST/MTI
> BIREME/OPS/OMS
>
>  ------------------------
>
>  Mi Nuevo email: morimarc at paho.org
>
>
>  Siga-nos no twitter: https://twitter.com/ComunidadRedDes/
> Curta a nossa página: https://www.facebook.com/ComunidadRedDes
>
>
>  ------------------------------
> *De:* reddes.bvs-tech-bounces at listas.bireme.br [
> reddes.bvs-tech-bounces at listas.bireme.br] em nome de Silva, Asael Costa
> da (BIR)
> *Enviado:* segunda-feira, 19 de agosto de 2013 10:10
> *Para:* reddes.bvs-tech at listas.bireme.br
> *Assunto:* [Reddes.bvs-tech] FW: Tutorial de Compel para LILDBI
>
>   Estimados todos
>
>  El Snr. Facundo Matias nos envió este correo con un tutorial para
> instalación del LILDBI-Web bajo un CentOS 6.3.
>
>  Saludos
>
>  Asael Costa Silva
>
> System Analyst
>
> MTI/RST
>
> BIREME/PAHO/WHO
>
>
>   ------------------------------
> *From:* Facundo Matias Victor Turi [fvictor at bblanca.com.ar]
> *Sent:* Saturday, August 17, 2013 13:14
> *To:* Asael C. da Silva (BIR)
> *Subject:* Tutorial de Compel para LILDBI
>
>    Buenas tardes,
>
>  Les comparto el tutorial que utilizamos para LILACS para la instalación
> en un Centos 6.3
>
>  Tutorial para la instalación de LILDBI-Web 1.7b
>
>  El tutorial es para una instalación sobre un Centos minimal. Este
> tutorial fue hecho mediante la instalación de LILDBI-Web 1.7b sobre CentOS6.3.
>
>  Índice:
>
>  1 → requerimientos.
>
> 2 → Proceso de instalación.
>
> 3 → Descarga y configuración de la página web.
>
> 4 → Configuración de SELinux para LILDBI-Web.
>
> 5 → Configuración de Backup vía rsync.
>
> 6 → Referencias.
>
> 7 → Ayuda sobre SELinux.
>
>  1) Requerimientos:
>
>  1.a) Requerimientos básicos:
>
>
>    1.
>
>    Apache 2.2
>    2.
>
>    php 5.3
>    3.
>
>    gcc
>    4.
>
>    make
>    5.
>
>    glibc
>    6.
>
>    libxml2-devel.i686
>    7.
>
>    libxml2-devel.i686
>    8.
>
>    libpng-devel.i686
>    9.
>
>    libxslt-devel.i686
>    10.
>
>    php-fpm.i686
>
>
>  1.b) Requerimientos para seguridad:
>
>
>    1.
>
>    mysecureshell
>     1.
>
>       Se necesita el repositorio /etc/yum.repos.d/mysecureshell.repo con
>       el contenido:
>
>
>  [mysecureshell]
>
> name=MySecureShell
>
> baseurl=http://mysecureshell.free.fr/repository/index.php/centos/$basearch
> /
>
> enabled=1
>
> gpgcheck=0
>
>
>    1.
>
>    policycoreutils-python
>
>
>  1.c) Requerimientos para backup:
>
>
>    1.
>
>    cronie.i686
>    2.
>
>    ntpdate
>    3.
>
>    xinetd
>    4.
>
>    rsync
>    5.
>
>    ntpd
>    6.
>
>    ntp.i686
>
>
>  2) Proceso de instalación:
>
>  2.a) Instalar Apache y php:
>
>  yum install httpd php
>
>  2.b) Configurar /etc/httpd/conf/httpd.conf:
>
>  NameVirtualHost <IP-servidor>:80
>
> AddDefaultCharset ISO-8859-1
>
> AddType application/x-httpd-php .php
>
> #LoadModule php5_module modules/libphp5.so (Lo carga por default)
>
>     Include conf.d/*.conf
>
>  2.c) Configurar /etc/httpd/conf.d/0_default.conf:
>
>  <VirtualHost 186.5.224.131:80>
>
>        ServerAdmin webmaster at bblanca.com.ar
>
>        DocumentRoot /var/www/html/default/
>
>        ServerName fliederb.ambb.com.ar
>
>        ErrorLog /var/log/httpd/default-error.log
>
>        TransferLog /var/log/httpd/default-access.log
>
> </VirtualHost>
>
>  2.d) Configurar /etc/httpd/conf.d/1_lilacs.conf:
>
>  <VirtualHost 186.5.224.131:80>
>
>     DocumentRoot "/var/www/html/lilacs/htdocs"
>
>     Options Indexes FollowSymLinks MultiViews
>
>     ServerName lilacs.ambb.com.ar
>
>     DirectoryIndex index.htm index.php homepage.htm
>
>     ScriptAlias /cgi-bin/ "/var/www/html/lilacs/cgi-bin/"
>
>     ErrorLog /var/log/httpd/lilacs-error.log
>
>     TransferLog /var/log/httpd/lilacs-access.log
>
>     <Directory "/var/www/html/lilacs/cgi-bin">
>
>            AllowOverride None
>
>            Options FollowSymLinks
>
>            Order allow,deny
>
>            Allow from all
>
>     </Directory>
>
>     <Directory "/var/www/html/lilacs/htdocs">
>
>            AllowOverride None
>
>            Options All
>
>            Order deny,allow
>
>            Allow from all
>
>     </Directory>
>
> </VirtualHost>
>
>  2.e) Configurar /etc/php.ini:
>
>  register_globals = Off
>
> short_open_tag = On
>
>  3) Descarga y Configuración de la página web:
>
>  3.a) Descarga:
>
>  http://trac.reddes.bvsalud.org/projects/lildbi/browser/downloads/Linux/
> LILDBI-WEB1.7b.tar.gz
>
>  3.b) Ubicación de archivos:
>
>  3.b.1) Descomprimir LILDBI-WEB1.7b.tar.gz en /tmp
>
>  3.b.2) Crear la carpeta /var/www/html/lilacs
>
>  3.b.3) Copiar el contenido de /tmp/bvs a /var/www/html/lilacs
>
>  3.b.4) Crear el archivo /var/www/html/lilacs/htdocs/index.htm con el
> siguiente contenido:
>
>  <!DOCTYPE html>
>
> <html>
>
>        <head>
>
>                <meta HTTP-EQUIV="REFRESH" content="0; url=./lildbi/index
> _es.htm">
>
>        </head>
>
>        <body>
>
>        </body>
>
> </html>
>
>  3.b.5) Crear el archivo /var/www/html/lilacs/.htaccess con el siguiente
> contenido:
>
>  short_open_tag = On
>
> php_flag display_errors Off
>
>  3.b.6) Crear el archivo /var/www/html/lilacs/bases/lildbi/.htaccess con
> el siguiente contenido:
>
>  deny from all
>
>  3.c) Creación del usuario lilacs con MySecureshell
>
>      Para crear el usuario:
>
>  adduser -d /var/www/html/lilacs/ -g users -s /bin/MySecureShell lilacs
>
>  En caso de que el usuario esté creado, editar /etc/passwd y buscar la
> linea correspondiente al usuario a utilizar (en nuestro caso de ejemplo
> “lilacs”). Luego editar la shell por /bin/MySecureShell y el directorio
> por /var/www/html/lilacs/ y finalmente cambiar el grupo ejecutando:
>
>  usermod -g users lilacs
>
>  3.c) Configuración de permisos de linux sobre el directorio
> /var/www/html/lilacs
>
>  3.c.1) Configurar dueños:
>
>      chown lilacs:users /var/www/html/lilacs
>
> chown -R lilacs:users /var/www/html/lilacs/cgi-bin
>
> chown -R lilacs:users /var/www/html/lilacs/htdocs
>
> chown -R lilacs:apache /var/www/html/lilacs/bases
>
> chown root:root /var/www/html/lilacs/.htaccess
>
> chown root:root /var/www/html/lilacs/bases/lildbi/.htaccess
>
>  3.c.2) Configurar permisos:
>
>      Desde la carpeta /var/www/html/lilacs ejecutar:
>
>  find cgi-bin/ -type d | xargs chmod 755
>
> find cgi-bin/ -type f | xargs chmod 644
>
> chmod 755 cgi-bin/wxis1660.exe
>
>  find htdocs/ -type d | xargs chmod 755
>
> find htdocs/ -type f | xargs chmod 644
>
>  find bases/ -type d | xargs chmod 777
>
> find bases/ -type f | xargs chmod 766
>
>  chmod 644 root:root /var/www/html/lilacs/.htaccess
>
> chmod 644 root:root /var/www/html/lilacs/bases/lildbi/.htaccess
>
>  3.d) Configuración firewall
>
>  #!/bin/bash
>
> SAVE="/sbin/iptables-save"
>
> IPTABLES="/sbin/iptables"
>
>  # Politica default a la tablas
>
> $IPTABLES -P INPUT ACCEPT
>
> $IPTABLES -P FORWARD ACCEPT
>
> $IPTABLES -P OUTPUT ACCEPT
>
> $IPTABLES -t nat -P PREROUTING ACCEPT
>
> $IPTABLES -t nat -P POSTROUTING ACCEPT
>
> $IPTABLES -t nat -P OUTPUT ACCEPT
>
> $IPTABLES -t mangle -P PREROUTING ACCEPT
>
> $IPTABLES -t mangle -P OUTPUT ACCEPT
>
>  # Flush de todas las reglas preexistentes en las tablas default
>
> $IPTABLES -F
>
> $IPTABLES -t nat -F
>
> $IPTABLES -t mangle -F
>
>  # Borra todas las cadenas no default que quedaran
>
> $IPTABLES -X
>
> $IPTABLES -t nat -X
>
> $IPTABLES -t mangle -X
>
>  # SSH
>
>  # Compel CE SRL (Owner: AR-CCES-LACNIC, 4 bloques clase C)
>
> $IPTABLES -A INPUT -i eth0 -s 186.5.224.0/22  -p tcp --dport 22 -j ACCEPT
>
> $IPTABLES -A INPUT -i eth0  -p tcp --dport 22 -j DROP
>
>  # HTTPD
>
>  # Compel CE SRL (Owner: AR-CCES-LACNIC, 4 bloques clase C)
>
> $IPTABLES -A INPUT -i eth0 -s 186.5.224.0/22  -p tcp --dport 80 -j ACCEPT
>
> $IPTABLES -A INPUT -i eth0  -p tcp --dport 80 -j DROP
>
>  $SAVE > /etc/sysconfig/iptables
>
>
>
>  3.e) Verificación del funcionamiento esperado para php:
>
>  Para verificar, en /var/www/html/lilacs/htdocs crear TEMPORALMENTE index.
> php con el contenido:
>
>  <?php phpinfo() ;>
>
>  Luego, levantar el servicio httpd y abrir un navegador y verificar que
> http://lilacs.ambb.com.ar/info.php muestre información de php.
>
>  Borrar el archivo archivo anterior luego de la verificación!!
>
>  3.f) Inicio del instalador:
>
>          Desde un navegador, ir a la url → http://lilacs.ambb.com.ar/
> lildbi/install/setup.php
>
>         Y completar como se indica en la siguiente imagen:
>
>  4) Configuración de Selinux para LILDBI-web:
>
>  Una vez verificado el correcto funcionamiento de la página web, se debe
> proceder a configurar los tag de selinux en la página:
>
>  NOTA: El semanage no hace que el tag httpd_sys_script_exec_t sobreviva a
> un relabel. Da error. Por lo que se hace con chcon por ahora. Sobrevive a
> reinicios. Para intentar grabar los cambios en el contexto del filesystemse utiliza:
>
>  semanage fcontext -a -t <tag_type> <directorios_exp_regular>
>
>  Desde /var/www/html/ ejecutar:
>
>  4.a) Marcar todo con el tag de solo lectura httpd_sys_content_t.
>
>  find ./lilacs/* -type f | xargs chcon -t httpd_sys_content_t
>
> chcon -t httpd_sys_content_t ./lilacs
>
>  4.b) Se debe dar permisos para el binario cgi con el tag httpd_sys_script
> _exec_t.
>
>  chcon -t httpd_sys_script_exec_t ./lilacs/cgi-bin/wxis1660.exe
>
>  4.c) Los archivos de las bases solo pueden ser escritos por el binario
> cgi, por lo que deben ir marcados con el tag httpd_sys_content_rw_t.
>
>  find ./lilacs/bases/* -type f | xargs chcon -t httpd_sys_content_rw_t
>
>  4.d) Los archivos restantes de cgi no son binarios, por lo que solo
> pueden ser leidos y concatenados (read-append) a los cgi para ser
> ejecutados y deben ser marcados con el tag httpd_sys_content_ra_t.
>
>  find ./lilacs/cgi-bin/lildbi/* -type f | xargs chcon -t httpd_sys_content
> _ra_t
>
>  5) Configuración de backup vía rsync:
>
>  Editar /etc/crontab y agregar:
>
>  20 04 * * * root /root/scripts/backup.sh 2>&1 > /dev/null
>
>  Crear el archivo /root/scripts/backup.sh con los permisos 744, owner rooty grupo
> root.
>
>  -rwxr--r--. 1 root root 368 Jul  3 18:40 /root/scripts/backup.sh
>
>  El contenido debe ser:
>
>  #!/bin/bash
>
>  # Backup en <Servidor de backup> (via Rsync)
>
> # <Autor de la configuracion> - <Fecha>
>
>  RSYNC="/usr/bin/rsync"
>
> PARAMS="-az --password-file=/etc/rsync.secrets --delete"
>
> DESTINO="root@<Servidor de backup>::backup/<nombre del servidor actual>"
>
>  # Configuracion
>
> $RSYNC $PARAMS /etc $DESTINO
>
> $RSYNC $PARAMS /var/www/html $DESTINO
>
> $RSYNC $PARAMS /var/spool/cron $DESTINO
>
> $RSYNC $PARAMS /root $DESTINO
>
>
>
> 6) Referencias:
>
>
>    -
>
>    http://wiki.bireme.org/pt/index.php/LILDBI-Web
>    -
>
>    http://wiki.reddes.bvsalud.org/index.php/LILDBI-WEB-proteccion
>
>  <bvs.technical.support at listas.bireme.br>
>
>  7) Ayuda sobre Selinux:
>
> http://docs.fedoraproject.org/en-US/Fedora/13/html/Managing_Confined_
> Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Types.html
>
>
>  Espero les sirva y ante cualquier aporte, consejo o inquietud no duden
> en escribirnos!
>
> Saludos atte.
>  Lic. Facundo Victor
> Compel Computación Electrónica S.R.L.
>
>  IMPORTANT: This transmission is for use by the intended
> recipient and it may contain privileged, proprietary or
> confidential information. If you are not the intended
> recipient or a person responsible for delivering this
> transmission to the intended recipient, you may not
> disclose, copy or distribute this transmission or take
> any action in reliance on it. If you received this transmission
> in error, please dispose of and delete this transmission.
>
> Thank you.
>
>    IMPORTANT: This transmission is for use by the intended
> recipient and it may contain privileged, proprietary or
> confidential information. If you are not the intended
> recipient or a person responsible for delivering this
> transmission to the intended recipient, you may not
> disclose, copy or distribute this transmission or take
> any action in reliance on it. If you received this transmission
> in error, please dispose of and delete this transmission.
>
> Thank you.
>
>    IMPORTANT: This transmission is for use by the intended
> recipient and it may contain privileged, proprietary or
> confidential information. If you are not the intended
> recipient or a person responsible for delivering this
> transmission to the intended recipient, you may not
> disclose, copy or distribute this transmission or take
> any action in reliance on it. If you received this transmission
> in error, please dispose of and delete this transmission.
>
> Thank you.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.bireme.br/pipermail/reddes/attachments/20130819/af321d8d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InstalaciondeLILDBI-Web1.7b.docx
Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Size: 49428 bytes
Desc: not available
Url : http://listas.bireme.br/pipermail/reddes/attachments/20130819/af321d8d/attachment-0001.bin 
-------------- next part --------------
_______________________________________________
Reddes.bvs-tech mailing list
Reddes.bvs-tech at listas.bireme.br
http://listas.bireme.br/mailman/listinfo/reddes.bvs-tech


More information about the Reddes mailing list