server https://www.keopx.net/ es Instalación y configuracion de java https://www.keopx.net/blog/instalacion-y-configuracion-de-java <span> Instalación y configuracion de java</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Obtenemos java</h2> <p>Antes de descargar una versión de java debemos saber la versión del S.O. esto es, si es x86 o amd64. Para ello ejecutamos lo siguiente:</p> <p><code># uname -a</code><br /><code>Linux Hetz01 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013 x86_64 <strong>x86_64</strong> x86_64 GNU/Linux</code></p> <p>Ahora descargamos java a nuestro equipo:</p> <ul><li><a href="https://web.archive.org/web/20210118110020/http://www.java.com/es/download/linux_manual.jsp?locale=es">http://www.java.com/es/download/linux_manual.jsp?locale=es</a></li> <li><a href="https://web.archive.org/web/20210118110020/http://www.oracle.com/technetwork/es/java/javase/downloads/index.html">http://www.oracle.com/technetwork/es/java/javase/downloads/index.html</a></li> </ul><h2>Instalar JRE</h2> <h3>Subimos JAVA</h3> <p><code>$ scp jre-7u17-linux-x64.tar.gz root@78.47.194.156:.</code></p> <h3>Ahora instalamos en el servidor</h3> <p><code># tar -xvf  jre-7u17-linux-x64.tar.gz</code><br /><code># mkdir /usr/lib/jvm</code><br /><code># mv jre1.7.0_17 /usr/lib/jvm/</code><br /><code># update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_17/bin/java 0</code><br /><code># update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jre1.7.0_17/bin/javaws 0</code></p> <h2>Instalar JDK</h2> <h3>Subimos JAVA</h3> <p><code>$ scp jdk-7u17-linux-x64.tar.gz root@78.47.194.156:.</code></p> <h3>Ahora instalamos en el servidor</h3> <p><code># tar -xvf  jdk-7u17-linux-x64.tar.gz</code><br /><code># mkdir /usr/lib/jvm</code><br /><code># mv jdk1.7.0_17 /usr/lib/jvm/</code><br /><code># update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_17/bin/java 1</code><br /><code># update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/&gt;&gt;jdk1.7.0_17/bin/javac 1</code><br /><code># update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_17/bin/javaws 1</code></p> <h2><code>Enlaces simbólicos</code></h2> <p><code>Para poder actualiza tanto el <strong>jdk</strong> como el <strong>jre</strong> podemos usar el enlace simbólico que apunte concreta de la <strong>jvm</strong> a uno genérico.</code></p> <h3>JRE simbólico</h3> <p><code># ln -s /usr/lib/jvm/jre1.7.0_17 /usr/lib/jvm/jre1.7.0</code></p> <p>Ahora configuramos el nuevo entorno:</p> <p>&gt;<code># update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 0</code><br /> &gt;<code># update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jre1.7.0/bin/javaws 0</code></p> <h3>JDK simbólico</h3> <p><code># ln -s /usr/lib/jvm/jdk1.7.0_17 /usr/lib/jvm/jdk1.7.0</code></p> <p>Ahora configuramos el nuevo entorno:&gt;</p> <p><code># update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/bin/java 1</code><br /><code># update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0/bin/javac 1 </code><br /><code># update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0/bin/javaws 1</code></p> <h2>Reconfigurar java</h2> <p><code># update-alternatives --config java</code><br /><code># update-alternatives --config javac</code><br /><code># update-alternatives --config javaws</code></p> <h2>Referencias</h2> <ul><li><a href="https://web.archive.org/web/20210118110020/http://www.liberiangeek.net/2012/04/install-oracle-java-runtime-jre-7-in-ubuntu-12-04-precise-pangolin/">http://www.liberiangeek.net/2012/04/install-oracle-java-runtime-jre-7-in-ubuntu-12-04-precise-pangolin/</a></li> <li><a href="https://web.archive.org/web/20210118110020/http://www.liberiangeek.net/2012/04/install-oracle-java-jdk-7-in-ubuntu-12-04-precise-pangolin">http://www.liberiangeek.net/2012/04/install-oracle-java-jdk-7-in-ubuntu-12-04-precise-pangolin</a></li> <li><a href="https://web.archive.org/web/20210118110020/http://www.java.com/es/download/linux_manual.jsp?locale=es">http://www.java.com/es/download/linux_manual.jsp?locale=es</a></li> <li><a href="https://web.archive.org/web/20210118110020/http://www.oracle.com/technetwork/es/java/javase/downloads/index.html">http://www.oracle.com/technetwork/es/java/javase/downloads/index.html</a></li> </ul><p> </p> </div> <span><span>keopx</span></span> <span><time datetime="2019-07-29T11:23:23+02:00" title="Lunes, Julio 29, 2019 - 11:23">Lun, 29/07/2019 - 11:23</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/java" hreflang="es">Java</a></div> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/java" hreflang="es">Java</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=302&amp;2=field_comments&amp;3=comment" token="wNnqtKqLMvApCw1DE11sNDEU8kVI9SRvQvrQQNe09rc"></drupal-render-placeholder> </div> </div> </section> Mon, 29 Jul 2019 09:23:23 +0000 keopx 302 at https://www.keopx.net Instalación y configuración de SAI-UPS APC https://www.keopx.net/blog/instalacion-y-configuracion-de-sai-ups-apc <span>Instalación y configuración de SAI-UPS APC</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>En principio en gnome el servicio <strong>ups-monitor</strong> nos mantiene controlado el sistema SAI y nos permite configurarlo en caso de que la red eléctrica falle. <strong>Siempre que se haya iniciado una sesión en el equipo</strong>, de no ser así no mantendremos el control. Para solucionar esto en equipos servidor tenemos un paquete para esto, <strong>apcupsd</strong>:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo aptitude install apcupsd</pre><p>Cambiamos los parámetros en:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo cp /etc/apcupsd/apcupsd.conf /etc/apcupsd/apcupsd.conf.orig $ sudo nano /etc/apcupsd/apcupsd.conf</pre><p>Cambiamos</p> <pre line="1" lang="bash" xml:lang="bash">UPSCABLE smart</pre><p>Por</p> <pre line="1" lang="bash" xml:lang="bash">UPSCABLE usb</pre><p>Y más abajo tambien modificamos <em>UPSTYPE</em> y <em>DEVICE</em>: Cambiamos:</p> <pre line="1" lang="bash" xml:lang="bash">UPSTYPE apcsmart DEVICE /dev/ttys0</pre><p>Por:</p> <pre line="1" lang="bash" xml:lang="bash">UPSTYPE usb DEVICE</pre><p>* Si en <strong>DEVICE</strong> lo dejamos <strong>blanco</strong>. Resultado similar al siguiente:</p> <pre line="1" lang="bash" xml:lang="bash">## apcupsd.conf ## UPSNAME Back-900 UPSCABLE usb UPSTYPE usb DEVICE POLLTIME 60 LOCKFILE /var/lock</pre><p>Reiniciamos el servicio:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /etc/init.d/apcupsd restart</pre><p>Arrancamos el servicio a mano:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /sbin/apcupsd</pre><p>Probamos la configuración:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /sbin/apcaccess status</pre><p>Nos devolverá algo similar a esto:</p> <pre line="1" lang="bash" xml:lang="bash">APC : 001,037,0931 DATE : 2011-01-30 18:39:34 +0100 HOSTNAME : server-host VERSION : 3.14.8 (16 January 2010) debian UPSNAME : Back-900 CABLE : USB Cable MODEL : Back-UPS BR 900GI UPSMODE : Stand Alone STARTTIME: 2011-01-30 18:39:16 +0100 STATUS : ONLINE LINEV : 215.0 Volts LOADPCT : 27.0 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 37.2 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds SENSE : Medium LOTRANS : 176.0 Volts HITRANS : 294.0 Volts ALARMDEL : Always BATTV : 27.0 Volts LASTXFER : Unacceptable line voltage changes NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : NO STATFLAG : 0x07000008 Status Flag MANDATE : 2010-08-14 SERIALNO : 3B1022X43411 BATTDATE : 2010-08-14 NOMINV : 230 Volts NOMBATTV : 24.0 Volts NOMPOWER : 540 Watts FIRMWARE : 879.L1d.I USB FW:L1 APCMODEL : Back-UPS BR 900GI END APC : 2011-01-30 18:39:35 +0100</pre><p>Si reiniciamos nos encontraremos con el siguiente mensaje:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo /sbin/apcaccess status Error contacting apcupsd @ localhost:3551: Connection refused</pre><p>Para que se inicia de forma automatica debemos cambiar el siguiente parametro:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo nano /etc/default/apcupsd</pre><p>Y dejamos así:</p> <pre line="1" lang="bash" xml:lang="bash"># Apcupsd-devel internal configuration APCACCESS=/sbin/apcaccess #ISCONFIGURED=no ISCONFIGURED=yes</pre><p><strong>Ya tenemos automatizado!!!</strong> Relacionados:</p> <ul><li><a href="http://flossexperiences.wordpress.com/2008/10/26/configuring-apcupsd/">http://flossexperiences.wordpress.com/2008/10/26/configuring-apcupsd/</a></li> <li><a href="http://failserver.nl/blog/2009/05/howto-install-apc-ups-750-series-on-debian-lenny/">http://failserver.nl/blog/2009/05/howto-install-apc-ups-750-series-on-debian-lenny/</a></li> <li><a href="http://www.imacat.idv.tw/cgi-bin/man/man2html?apcaccess+8">Explicación de las variables</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2011-01-31T18:11:36+01:00" title="Lunes, Enero 31, 2011 - 18:11">Lun, 31/01/2011 - 18:11</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/linux" hreflang="es">Linux</a></div> <div class="field__item"><a href="/tag/sai" hreflang="es">SAI</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> <div class="field__item"><a href="/tag/ups" hreflang="es">UPS</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=210&amp;2=field_comments&amp;3=comment" token="0PdQYdmavv6Ekq8vzUnpjZkd-Q2RC_Jerk5fA_ytrmw"></drupal-render-placeholder> </div> </div> </section> Mon, 31 Jan 2011 17:11:36 +0000 keopx 210 at https://www.keopx.net Crear imagen de disco duro en Debian/Ubuntu y GNU/Linux en general https://www.keopx.net/blog/crear-imagen-de-disco-duro-en-debianubuntu-y-gnulinux-en-general <span>Crear imagen de disco duro en Debian/Ubuntu y GNU/Linux en general</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Si necesitamos clonar discos dd es la mejor solución. Podemos realizar copias de discos duros, usb, CD-ROM y aquellos dispositivos conectados al equipo. Crear imagen de una unidad:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo dd if=/dev/sda of=/home/keopx/imagen.iso bs=512 conv=noerror</pre><!--break--><p>* bs=512 es el tamaño del bloque a copiar. Volcar la imagen al dispositivo:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo dd if=/home/keopx/imagen.iso of=/dev/sda bs=4096 conv=noerror</pre><p>De dispositivo a dispositivo:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo dd if=/dev/sda of=/dev/sdb bs=1M conv=noerror </pre><p>Debemos copiar también el sistema de arranque MBR:</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo dd if=/dev/sda of=/home/keopx/mbr.iso bs=512 count=1 </pre><p>Hacer una copia del disco a un fichero mediante ssh</p> <pre line="1" lang="bash" xml:lang="bash">$ sudo dd if=/dev/sda1 | ssh usuario@host “dd of=/home/usuario/partition.image” </pre><p><strong>Comprobar el estado de la copia</strong></p> <pre line="1" lang="bash" xml:lang="bash">$ pgrep -l '^dd$' 4589 dd $ sudo kill -SIGUSR1 4589 </pre><p>Ahora en la salida de la ejecucion veremos algo similar a lo siguiente:</p> <pre line="1" lang="bash" xml:lang="bash">dd if=/dev/sda of=/dev/sdc bs=1M conv=noerror 1384+0 records in 1384+0 records out 1451229184 bytes (1.5 GB) copied, 28.292 s, 51.3 MB/s </pre><p>Más referencia:</p> <ul><li><a href="http://casidiablo.net/crear-un-backup-o-imagen-del-disco-duro/">http://casidiablo.net/crear-un-backup-o-imagen-del-disco-duro/</a></li> <li><a href="http://preguntaslinux.org/-guia-el-comando-dd-t-10.html">http://preguntaslinux.org/-guia-el-comando-dd-t-10.html</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2010-06-28T16:07:26+02:00" title="Lunes, Junio 28, 2010 - 16:07">Lun, 28/06/2010 - 16:07</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/disco-duro" hreflang="es">Disco Duro</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/linux" hreflang="es">Linux</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=186&amp;2=field_comments&amp;3=comment" token="fWlyqZUeOr9D9zpPugmwRnxWWjN8v-7FV7gumzxScmc"></drupal-render-placeholder> </div> </div> </section> Mon, 28 Jun 2010 14:07:26 +0000 keopx 186 at https://www.keopx.net https://www.keopx.net/blog/crear-imagen-de-disco-duro-en-debianubuntu-y-gnulinux-en-general#comments Carpetas chroot personalizadas para cada usuario https://www.keopx.net/blog/carpetas-chroot-personalizadas-para-cada-usuario <span>Carpetas chroot personalizadas para cada usuario</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Puede que nos interese el crear el más usuarios con sus carpetas chroot personalizadas.</p> <p>Para ello es necesario el modificar la siguiente linea:</p> <p><code>ChrootDirectory /var/www/web</code></p> <p>Por: <code>ChrootDirectory %h</code></p> <p>El %h es la carpeta personal de cada usuario que lo definimos al crear el usuario con la opción <em>-d</em>:</p> <p><code>sudo useradd -g sftponly -G sftponly -s /bin/false -d /var/www/web usuarioweb</code></p> <p>Ahora con cada usuario que creemos tendrá su propio chroot, sino se le define sera <em>/</em>.</p> <p>Relacionado con: <a href="http://www.keopx.net/blog/chroot-para-usuario-sftp/">http://www.keopx.net/blog/chroot-para-usuario-sftp/</a></p> </div> <span><span>keopx</span></span> <span><time datetime="2010-04-14T11:27:24+02:00" title="Miércoles, Abril 14, 2010 - 11:27">Mié, 14/04/2010 - 11:27</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> <div class="field__item"><a href="/tag/ssh" hreflang="es">ssh</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=174&amp;2=field_comments&amp;3=comment" token="A95ivxG9w_lY7OIuQkU_u78UKs6fu9fk7a_jaPdgZ6w"></drupal-render-placeholder> </div> </div> </section> Wed, 14 Apr 2010 09:27:24 +0000 keopx 174 at https://www.keopx.net Chroot para usuario sftp https://www.keopx.net/blog/chroot-para-usuario-sftp <span>Chroot para usuario sftp</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Vamos a crear una especie de jaula para un usuario. Este usuario lo vamos a utilizar para un entorno web donde pueda subir ficheros y modificarlos, pero que no pueda salir de ese directorio.</p> <p>Lo primero es editar el fichero <em>/etc/ssh/sshd_config</em>:</p> <pre><code>sudo nano /etc/ssh/sshd_config</code> </pre><p>y al final lo dejamos así:</p> <pre><!--break--><code>#Subsystem sftp /usr/lib/openssh/sftp-server</code> <code>...</code> <code>UsePAM yes</code> <code>... Subsystem sftp internal-sftp</code> <code>Match group sftponly</code> <code>ForceCommand internal-sftp ChrootDirectory /var/www/web</code> </pre><p>Creamos la carpeta, con <em>usuario</em> y <em>grupo root</em> en la carpeta <em>/var/www/web</em>:</p> <pre><code>sudo mkdir /var/www/web</code> <code>drwxr-xr-x 5 root root 4,0K 2010-04-11 09:55 web</code> </pre><p>Dentro de <em>/var/www/web</em> pondremos los permisos que correspondan a los ficheros.</p> <pre>$ ls -lah total 260K drwxr-xr-x 5 root root 4,0K mar 22 12:28 . drwxr-xr-x 6 root root 4,0K mar 22 12:28 .. -rwxr-xr-x 1 usuarioweb www-data 3,9K mar 22 12:28 funciones.php -rwxr-xr-x 1 usuarioweb www-data 3,9K mar 22 12:28 insertar.php -rwxr-xr-x 1 usuarioweb www-data 3,3K mar 22 12:28 modificar.php </pre><p>Creamos el grupo sftponly:</p> <pre><code>sudo groupadd sftponly</code> </pre><p>Ahora creamos el usuario con el valor <em>-d</em> que sirve para definirle su directorio:</p> <pre><code>$ sudo useradd -g sftponly -G sftponly -s /bin/false -d /var/www/web usuarioweb</code> </pre><p>Le asignamos la contraseña oportuna:</p> <pre><code>$ sudo passwd usuarioweb</code> </pre><p>Reiniciamos el ssh:</p> <pre><code>$ sudo /etc/init.d/ssh restart</code> </pre><p>Ya tenemos nuestro directorio funcionando para que el <em>usuarioweb</em> no pueda salir de esa carpeta.</p> </div> <span><span>keopx</span></span> <span><time datetime="2010-04-13T10:57:22+02:00" title="Martes, Abril 13, 2010 - 10:57">Mar, 13/04/2010 - 10:57</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/linux" hreflang="es">Linux</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> <div class="field__item"><a href="/tag/ssh" hreflang="es">ssh</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=173&amp;2=field_comments&amp;3=comment" token="bpIHMb2TwPMM2e2IMKyeqvKTPqVXSn6kiBcaktrLMhk"></drupal-render-placeholder> </div> </div> </section> Tue, 13 Apr 2010 08:57:22 +0000 keopx 173 at https://www.keopx.net Hacer streaming con webcam en Debian/Ubuntu https://www.keopx.net/blog/hacer-streaming-con-webcam-en-debianubuntu <span>Hacer streaming con webcam en Debian/Ubuntu</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Si queremos emitir a través de la web nuestra webcam o queremos visualizar la webcam de forma remota existe la posibilidad con webcam-server. Eso si es necesario el tener la maquina virtual de java.</p> <p>Instalación:</p> <pre> <code class="language-bash">sudo apt-get install webcam-server</code></pre><p>Fichero configuración de arranque y parado:</p> <pre> <code class="language-bash">sudo nano /etc/init.d/webcam-server</code></pre><p>Y añadimos:</p> <pre> <code class="language-bash">#!/bin/sh SERVER_BIN=webcam-server LOCK_FILE=/var/lock/$SERVER_BIN RTRN=0 OPTIONS='-v -g 320x240 -p 8888 -c hacktivision.com' start() { [ -f $LOCK_FILE ] &amp;&amp; echo "$SERVER_BIN already started" [ -f $LOCK_FILE ] &amp;&amp; return echo -n "Starting $SERVER_BIN: " export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so nohup $SERVER_BIN $OPTIONS &gt; /dev/null 2&gt;/dev/null &amp; RTRN=$? [ $RTRN -eq 0 ] &amp;&amp; echo Started! || echo FAIL [ $RTRN -eq 0 ] &amp;&amp; touch $LOCK_FILE } stop() { [ -f $LOCK_FILE ] || echo "$SERVER_BIN is not running" [ -f $LOCK_FILE ] || return echo -n "Stopping $SERVER_BIN: " pkill -f "$SERVER_BIN $OPTIONS" RTRN=$? rm -f $LOCK_FILE [ $RTRN -eq 0 ] &amp;&amp; echo Stopped! || echo FAIL } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|restart}" RTRN=1 esac exit $RTRN</code></pre><p>Le asignamos permisos:</p> <pre> <code class="language-bash">sudo chmod +x /etc/init.d/webcam-server</code></pre><p>Y actualizamos los scripts de inicio y apagado automatico.</p> <pre> <code class="language-bash">sudo update-rc.d webcam-server defaults</code></pre><p>Ahora arrancamos:</p> <pre> <code class="language-bash">sudo /etc/init.d/webcam-server start</code></pre><p>Podemos visualizar en esta ruta:</p> <p><a href="http://localhost:8888/">http://localhost:8888/</a></p> <p>Para visualizar en nuestro apache basta con hacer lo siguiente:</p> <pre> <code class="language-bash">sudo apt-get install apache2</code></pre><p>Copiamos los ficheros a nuestra ruta por defecto del apache.</p> <pre> <code class="language-bash">sudo cp /usr/share/doc/webcam-server/applet/* /var/www/</code></pre><p>Y accedemos a la ruta web:</p> <p><a href="http://localhost/webcam.html">http://localhost/webcam.html</a></p> <p>Fuente:</p> <ul><li><a href="http://hacktivision.com/index.php/2009/06/16/setting-up-an-ubuntu-webcam-server">http://hacktivision.com/index.php/2009/06/16/setting-up-an-ubuntu-webcam-server</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2010-02-22T16:09:13+01:00" title="Lunes, Febrero 22, 2010 - 16:09">Lun, 22/02/2010 - 16:09</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/software-libre" hreflang="es">Software Libre</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/webcam" hreflang="es">webcam</a></div> <div class="field__item"><a href="/tag/video" hreflang="es">Video</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=164&amp;2=field_comments&amp;3=comment" token="sNd0pyw5y_DBP9BKSbfBMJIHu87K-kFjSB-zZ7_XGF0"></drupal-render-placeholder> </div> </div> </section> Mon, 22 Feb 2010 15:09:13 +0000 keopx 164 at https://www.keopx.net Redireccionar de http a https en Apache https://www.keopx.net/blog/redireccionar-de-http-https-en-apache <span>Redireccionar de http a https en Apache</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Añadiendo esta simple linea en nuestro virtual host nos enviara de una petición http a https convierten así la conexión en segura.</p> <pre> <code class="language-apache"> RedirectMatch (.*) https://www.nuestra-direccion.com$1 </code></pre><p> </p> </div> <span><span>keopx</span></span> <span><time datetime="2009-09-27T18:11:47+02:00" title="Domingo, Septiembre 27, 2009 - 18:11">Dom, 27/09/2009 - 18:11</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=134&amp;2=field_comments&amp;3=comment" token="b_4UnoJMpnoqlJqn_69o3DMFSok3XznLRyVn7imp_Og"></drupal-render-placeholder> </div> </div> </section> Sun, 27 Sep 2009 16:11:47 +0000 keopx 134 at https://www.keopx.net