dissabte, 31 d’agost del 2013

habilitar public_html



/etc/apache2/mods-available

editar userdir.conf per personalitzar-ho si fos necessari

a2enmod userdir

service apache2 restart

 http://localhost/~hola1/ 

si fos el cas que amb php no s'executi i es descarregui

Crear info.php amb contingut



Ocurre que los script en php en vez de ejecutarse se descargan. Como no queremos esto, debemos editar un archivo de configuración. Desde el terminal abrimos para editar:
sudo gedit /etc/apache2/mods-enabled/php5.conf
Buscamos en el archivo hasta ver algo así:
# To re-enable php in user directories comment the following lines
# (from to .) Do NOT set it to On as it
# prevents .htaccess files from disabling it.


php_admin_value engine Off
Como nos dice en las líneas comentadas, las que llevan una almohadilla, debemos comentar desde  hasta 
 para que quede así:
#
#
#php_admin_value engine Off
#

#
La almohadilla sale de pulsar ALTgr+3.
Podríamos simplemente cambiar php_admin_value engine Off por php_admin_value engine On pero esto se impondría sobre .htaccess donde a veces podemos desear indicar que no puedan ejecutarse scripts php.
Y reiniciamos el servidor Apache para que los cambios tengan efecto:
sudo /etc/init.d/apache2 restart

links

scanner vulnerabilitats

http://www.tenable.com/products/passive-vulnerability-scanner?mkt_tok=3RkMMJWWfF9wsRojv6XKZKXonjHpfsX64u4vXKWylMI%2F0ER3fOvrPUfGjI4ETcNqI%2BSLDwEYGJlv6SgFQ7PBMbhx2LgIXRk%3D

teoria seguretat
http://www.eslared.org.ve/walcs/walc2012/material/track4/Aseguramiento%20Linux/Seguridad%20en%20Linux%20walc2012def.pdf
 http://www.intypedia.com/
http://docencia.ac.upc.edu/FIB/ASO/files/slides/09-Seguretat_en.pdf
http://docencia.ac.upc.edu/FIB/PXC/manel/TEORIA/3_Security_kurose.pdf

enjaularserveis
http://www.nireleku.com/2013/01/como-configurar-sftp-con-usuarios-enjaulados-en-ubuntu-server-12-04/
http://puppetlinux.blogspot.com.es/2012/08/sftp-en-chroot.html
http://miguelcarmona.name/blog/enjaular-a-un-usuario-conectado-por-ssh
http://olivier.sessink.nl/jailkit/
http://www.esdebian.org/wiki/enjaulado-facil-jailkit-chroot
http://www.esdebian.org/wiki/enjaulado-facil-jailkit-chroot
http://www.esdebian.org/wiki/enjaulado-sftp
http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/


instal·lació informàtica
http://docencia.ac.upc.edu/FIB/grau/CASO/transparencies/gestio-installacio.pdf
http://docencia.ac.upc.edu/FIB/grau/CASO/
http://docencia.ac.upc.edu/FIB/grau/ASO/
http://docencia.ac.upc.edu/FIB/grau/ASO/files/slides/05-Monitoring.pdf

firewall
http://personals.ac.upc.edu/elara/documentacion/INTERNET%20-%20UD12%20-%20Firewalls.pdf
http://docencia.ac.upc.es/FIB/PXC/transpas/index.html

teoria serveis
http://personals.ac.upc.edu/elara/

ftp http://personals.ac.upc.edu/elara/documentacion/INTERNET%20-%20UD9%20-%20Servidor%20FTP.pdf

  network inventory
http://lansweeper.com/

  classroom
https://vts.inxpo.com

  virtualització
Using Vagrant with Puppet to create VirtualBox hosts http://searchenterpriselinux.techtarget.com/tip/Using-Vagrant-with-Puppet-to-create-VirtualBox-hosts physical to virtual (P2V)
http://searchservervirtualization.techtarget.com/definition/physical-to-virtual Open source desktop virtualization software options: VirtualBox and more http://searchvirtualdesktop.techtarget.com/tip/Open-source-desktop-virtualization-software-options-VirtualBox-and-more
http://searchservervirtualization.techtarget.com/feature/VMware-Workstation-vs-VirtualBox
http://docencia.ac.upc.edu/FIB/ASO/files/slides/10-Virt.pdf
http://searchvirtualdesktop.techtarget.com/ebook/Exploring-the-future-of-desktop-virtualization


  web
http://forums.cpanel.net/discusion-en-espanol.html
http://www.virtualmin.com/download.html
http://www.webmin.com/virtualmin.html
http://servers.hostik.com/instructions/rhel-adddomainapache.htm
http://thinkdiff.net/ubuntu-linux/manage-your-vps-by-virtualmin-web-server-control/
http://mirror.omadata.com/onno/library-sw-hw/linux-1/webmin/virtual-server/Virtualmin%20Virtual%20Servers%20Module.htm


connexió remota
http://personals.ac.upc.edu/elara/documentacion/INTERNET%20-%20UD11%20-%20Conexion%20Remota%20Terminal.pdf
http://personals.ac.upc.edu/elara/documentacion/LINUX%20-%20UD13%20-%20Iniciar%20sesion%20en%20Linux%20de%20forma%20remota.pdf


sense classificació
http://www.nexun.org/content/blogcategory/22/58/

balaceig
http://docencia.ac.upc.edu/FIB/ASO/files/presentacions/pfreixes_loadbalancing.pdf

Introducing Vagrant

Introducing Vagrant Now there are two Boxes installed: >vagrant box list lucid32 rhel5.7 It is important to note that you can reuse these base images. A Box can be the base for multiple projects without contamination. Changes in any one project will not change the other projects that share a Box. As you'll see, changes in the base can be shared to projects easily. One of the powerful concepts about using Vagrant is that the development environment is now totally disposable. You persist your critical work on the Host, while the Guest can be reloaded quickly and provisioned from scratch. Starting Vagrant Create a directory on the Host as your starting point. This directory is your working directory. Vagrant will share this directory between the Guest and the Host automatically. Developers can edit files from their preferred Editors or IDEs without updating the Guest. Changes made in the Host or Guest are immediately visible to the user from either perspective: > mkdir ProjectX > cd ProjectX To get started, you need a Vagrantfile. The Vagrantfile is to similar to a Makefile, a set of instructions that tells Vagrant how to build the Guest. Vagrant uses Ruby syntax for configuration. The simplest possible Vagrantfile would be something like this: Vagrant::Config.run do |config| config.vm.box = "lucid32" end This configuration tells Vagrant to use all the defaults and the Box called lucid32. There actually are four Vagrantfiles that are read: the local version in the current directory, a user version in ~/.vagrant.d/, a Box version in the Box file and an initial config installed with the Gem. Vagrant reads these files starting with the Gem version and finishing with the current directory. In the case of conflicts, the most recent version wins, so the current directory overrides the ~/.vagrant.d, which overrides the Box version and so on. Users can create a new Vagrantfile simply by running: > vagrant init This creates a Vagrantfile in the current directory. The generated Vagrantfile has many of the common configuration parameters with comments on their use. The file tries to be self-documenting, but additional information is available from the Vagrant Web site. To run most Vagrant commands, you need to be in the same directory as the Vagrantfile. Let's give it a try: $ vagrant up [default] Importing base box 'lucid32'... [default] The guest additions on this VM do not match the install version of VirtualBox! This may cause things such as forwarded ports, shared folders, and more to not work properly. If any of those things fail on this machine, please update the guest additions and repackage the box. Guest Additions Version: 4.1.0 VirtualBox Version: 4.1.8 [default] Matching MAC address for NAT networking... [default] Clearing any previously set forwarded ports... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. [default] VM booted and ready for use! [default] Mounting shared folders... [default] -- v-root: /vagrant Let's break this down. I'm running with VirtualBox 4.1.8 and a Guest at 4.1.0. In this case it works smoothly, but the warning is there to help troubleshoot issues should they appear. Next, it sets up the networking for the Guest: [default] Matching MAC address for NAT networking... [default] Clearing any previously set forwarded ports... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) I used the default network setting of Network Address Translation with Port Forwarding. I am forwarding port 2222 on the Host to port 22 on the Guest. Vagrant starts the Guest in headless mode, meaning there is no GUI interface that pops up. For users who want to use the GUI version of the Guest, the option is available in the Vagrantfile to run within a window. Once the network is set up, Vagrant boots the virtual machine: [default] VM booted and ready for use! [default] Mounting shared folders... [default] -- v-root: /vagrant After the Guest has started, Vagrant will add the shared folder. Vagrant uses the VirtualBox extensions to mount the current folder (ProjectX in this case) as /vagrant. Users can copy and manipulate files from the Host OS in the ProjectX directory, and all the files and changes will be visible in the Guest. If the shared folder isn't performing well because you have a large number of files, Vagrant does support using NFS. However, it does require that NFS is supported by both the Guest and Host systems. At this time, NFS is not supported on Windows Hosts. « first ‹ previous 1 2 3 next › last » http://www.linuxjournal.com/content/introducing-vagrant

Instalar entorno gráfico en ubuntu server 12.04

Instalar entorno gráfico en ubuntu server 12.04 Para instalar el entorno gráfico en ubuntu server 12.04, escribiremos en el terminal: $ sudo apt-get install ubuntu-desktop Esta instrucción instalará el entorno gráfico Unity incluido Evolution, LibreOffice, etc. Si no quieres instalar este tipo de programas, que en un servidor, no son útiles, ejecuta este otro comando: $ sudo apt-get install --no-install-recommends ubuntu-desktop Modo texto por defecto en el arranque. Una vez instalado el modo gráfico, podemos dejar por defecto el modo texto con estos simples pasos: Editamos /etc/default/grub. Buscamos la línea GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" y la cambiamos por GRUB_CMDLINE_LINUX_DEFAULT="text". Escribimos en el terminal las siguientes instrucciones: $ sudo update-grub $ sudo reboot Una vez arrancado en modo texto, podemos iniciar el modo gráfico desde la consola con esta instrucción: $ startx http://www.elrincondelprogramador.net/index.php/linux/48-2013-06-09-18-53-00.html

dimecres, 19 de juny del 2013

Repositorios Oficiales debian 7

debian 7

# Repositorios Oficiales
deb http://ftp.ccc.uba.ar/pub/linux/debian/debian/ wheezy main contrib non-free
deb-src http://ftp.ccc.uba.ar/pub/linux/debian/debian/ wheezy main contrib non-free
#Repositorios Seguridad
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
# wheezy-updates
deb http://mirrors.kernel.org/debian wheezy-updates main contrib non-free
deb-src http://mirrors.kernel.org/debian wheezy-updates main contrib non-free
# Repositorios Backports
deb http://mirrors.kernel.org/debian wheezy-backports main contrib non-free
deb-src http://mirrors.kernel.org/debian wheezy-backports main contrib non-free

deb http://download.virtualbox.org/virtualbox/debian wheezy contrib



pero també s'ha de fer per virtualbox

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add -

apt-get update
apt-get install virtualbox-4.2

divendres, 31 de maig del 2013

¿Desea continuar [S/n]? s
Configurando linux-image-2.6.32-5-amd64 (2.6.32-48squeeze3) ...
Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.32-5-amd64
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
run-parts: executing /etc/kernel/postinst.d/pm-utils 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
run-parts: executing /etc/kernel/postinst.d/update-notifier 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
Generating grub.cfg ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-2.6.32-5-amd64
Found initrd image: /boot/initrd.img-2.6.32-5-amd64
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64
Found linux image: /boot/vmlinuz-2.6.26-1-amd64
Found initrd image: /boot/initrd.img-2.6.26-1-amd64
/etc/grub.d/README: 2: All: not found
/etc/grub.d/README: 4: 00_*:: not found
/etc/grub.d/README: 5: 10_*:: not found
/etc/grub.d/README: 6: Syntax error: "(" unexpected
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.32-5-amd64.postinst line 799.
dpkg: error al procesar linux-image-2.6.32-5-amd64 (--configure):
 el subproceso instalado el script post-installation devolvió el código de salida de error 2
configured to not write apport reports
                                      Se encontraron errores al procesar:
 linux-image-2.6.32-5-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

resolució

dpkg --configure -a

Con esta simple orden, le decimos que termine la instalación pendiente. Si después de realizar este paso, seguimos teniendo los mis problemas (no desesperar), pongamos manos a la obra:

1.- Eliminar los archivos:

/var/lib/dpkg/info/"package-name".postrm

/var/lib/dpkg/info/"package-name".list

2.- apt-get clean all

3.- apt-get update

4.- apt-get upgrade

revisió hardware i moduls de hardware

lspci
NAME lspci - list all PCI devices

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)

05:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

 lshw

lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work). It currently supports DMI (x86 and IA-64 only), OpenFirmware device tree (PowerPC only), PCI/AGP, CPUID (x86), IDE/ATA/ATAPI, PCMCIA (only tested on x86), SCSI and USB.

*-network
                description: Ethernet interface
                product: RTL8111/8168B PCI Express Gigabit Ethernet controller
                vendor: Realtek Semiconductor Co., Ltd.
                physical id: 0
                bus info: pci@0000:01:00.0
                logical name: eth0
                version: 03
                serial: 20:cf:30:f4:d1:0a
                size: 1GB/s
                capacity: 1GB/s
                width: 64 bits
                clock: 33MHz
                capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autoneg
otiation
                configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=N/A ip=192.168.130.2 latency=0 link
=yes multicast=yes port=MII speed=1GB/s
                resources: irq:28 ioport:d800(size=256) memory:f6fff000-f6ffffff(prefetchable) memory:f6ff8000-f6ffbfff(prefetchable) memory:f7ef0000-f7efffff
(prefetchable)


*-network description: Ethernet interface
 product: RTL-8139/8139C/8139C+
vendor: Realtek Semiconductor Co., Ltd.
physical id: 2
bus info: pci@0000:05:02.0
logical name: eth1
version: 10 serial: 00:22:2d:80:99:bf
size: 100MB/s
capacity: 100MB/s
width: 32 bits
clock: 33MHz
capabilities: pm bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=8139too driverversion=0.9.28 duplex=full ip=192.168.0.201 latency=64 link=yes maxlatenc y=64 mingnt=32 multicast=yes port=MII speed=100MB/s
resources: irq:17 ioport:e800(size=256) memory:f7fff000-f7fff0ff memory:f7fc0000-f7fdffff(prefetchable)

 lsmod

 lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded. modprobe modprobe intelligently adds or removes a module from the Linux kernel: note that for convenience, there is no difference between _ and - in module names (automatic underscore conversion is performed). modprobe looks in the module directory /lib/modules/`uname -r` for all the modules and other files, except for the optional /etc/modprobe.conf configuration file and /etc/modprobe.d directory (see modprobe.conf(5)). modprobe will also use module options specified on the kernel command line in the form of .