2nd November 2007

Instalacion de Asterisk en Ubuntu Server

  • Procedimiento para Instalar Asterisk VoIP en Ubuntu Server
  • Servidor: Ubuntu Server Dapper Drake
  • Conmutador de VoIP: Asterisk asterisk-1.2.15
  • Admninistrador Web : FreePBX 2.2.0// Mi Particion
    // /boot 100M
    // /var 2 Gb
    // /home 4 Gb
    // /usr 8 Gb
    // / 4Gb
    // Swap 520 Mb
  • Despues de instalar Ubuntu cambiar password a root
    sudo passwd root
    password
  • Editar /etc/apt/sources.list y activar los siguientes repositorios
    sudo editor /etc/apt/sources.list
  • descomentar y guardar
    deb http://us.archive.ubuntu.com/ubuntu/ dapper universe
    deb-src http://us.archive.ubuntu.com/ubuntu/ dapper universe
  • Actualizar repositorios
    sudo apt-get update
  • 1 Instalar librerias para acceso via SSH
    sudo apt-get install openssl libssl-dev ssh
  • 2 librerías de compilación de software, sirve para compilar Asterisk
    sudo apt-get install gcc make g++
  • 3 verificar que versiones de kernel tengo instalado en el servidor
    uname -a
  • me regresa algo como esto
    Linux AsteriskServer 2.6.15-23-386
  • 4 buscar las fuentes del kernel con las versiones instaladas en el server
    apt-cache search 2.6.15
  • 5 instalamos los encabezados para 2.6.15 espec?ficos para el procesador (linux-headers-2.6.15-23-386 , linux-source-2.6.15 , linux-image-2.6.15-23-386)
    sudo apt-get install linux-headers-2.6.15-23-server linux-image-2.6.15-23-server linux-source-2.6.15
  • 6 sinstalamos algunas utiler?as de linux, Lynx es un navegador web de texto, nmap es sniffer depuertos, emacs es un editor de textos potente aunque puedes usar editor instalado ya en Ubuntu y sencillo de usar
    sudo apt-get install nmap lynx emacs21
  • 7 festival son paquetes para el manejo de voz
    sudo apt-get install festival festival-dev
  • 8 para poder usar la consola de asterisk
    sudo apt-get install ncurses-base ncurses-bin ncurses-term libncurses5 libncursesw5 libncurses5-dev libncursesw5-dev
  • 9 librerias de compresion
    sudo apt-get install zlib1g zlib1g-dev
  • 10 librerias requeridas por el servicio web de FreePBX
    sudo apt-get install bison bison-doc
  • 11 librerias requeridas por el servicio web de FreePBX
    sudo apt-get install libxml2 libxml2-dev
  • 12 librerias requeridas por el servicio web de FreePBX
    sudo apt-get install libtiff4 libtiff4-dev
  • 13 librerias requeridas por el servicio web de FreePBX
    sudo apt-get install libasound2 libgsm1 libltdl3 libpq3 libspeex1 libsqlite0 libtonezone1 libaudiofile0 libaudiofile-dev
  • en caso que se vaya a usar una tarjeta sangoma, se requiere instalar flex para que funcione con el driver wanpipe
    sudo apt-get install flex
  • 14 librerias requeridas por Asterisk para el manejo de ayuda y de extraccion de archivos del CVS
    sudo apt-get install subversion curl doxygen
  • 15 librerias requeridas por el servicio web de FreePBX
    sudo apt-get install libnet-telnet-perl mime-construct libipc-signal-perl libmime-types-perl libproc-waitstat-perl
  • 16 Servidor web para FreePBX
    sudo apt-get install apache2
  • 17 librer?as requeridas por el servicio web de FreePBX
    sudo apt-get install php5 php5-cli php5-mysql php-pear libapache2-mod-php5 php5-curl php5-gd php-db
  • 18 base de datos para el CDR y FreePBX
    sudo apt-get install mysql-client-5.0 mysql-server-5.0 libmysqlclient15-dev
  • despues de instalar MySQL probablemente nos pedir? una configuracin como la siguiente
    2. Configurar como Internet Site
    3. localhost.localdomain
    ********************************
    2. ********************************
    2da Parte..
    ********************************
    2. ********************************
  • 19 creamos un repositorio local para almacenar los archivos fuente de asterisk
    mkdir ~/asterisk
    cd asterisk
  • Obtenemos los archivos y os almacenamos en el directorio creado
  • 20 gateway entre freepbx y asterisk
    wget http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz
  • 21 navaja suiza para manejo de archivos de sonido
    wget http://keihanna.dl.sourceforge.net/sourceforge/sox/sox-12.17.9.tar.gz
    wget http://heanet.dl.sourceforge.net/sourceforge/lame/lame-3.96.1.tar.gz
  • 22 Obtenemos los paquetes para el administrador web de FreePBX, podemos aqui instalar la version 2.2.1 de FreePBX la mas actualizada y seguir con el mismo procedimiento
    wget http://superb-east.dl.sourceforge.net/sourceforge/amportal/freepbx-2.1.1.tar.gz
  • 23 Obtenemos los archivos para Asterisk
    wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.13.tar.gz
    wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.4.tar.gz
    wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.15.tar.gz
    wget http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz
    wget http://ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.2.5.tar.gz
  • 24 Instalamos el Editor de Sonidos de Asterisk
    cd /usr/src/
    sudo tar -xvzf ~/asterisk/lame-3.96.1.tar.gz
    cd lame-3.96.1
    sudo ./configure –prefix=/usr –sysconfdir=/etc
    sudo make && sudo make install
  • 25 Instalamos SOX, utiler?a para manejar los sonidos en Asterisk
    cd /usr/src/
    sudo tar -xzvf ~/asterisk/sox-12.17.9.tar.gz
    cd sox-12.17.9
    sudo ./configure
    sudo make
    sudo make install
  • 26 Instalamos el gateway entre Asterisk y FreePBX
    cd /usr/src/
    sudo tar -xzvf ~/asterisk/asterisk-perl-0.08.tar.gz
    cd asterisk-perl-0.08
    sudo perl Makefile.PL
    sudo make all
    sudo make install
  • 27 Instalamos FreeBX el Administrador Web de Asterisk, aqui podemos tambien instalar la version 2.2.1 en vez de la 2.1.1
    cd /usr/src
    sudo tar -xzvf ~/asterisk/freepbx-2.1.1.tar.gz
    cd /usr/src/freepbx/freepbx-2.1.1
  • Comenzamos a instalar la Base de Datos para el Administrador Web FreePBX y para los CDR.
  • Iniciacilizacion de la implementaci?n de Bases de Datos en Mysql para Asterisk
  • Accedemos a MySQL si no han configurado su password de root mysql, solo presionar Entermysql -u root -p
    ENTER
    show databases;
    use mysql ;
    show tables;
    select * from user;
  • cambiamos los password de root y creamos un usuario para Asterisk
    update user set password = password(”PaSsWoRd”) where user = “root”;
    grant all privileges on *.* to asterisk@localhost identified by “PaSsWoRd”;
    flush privileges;
    exit
  • Nos validamos con el usuario de Asterisk creado
    mysql -u asterisk -pPaSsWoRd
  • Creamos las bases de datos
    mysql> create database asteriskcdrdb;
    mysql> create database asterisk;
    mysql> exit
  • Pasamos el esquema y la informaci?n de los scripts de bases de datos por default de FreePBX
    mysql -u asterisk -pPassw0rd asterisk Lo siguiente son los usuarios y password por default para FreePBX
    mysql -u root -pPaSsWoRd
  • asignamos en caso de que se requiera con el login y password por default
    GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY “amp109″;
    2. GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY “amp109″;
    3. flush privileges;exit
  • Termina la implementacion de Bases de Datos en Mysql para Asterisk
  • 28 creacion del usuario y grupo que manejara los procesos de asterisk
    sudo groupadd asterisk
    sudo useradd -c “PBX asterisk” -d /var/lib/asterisk -g asterisk asterisk
    sudo mkdir /var/run/asterisk
    sudo chown asterisk:asterisk /var/run/asterisk
  • 29 Cambiamo el usuario propietario de Apache
    sudo emacs /etc/group
  • para guardar presionar ctrl+x ctrl+s, para salir ctr+x, ctr+c
    www-data:x:33:asterisk
  • ejecutamos el comando find para ubicar el archivo de configuraci?n de apache
    find /etc/apache2/ -type f | xargs grep Group
  • 30 editamos el archivo de apache
    sudo emacs /etc/apache2/apache2.conf
  • en emacs para buscar, presionar Ctrl+s
  • 31 cambiar de www-data a asterisk
    User www-data
    Group www-data
  • por
    User asterisk
    Group asterisk
  • guardamos para guardar es presionar ctrl+x ctrl+s, para salir ctr+x, ctr+c
  • 32 cambiamos los permisos para el directorio de sesiones de PHP
    sudo chown -R asterisk /var/lib/php5
  • 33 edici?n de php para aumentar el tama?o de archivos que se suben al servidor web
    sudo emacs /etc/php5/apache2/php.ini
    upload_max_filesize = 32M
  • 34 creamos un directorio para la instalacion de los paquetes de Asterisk
    sudo mkdir /usr/src/asterisk
    cd /usr/src/asterisk
  • 35 libreria o drivers para tarjetas line PRI
    sudo tar zvxf ~/asterisk/libpri- 1.2.4.tar.gz
  • 36 librerias o drivers para tarjetas ZAPTEL
    sudo tar zvxf ~/asterisk/zaptel-1.2.13.tar.gz
  • 37 El PBX Asterisk
    sudo tar zvxf ~/asterisk/asterisk-1.2.15.tar.gz
  • 38 utilerias de asterisk(cdr, rep music on hold. etc)
    sudo tar zvxf ~/asterisk/asterisk-addons-1.2.5.tar.gz
  • 39 archivos de IVR por default
    sudo tar zvxf ~/asterisk/asterisk-sounds-1.2.1.tar.gz
  • 40 compilacion de PRI
    cd libpri-1.2.4
    sudo make & sudo make install
  • 41 compilaci?n de Zaptel
    cd ../zaptel-1.2.13
    sudo make clean
    sudo make linux26
    sudo make install
  • 42 compilacion de Asterisk
    cd ../asterisk-1.2.15
    sudo make clean
    sudo make
    sudo make install
    sudo make samples
    sudo make progdocs
  • 43 compilacion de Utilerias de Asterisk
    cd ../asterisk-addons-1.2.5
    sudo make
    sudo make installcd ../asterisk-sounds-1.2.1
    sudo make
    sudo make install
  • 44 reiniciamos el servidor web apache
    sudo /etc/init.d/apache2 restart
  • 45 Antes de instalar FreePBX creamos el directorio de asterisk en /var/run
    sudo mkdir /var/run/asterisk
  • 46 Editamos el archivo de configuraci?n de Asterisk
    sudo emacs /etc/asterisk/asterisk.conf
  • 47 cambiamos el directorio de
    RUNASTERISK=/var/run
  • a
    RUNASTERISK=/var/run/asterisk
  • 48 asignamos los permisos
    chown -R asteriks:asterisk /var/run/asterisk
  • continuamos con la instalaci?n de FreePBX
    cd /usr/src/freepbx/freepbx-2.1.1/
    sudo pear install db
  • si no encontrara el paquete db, bajarlo de internet e instalarmo manualmente: sudo pear install db.17.0.0.tgz
    sudo mkdir /var/www/cgi-bin
    sudo chown asterisk:asterisk /var/www/cgi-bin
    sudo ./install_amp
  • despues de ejecutar install_amp pedirá los valores para crear el archivo de configuraci?n.
  • Aquí introducir el usuario de la base de datos que se creo previamente
    Enter your USERNAME to connect to the ‘asterisk’ database:
    asteriskuser asterisk
  • Aqui introducir el password de la base de datos que se creo previamente
    Enter your PASSWORD to connect to the ‘asterisk’ database:
    amp109 Passw0rd
  • Aqui introducir el nombre del servidor de la base de datos, com?nmente localhost
    Enter the hostname of the ‘asterisk’ database:
    localhost ENTER
  • Aqui introducir el usuario que se usara como admin del API de Asterisk
    Enter a USERNAME to connect to the Asterisk Manager interface:
    admin admin
  • Password del API, importante para conectar aplicaciones terceras a Asterisk
    Enter a PASSWORD to connect to the Asterisk Manager interface:
    amp111 Passw0rd
  • Ruta de instalacion del Servidor de Asterisk
    Enter the path to use for your AMP web root:
    /var/www/html ENTER
    Created /var/www/html
  • Ruta para instalar el Panel Flash de Asterisk
    Enter the path to use for your FOP web root:
    /var/www/html/panelENTER
    Created /var/www/html/panel
  • Introducir la ruta para los CGI de Asterisk
    Enter the path to your Apache cgi-bin:
    /var/www/cgi-bin
  • Introduzca la direccion IP de su servidor
    Enter the IP ADDRESS or hostname used to access the AMP web-admin:
    xx.xx.xx.xx localhost
  • Introduzca el password pra poder usar el FOP
    Enter a PASSWORD to perform call transfers with the Flash Operator Panel:
    passw0rd Passw0rd
  • Seleccionar valores por Default
    Use simple Extensions extensions admin or separate Devices and Users deviceanduser?
    extensions
  • Seleccionar Default
    Enter directory in which to store AMP executable scripts:
    /var/lib/asterisk/bin
    Created /var/lib/asterisk/bin
  • Seleccionar Default
    Enter directory in which to store super-user scripts:
    /usr/sbin
  • si marcara algun error installamp revisar usuarios de base de datos, librerías de php y de mysql, reiniciar apache y peardb, php-db
  • en caso de que tuviera un error al ejecutar FreePBX puede reconfigurarlo previamente elimine el archivo de configuracion en /etc/amportal.conf
  • 49 creamos la carpeta donde se almacenaran los sonidos del IVR
    mkdir /var/lib/asterisk/sounds/custom
  • 50 configuramos los permisos para el directorio de Asterisk
    chown -R asterisk:asterisk /var/lib/asterisk/
  • 51 ejecutamos amportal
    sudo /usr/sbin/amportal start
  • o como root
    su -
    password
  • y ejecutamos
    /usr/sbin/amportal start
  • verificamos
    ps aux
  • y deberiamos ver algo parecidoasterisk 5537 0.0 0.1 3676 844 pts/0 S 13:54 0:00 /bin/sh /usr/sbin/safe_asterisk -U asterisk -G asterisk
    asterisk 5544 0.2 1.4 15452 7080 pts/0 Sl 13:54 0:00 /usr/sbin/asterisk -U asterisk -G asterisk -vvvg -c
    asterisk 5585 0.0 0.1 3848 832 pts/0 S 13:54 0:00 -su -c cd /var/www/html/panel && /var/www/html/panel/safe_opseasterisk 5586 0.0 0.2 3640 1324 pts/0 S 13:54 0:00 /bin/bash /var/www/html/panel/safe_opserver
    asterisk 5588 0.3 1.5 10008 7352 pts/0 S 13:54 0:00 /usr/bin/perl -w ./op_server.pl
  • sudo emacs /etc/default/asterisk
    RUNASTERISK=yes
  • Abrir en un navegador de preferencia Firefox la direccion del servidor Asterisk por ejemplo que el servidor corra en una IP 192.168.1.101
    http://192.168.1.101/html/admin/
  • Introducimos el login y password configurado:
    admin
    admin
  • Ahora tenemos habilitado El conmutador de Voz Sobre IP Asterisk
  • Y el administrador Web de Asterisk FreePBX.
  • Descargar modulos de administracion de Asterisk.
  • Para configurar sus tarjetas ZAptel, Sangoma, IVR, AGIs, Festival, etc.. ver el procedimiento de instalacion que he agregado en este mismo WiKi o en mi blog http://phylevn.mexrom.com
  • posted in Linux | 0 Comments

    5th June 2007

    INSTALAR VMWARE SERVER SOBRE UNBUNTU LTS 6.0.6

    How To Install VMware Server On Ubuntu 6.06 LTS (Dapper Drake)

    How To Install VMware Server On Ubuntu 6.06 LTS (Dapper Drake)

    Version 1.1
    Author: Till Brehm
    Last edited 08/18/2006

    This tutorial provides step-by-step instructions on how to install the free VMware Server (version 1.0) on Ubuntu 6.06 LTS (Dapper Drake).

    VMware has just released version 1.0 of its free VMware Server. With VMware Server you can create and run guest operating systems (”virtual machines”) such as Linux, Windows, FreeBSD, etc. under a host operating system. This has the benefit that you can run multiple operating systems on the same hardware which saves a lot of money, and you can move virtual machines from one VMware Server to the next one (or to a system that has the VMware Player which is also free). In this article we use Ubuntu 6.06 LTS (Dapper Drake) as the host operating system.

    I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

    1 Preliminary Note

    I assume you have already set up a basic Ubuntu 6.06 system. It doesn’t matter if you use Ubuntu’s server or desktop version. If you use the server version, you can set up your system as described on the first three pages of this tutorial: The Perfect Setup - Ubuntu 6.06 LTS Server (Dapper Drake).

    You should have a working root account (as the following steps have to be run as root) or run

    sudo su

    to get root priveliges and also a static IP address. In this tutorial I use the IP address 192.168.0.100.

    If you have another computer available, install ssh-server and use a ssh client like putty to access the server remotely; copying and pasting the commands below is easier than typing them out.

    apt-get install ssh openssh-server

    2 Installing Required packages

    Now we install the packages required by VMware on our Ubuntu system:

    apt-get install libx11-6 libx11-dev libxtst6 xlibs-dev xinetd wget

    apt-get install linux-headers-`uname -r` build-essential

    apt-get install gcc binutils-doc cpp-doc make manpages-dev autoconf automake1.9 libtool flex bison gdb gcc-doc gcc-4.0-doc libc6-dev-amd64 lib64gcc1

    and create the directory /var/vm where we want to install our virtual machines later. The virtual machines require much disk space, make sure you have enough free space on your /var partition for the virtual machines.:

    mkdir /var/vm
    cd /tmp

    3 Getting VMware Server

    The VMware server can be downloaded for free from the VMware website: http://www.vmware.com/download/server/
    To run the VMware Server software you need a (free) serial number, that can be requested by clicking on the “Register now” button on the download page.

    4 Downloading The Software

    To setup VMWare Server on Ubuntu, we need the following packages from the VMware downloads page:

    VMware Server for linux (Binary tar.gz)
    Management Interface (Binary tar.gz)

    To create new virtual machines, we need VMware server client package either for Windows if you want to create them from your Windows workstation or for Linux if you have a Linux workstation.

    For downloading the software to your server, I recommend to use the linux commandline program wget. The wget syntax is as follows:

    wget [URL of the file that shall be downloaded]

    Unpacking the server tar.gz:

    tar xvfz VMware-server-*.tar.gz

    Running the installer script:

    cd vmware-server-distrib
    ./vmware-install.pl

    The installer asks you a few questions. Most of the time you can accept the default value:

    Creating a new installer database using the tar3 format.

    Installing the content of the package.

    In which directory do you want to install the binary files?
    [/usr/bin] /usr/bin

    What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
    [/etc] /etc

    What is the directory that contains the init scripts?
    [/etc/init.d] /etc/init.d

    In which directory do you want to install the daemon files?
    [/usr/sbin] /usr/sbin

    In which directory do you want to install the library files?
    [/usr/lib/vmware] /usr/lib/vmware

    The path “/usr/lib/vmware” does not exist currently. This program is going to
    create it, including needed parent directories. Is this what you want? [yes] yes

    In which directory do you want to install the manual files?
    [/usr/share/man] /usr/share/man

    In which directory do you want to install the documentation files?
    [/usr/share/doc/vmware] /usr/share/doc/vmware

    The path “/usr/share/doc/vmware” does not exist currently. This program is going
    to create it, including needed parent directories. Is this what you want?
    [yes] yes

    The installation of VMware Server 1.0.0 build-28343 for Linux completed
    successfully. You can decide to remove this software from your system at any
    time by invoking the following command: “/usr/bin/vmware-uninstall.pl”.

    Before running VMware Server for the first time, you need to configure it by
    invoking the following command: “/usr/bin/vmware-config.pl”. Do you want this
    program to invoke the command for you now? [yes] yes

    Making sure services for VMware Server are stopped.

    Stopping VMware services:
    Virtual machine monitor done

    You must read and accept the End User License Agreement to continue.
    Press enter to display it.
    ….. snip [LICENCE TEXT] ……

    Do you accept? (yes/no) yes
    Thank you.

    Configuring fallback GTK+ 2.4 libraries.

    In which directory do you want to install the mime type icons?
    [/usr/share/icons] /usr/share/icons

    The path “/usr/share/icons” does not exist currently. This program is going to
    create it, including needed parent directories. Is this what you want? [yes] yes

    What directory contains your desktop menu entry files? These files have a
    .desktop file extension. [/usr/share/applications] /usr/share/applications

    The path “/usr/share/applications” does not exist currently. This program is
    going to create it, including needed parent directories. Is this what you want?
    [yes] yes

    In which directory do you want to install the application’s icon?
    [/usr/share/pixmaps] /usr/share/pixmaps

    Trying to find a suitable vmmon module for your running kernel.

    The module bld-2.6.15-23-i386server-Ubuntu6.06 loads perfectly in the running
    kernel.

    Do you want networking for your virtual machines? (yes/no/help) [yes] yes

    Configuring a bridged network for vmnet0.

    The following bridged networks have been defined:

    . vmnet0 is bridged to eth0

    All your ethernet interfaces are already bridged.

    Do you want to be able to use NAT networking in your virtual machines? (yes/no)
    [yes] yes

    Configuring a NAT network for vmnet8.

    Do you want this program to probe for an unused private subnet? (yes/no/help) yes
    Probing for an unused private subnet (this can take some time)…

    The subnet 192.168.246.0/255.255.255.0 appears to be unused.

    The following NAT networks have been defined:

    . vmnet8 is a NAT network on private subnet 192.168.246.0.

    Do you wish to configure another NAT network? (yes/no) [no] no

    Do you want to be able to use host-only networking in your virtual machines?
    [yes] yes

    Configuring a host-only network for vmnet1.

    Do you want this program to probe for an unused private subnet? (yes/no/help)
    [yes] yes

    Probing for an unused private subnet (this can take some time)…

    The subnet 172.16.37.0/255.255.255.0 appears to be unused.

    The following host-only networks have been defined:

    . vmnet1 is a host-only network on private subnet 172.16.37.0.

    Do you wish to configure another host-only network? (yes/no) [no] no

    Trying to find a suitable vmnet module for your running kernel.

    The module bld-2.6.15-23-i386server-Ubuntu6.06 loads perfectly in the running
    kernel.

    Please specify a port for remote console connections to use [902] 902

    Stopping internet superserver: xinetd.
    Starting internet superserver: xinetd.
    Configuring the VMware VmPerl Scripting API.

    Building the VMware VmPerl Scripting API.

    Using compiler “/usr/bin/gcc”. Use environment variable CC to override.

    Installing the VMware VmPerl Scripting API.

    The installation of the VMware VmPerl Scripting API succeeded.

    Generating SSL Server Certificate

    In which directory do you want to keep your virtual machine files?
    [/var/lib/vmware/Virtual Machines] /var/vm

    Please enter your 20-character serial number.

    Type XXXXX-XXXXX-XXXXX-XXXXX or ‘Enter’ to cancel: your VMware Server serial number

    Starting VMware services:
    Virtual machine monitor done
    Virtual ethernet done
    Bridged networking on /dev/vmnet0 done
    Host-only networking on /dev/vmnet1 (background) done
    Host-only networking on /dev/vmnet8 (background) done
    NAT service on /dev/vmnet8 done

    The configuration of VMware Server 1.0.0 build-28343 for Linux for this running
    kernel completed successfully.

    5 Installing The VMware Management Interface

    The VMware Management Interface is a Web-based management tool that allows you to

    • monitor the state of virtual machines and the VMware Server host on which they are running.
    • control (power on, suspend, resume, reset and power off) the virtual machines on that host.
    • view details about each virtual machine, including system summary, hardware information, any connected users and a log of recent events.

    (Please note: it cannot be used to create virtual machines. To do this, you must install the VMWare console (available for Windows and Linux) on a client PC.)

    cd /tmp
    tar xvfz VMware-mui-*.tar.gz
    cd vmware-mui-distrib
    ./vmware-install.pl

    Accept the end user licence:

    Do you accept? (yes/no) yes

    Thank you.

    Installing the content of the package.

    In which directory do you want to install the binary files?
    [/usr/bin] /usr/bin

    What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
    [/etc] /etc

    What is the directory that contains the init scripts?
    [/etc/init.d] /etc/init.d

    In which directory do you want to install the VMware Management Interface files?
    [/usr/lib/vmware-mui] /usr/lib/vmware-mui

    The path “/usr/lib/vmware-mui” does not exist currently. This program is going
    to create it, including needed parent directories. Is this what you want?
    [yes] yes

    In which directory would you like to install the documentation files?
    [/usr/lib/vmware-mui/doc] /usr/lib/vmware-mui/doc

    The path “/usr/lib/vmware-mui/doc” does not exist currently. This program is
    going to create it, including needed parent directories. Is this what you want?
    [yes] yes

    Before running VMware Management Interface for the first time, you need to
    configure it by invoking the following command:
    “/usr/bin/vmware-config-mui.pl”. Do you want this program to invoke the command
    for you now? [yes] yes

    The installation of VMware Management Interface 1.0.0 build-28343 for Linux
    completed successfully. You can decide to remove this software from your system
    at any time by invoking the following command:
    “/usr/bin/vmware-uninstall-mui.pl”.

    Before running VMware Management Interface for the first time, you need to
    configure it by invoking the following command:
    “/usr/bin/vmware-config-mui.pl”. Do you want this program to invoke the command
    for you now? [yes] yes

    Configuring httpd.conf to run Apache as:
    User: www-data and Group: nogroup

    Set the number of minutes before a http session times out. (This is the length
    of time before someone connecting to VMware Management Interface will be logged
    out) [60] 60

    Generating SSL Server Certificate

    Starting httpd.vmware: done
    The configuration of VMware Management Interface completed successfully.

    Create a directory for the VMware httpd:

    mkdir /var/run/vmware/httpd
    chown www-data:www-data /var/run/vmware/httpd

    You will now be able to login the the VMware management interface with the URL:

    https://192.168.0.100:8333/

    To login use the username root and the password of your root system user.

    This interface shows status information of the installed VM instances and you are able to start and stop VM instances:

    To create new VM instances, use the VMware console which is availabe as Linux and Windows GUI application.

    There are many ready-to-run appliances for the VMware server available, for example the ISPConfig webhosting appliance based on the HowtoForge perfect setup for Debian 3.1:

    http://www.vmware.com/vmtn/appliances/directory/342

    Many other appliances can be found in the VMWare Appliances directory:

    http://www.vmware.com/vmtn/appliances/

    6 Creating A Virtual Machine

    We use the VMWare Linux or Windows GUI application to create a new virtual machine on our VMware server.

    Login to your server with the IP address or hostname, the user root and the root password.

    Click on New Virtual Machine and follow the whizard. The wizard asks you to select:

    • Operating system (Linux, Windows, Novell Netware, Solaris or other operating system)
    • Operating system version
    • Location and virtual machine name. The folder /var/vm that we created in the setup is preselected.
    • Networking: If you want the virtual machine to be part of the same network than the server itself, select bridged networking.
      If you want to use a virtual NAT, select Network address translation.
    • Enter the size of your virtual harddisk. I recommend to disable the option that creates the virtual harddisk in full size instantly, the harddisk will then grow with the data that you store inside up to the max. size you selected.
    • After you finished the VM creation wizard, put the boot disk of the operating system you want to install in the CD / DVD drive of your server and start the VM.

    All trademarks belong to their respective owners. We thank VMware Inc. for the permission to write this Howto.

    posted in Linux | 0 Comments

    4th June 2007

    INSTALACION DE XEN SOBRE UBUNTU LTS 6.0.6

    How To Set Up Xen 3.0 From Binaries In Ubuntu 6.06 LTS (Dapper Drake)

    Version 1.0
    Author: Ásgeir Bjarni Ingvarsson <istari AT hlekkir DOT com>
    Last Edited: June 13. 2006

    This particular way of installing and configuring Xen is just the path of least resistance for me. There are many other possible ways of configuring the system.

    1 Install a clean base server system.

    Setup Ubuntu like you normally would. I have created 3 partitions on hda, but you can do it any way you like. Just keep your differences in mind when you edit the config files.

    · hda1 is swap

    · hda2 is 2 GB and mounted as /

    · hda3 is the rest of the disk and mounted as /xen-images

    2 Update the system and install Xen

    2.1 Install Xen and configure it

    Open a root shell so you don’t have to type sudo for every command.

    sudo -s

    Update the system and install nessecary packages.

    apt-get update
    apt-get upgrade
    apt-get install iproute python python-twisted bridge-utils debootstrap

    Download and extract the Xen 3.0 tarball from XenSource.

    tar xvf xen-3.0.1-install-x86_32.tgz
    cd xen-3.0.1-install
    ./install.sh

    Check for error messages - it should say OK to all.

    Next we create modules.dep and map files for the new kernel. (see /lib/modules for the correct kernel version)

    /sbin/depmod -a 2.6.16-xen

    Edit /etc/mkinitramfs/modules and append the following line:

    loop max_loop=64

    If you run out of loop devices later just increase max_loop and rebuild the initrd.

    Create an initrd image. Use the same version number as before.

    cd /boot
    mkinitramfs -o initrd.img-2.6.16-xen 2.6.16-xen

    Edit /boot/grub/menu.lst placing the following lines before the Automagic section

    title Xen 3.0 / XenLinux 2.6
    kernel /boot/xen-3.gz
    module /boot/vmlinuz-2.6-xen root=/dev/hda2 ro
    module /boot/initrd.img-2.6.16-xen

    Make Xen start up and autostart selected guests when the system starts up. xend must start before, and must be stopped after xendomains.

    update-rc.d xend start 30 2 3 4 5 . stop 31 0 1 6 .
    update-rc.d xendomains start 31 2 3 4 5 . stop 30 0 1 6 .

    Disable Thread-Local Storage (remember to check this after every update)

    mv /lib/tls /lib/tls.disabled

    2.2 The following workarounds may not be required later, but I had to do them.

    Rename xen-backend.rules

    mv /etc/udev/rules.d/xen-backend.rules /etc/udev/rules.d/92-xen-backend.rules

    To make sure that /var/run/xenstored and /var/run/xend exist. Edit /etc/init.d/xend and insert the following lines after the check for /proc/xen/capabilities

    if [ ! -d /var/run/xend ] ; then
    mkdir -p /var/run/xend
    fi

    if [ ! -d /var/run/xenstored ] ; then
    mkdir -p /var/run/xenstored
    fi

    Edit /etc/init.d/xendomains and change the LOCKFILE line to read

    LOCKFILE=/var/lock/xendomains

    2.3 All done for this part so reboot.

    When the system is back up try the following command to verify that everything is ok.

    xm list

    You should see something similar to this:

    Name ID Mem(MiB) VCPUs State Time(s)
    Domain-0 0 463 1 r—– 42.3

    3 Configuring the guest domains

    3.1 Create disk images and bootstrap them

    Create a mountpoint for the images.

    mkdir -p /xen-images/mnt

    Create a 1 GB image file and 500 MB swap file, for larger images increase count.

    dd if=/dev/zero of=/xen-images/guest_base.img bs=1024k count=1000
    dd if=/dev/zero of=/xen-images/guest_base-swap.img bs=1024k count=500

    Change permissions for the image files. No one should have access to your Domain-0 computer since that would compromise security for all of the guest domains, but this is a good idea anyway and doesn’t affect Xen.

    chmod 640 /xen-images/guest_base*

    Format guest_base.img as ext3 and then format guest_base-swap.img as swap. When it says “/xen-images/guest_base.img is not a block special device.” answer yes to proceed anyway.

    mkfs.ext3 /xen-images/guest_base.img
    mkswap /xen-images/guest_base-swap.img

    Mount the guest image and bootstrap it. You should replace http://archive.ubuntu.com/ubuntu/ with a mirror that is closer to you.

    mount -o loop /xen-images/guest_base.img /xen-images/mnt
    debootstrap –arch i386 dapper /xen-images/mnt http://archive.ubuntu.com/ubuntu/

    Copy your /etc/apt/sources.list to the new image

    cp /etc/apt/sources.list /xen-images/mnt/etc/apt/

    Copy the kernel modules.

    cp -dpR /lib/modules/2.6.16-xen /xen-images/mnt/lib/modules/

    Disable Thread-Local Storage.

    mv /xen-images/mnt/lib/tls /xen-images/mnt/lib/tls.disabled

    Configure networking for the guest by editing /xen-images/mnt/etc/network/interfaces

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    # Uncomment this and configure after the system has booted for the first time
    #auto eth0
    #iface eth0 inet static
    # address 192.168.0.101
    # netmask 255.255.255.0
    # broadcast 192.168.0.255
    # gateway 192.168.0.1
    # dns-nameservers 192.168.0.1

    Create /xen-images/mnt/etc/hosts and make it look like this.

    127.0.0.1 localhost localhost.localdomain
    127.0.0.1 guest

    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts

    Create /xen-images/mnt/etc/hostname

    echo guest > /xen-images/mnt/etc/hostname

    Edit /xen-images/mnt/etc/fstab so it looks like this.

    proc /proc proc defaults 0 0
    /dev/hda1 / ext3 defaults,errors=remount-ro 0 1
    /dev/hda2 none swap sw 0 0

    Unmount the image.

    umount /xen-images/mnt

    If you get this warning “umount: /xen-images/mnt: device is busy” don’t worry, it’s not important.

    3.2 Boot up the base image to finalize the configuration

    Create a config file for the guest /etc/xen/baseimage

    # -*- mode: python; -*-
    kernel = “/boot/vmlinuz-2.6.16-xen”
    ramdisk = “/boot/initrd.img-2.6.16-xen”
    memory = 128
    name = “baseimage”
    vif = ['bridge=xenbr0']
    disk = ['file:/xen-images/guest_base.img,hda1,w','file:/xen-images/guest_base-swap.img,hda2,w']
    ip = “192.168.0.101″
    netmask = “255.255.255.0″
    gateway = “192.168.0.1″
    hostname = “baseimage”
    root = “/dev/hda1 ro”
    extra = “4″

    Start the guest.

    xm create baseimage -c

    Login as root and set the root password.

    Enable shadow passwords.

    shadowconfig on

    Create a backup of /etc/network/interfaces

    cp /etc/network/interfaces /etc/network/interfaces.bak

    Edit /etc/network/interfaces and put in correct values so you can access the Internet

    Start networking.

    ifup -a

    Install packages (add ubuntu-desktop and more if you want).

    apt-get update
    apt-get install ubuntu-base configure-debian openssh-server

    Disable Thread-Local Storage if it has been updated.

    mv /lib/tls /lib/tls.disabled

    Configure the system any way you like, I recommend that you try every menu item. You should do utils->console-data before utils->console-common.

    configure-debian

    Add the new user you created to /etc/sudoers

    visudo

    Stop networking.

    ifdown -a

    Replace /etc/network/interfaces with the backup copy.

    mv /etc/network/interfaces.bak /etc/network/interfaces

    You are now done setting up the base image so shut it down.

    4 Creating your first guest domain

    Make a copy of the base guest images.

    cp /xen-images/guest_base.img /xen-images/guestdom1.img
    cp /xen-images/guest_base-swap.img /xen-images/guestdom1-swap.img

    Make a copy of /etc/xen/baseimage for the new guest.

    cp /etc/xen/baseimage /etc/xen/guestdom1

    Edit /etc/xen/guestdom1 and change name, disk and hostname to the following values.

    name = “guestdom1″
    disk = ['file:/xen-images/guestdom1.img,hda1,w','file:/xen-images/guestdom1-swap.img,hda2,w']
    hostname = “guestdom1″

    You will want to change the following files for each new guest you create.

    · /etc/hostname

    · /etc/hosts

    · /etc/network/interfaces

    To make the guest start up automatically and make Domain 0 wait for it before shutting down.

    ln -s /etc/xen/guestdom1 /etc/xen/auto/

    Or if you want to start and stop the guest manually.

    xm create guestdom1

    posted in Linux | 1 Comment

    28th April 2007

    Configurar tarjeta FXO WILDCARD X100P con Asterisk FREEPBX

    Breve Explicación:
    La tarjetas x101p y x100p, son tarjetas compatibles con el sistema Asterisk, las cuales te permiten implementar de manera muy economica, un sistema de PBX tradiconal para su hogar u oficina que incluye caracteristicas como:

    Multiples troncales y extensiones
    Identificador de Llamadas
    Buzon de Mensajes
    Conferencia multiple
    Sistemas de respuesta interactiva (IVR)
    Grabacion digital de llamadas
    Limite de tiempo para llamadas
    Estadisticas de llamadas

    Los dispositivos FXO permiten manejar una línea telefónica externa, los dispositivos FXO solo “reciben” tono de marcado. Una tarjeta FXO analógica es un modem. Por definición. Modula y demodula datos por banda analógica. Con asterisk las extensiones no estan limitadas al uso de dispositivos FXO.

    Instalación:
    Instalamos nuestra tarjeta en un bus PCI libre, iniciamos la PC y al cargar la aplicación KUDUZU reconocerá el chip de nuestra tarjeta que por lo general será Motorola, Intel o Ambient. Seleccionamos CONFIGURE, y dejamos que siga cargando el sistema.

    Para instalar este hardware solo basta con definir los parametros de inicialización de la tarjeta, tener cargado el módulo de la tarjeta (wcfxo) y configurar el archivo /etc/asterisk/zapata.conf para que Asterisk utilice este dispositivo:

    Hacemos un genzaptelconf para que Trixbox lo reconozca.

    [root@danetperu.com ~]# genzaptelconf

    Esto creará una entrada en nuestro zaptel.conf y quedará algo así:

    [root@danetperu.com ~]# cat /etc/zaptel.conf
    fxsks=1
    loadzone = us
    defaultzone=us

    Hacemos un Ztcfg para chequear que nuestra señalización sea FXS KS

    [root@danetperu.com ~]# ztcfg -vvv
    Zaptel Configuration
    ======================
    Channel map:

    Channel 01: FXS Kewlstart (Default) (Slaves: 01)

    1 channels configured.

    Ahora Editaremos nuestro Zapata.conf y veremos que quede como en el siguiente ejemplo:

    [root@danetperu.com ~]# nano /etc/asterisk/zapata.conf
    [trunkgroups]

    [channels]

    language=es
    context=from-pstn
    signalling=fxs_ks
    rxwink=300 ; Atlas seems to use long (250ms) winks
    usecallerid=yes
    hidecallerid=no
    callwaiting=yes
    usecallingpres=yes
    callwaitingcallerid=yes
    threewaycalling=yes
    transfer=yes
    cancallforward=yes
    callreturn=yes
    echocancel=yes
    echocancelwhenbridged=no
    echotraining=800
    rxgain=1.0
    txgain=1.0
    group=0
    callgroup=1
    pickupgroup=1
    immediate=no
    busydetect=yes ; Muy Importante para esta tarjeta
    busycount=6 ; Muy Importante para esta tarjeta

    ;faxdetect=both
    faxdetect=incoming
    ;faxdetect=outgoing
    ;faxdetect=no

    ;Include genzaptelconf configs
    #include zapata-auto.conf

    group=1

    ;Include AMP configs
    #include zapata_additional.conf

    ——————
    Verificamos que esté bien configurado y sin alarmas, para eso debemos conectar nuestra linea análoga en el puerto LINE de nuestra tarjeta y debemos tener lo siguiente:

    [root@danetperu.com ~]# zttool
    ———— Zapata Telephony Interfaces ——–
    Alarms Span
    OK Wildcard X100P Board
    UNCONFIGURED ZTDUMMY/1 1

    ******* select ******* OK ********

    Para ver que tipo de tarjeta tenemos en nuestro sistema tipeamos lo siguiente:

    [root@danetperu.com ~]# dmesg
    (….)
    Zapata Telephony Interface Registered on major 196
    Zaptel Version: 1.2.5 Echo Canceller: KB1
    Registered Tormenta2 PCI
    ACPI: PCI interrupt 0000:00:0e.0[A] -> GSI 9 (level, low) -> IRQ 9
    PCI: Setting latency timer of device 0000:00:0e.0 to 64
    wcfxo: DAA mode is ‘FCC’
    Found a Wildcard FXO: Wildcard X100P

    Registered tone zone 0 (United States / North America)

    Ahora solo tenemos que entrar en el Freepbx y verificar:

    Ajustes -> Troncales -> Zap/g0
    Maximo de Canales Simultaneos = 1

    posted in Linux | 1 Comment

    5th April 2007

    proFTPD Ubuntu

    Ver documento adjunto

    Instalar PROFtpd Ubuntu

    posted in Linux | 0 Comments

    3rd April 2007

    Instalar Apache,PHP,MySql en Ubuntu 6.10

    Instalar Apache

    apt-get install apache2 php5 libapache2-mod-php5

    Archivo de configuracion de Apache:

    /etc/apache2/apache2.conf

    Directorio Web:

    /var/www

    Crear test.php para checkear el correcto funcionamiento de apache:

    nano /var/www/test.php

    Instalar MySQL

    apt-get install mysql-server mysql-client php5-mysql

    Cambiar la contraseña del root:

    mysql -u root
    mysql> USE mysql;
    mysql> UPDATE user SET Password=PASSWORD(’new-password’) WHERE user=’root’;
    mysql> FLUSH PRIVILEGES;

    Instalar phpmyadmin

    Añadir en el archivo /etc/apt/sources.list las siguientes lineas:

    deb http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse

    apt-get update
    apt-get install phpmyadmin

    Archivo de configuracion:

    /etc/phpmyadmin

    Añadir la linea (Include /etc/phpmyadmin/apache.conf) en el archivo /etc/apache2/apache2.conf

    /etc/init.d/apache2 restart

    posted in Linux | 0 Comments

    2nd April 2007

    VMware Server en Ubuntu Server 6.10

    Instalación típica de Ubuntu server, sin LAMP ni servidor DNS

    Una vez instalado, habilitamos la cuenta de root

    sudo passwd root
    su

    Habilitamos repositorios y actualizamos

    vi /etc/apt/sources.list
    apt-get update
    apt-get upgrade
    apt-get install libx11-6 libx11-dev libxtst6 xlibs-dev xinetd wget
    apt-get install linux-headers-`uname -r` build-essential

    Configuramos la interfaz de red para que use IP estática

    vi /etc/network/interfaces

    y ponemos

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto eth0
    iface eth0 inet static
    address 192.168.0.100
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1

    /etc/init.d/networking restart

    Instalamos el VMware Server

    cd /tmp
    wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.1-29996.tar.gz
    (segundo cafe… a menos que hayas sido listo y lo tengas en cd)
    tar xvfz VMware-server-1.0.1-29996.tar.gz
    cd vmware-server-distrib
    ./vmware-install.pl
    (dejar todo por defecto… como mucho cambiar el directorio de las maquinas virtuales, aunque no es necesario)

    Cuando pida la licencia se puede pillar aqui -> http://register.vmware.com/content/registration.html

    Cliente para conectar:
    Windows:
    http://download3.vmware.com/software/vmserver/VMware-server-win32-client-1.0.1-29996.zip
    Linux:
    http://download3.vmware.com/software/vmserver/VMware-server-linux-client-1.0.1-29996.zip

    Para poder administrarlo via web (opcional)

    rm -f /bin/sh
    ln -s /bin/bash /bin/sh
    cd /tmp
    wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.1-29996.tar.gz
    tar xvfz VMware-mui-1.0.1-29996.tar.gz
    cd vmware-mui-distrib
    ./vmware-install.pl

    desde cualquier sitio http://xxx.xxx.xxx.xxx:8222

    posted in Linux | 0 Comments