Tuesday, January 11, 2011

Linux: Learn the basics

So, the truth about Linux - I can't tell exactly but the proven fact is Linuxes / Unixes are build for server environments and be the Server rather End client. Servers' need to be very resource efficient and GUIs are never an option when we are critical to our resources.

In short, Linux can be used as Desktop machines but one-way-or-another one needs to use command line to get things done.

While learning to deploy VoIP servers- As I plan on -we must be very friendly with black&white command line screen and learn as we go.

Following are some basic Linux Commands we need every now and then from viewing a directory to creating medium level shell scripts.

Viewing, copying, moving and deleting files


ls

Display the contents of the current directory

ls -a

Display also hidden files and hidden directories

cp srcfilename /path/destfilename

Copy srcfilename into directory /path with name destfilename

cp -r /dir/name /path/dir/name

Copy the entire directory /name into /path/dir/name

rm name

Remove a file or directory called name

rm -r name

Remove an entire directory as well as its included files and subdirectories

mv filename /path/dir_name

Move file:filename into directory:/path/dir_name

mv oldfilename1 newfilename2

Rename oldfilename1 to newfilename2

cat myfile.txt

Display myfile.txt contents to screen

more myfile.txt

Display contents of myfile.txt in pages Press spacebar to view next page

head myfile.txt

Display first 10 lines of myfile.txt

head -15 impfile.file

Display first 15 lines of impfile.file

tail filename

Display last 10 lines of filename

tail -15 filename

Display last 15 lines filename

pwd

Display current working directory

cd /path/dir/name

Change directory to /path/dir/name

cd ..

Go directory up one step

mkdir dir_name

Create directory dir_name

rmdir dir_name

Delete directory dir_name


I'll bring you guys with more commands and try not to overload. Meanwhile keep on practicing :)




Wednesday, January 5, 2011

Installing our First VoIP Server (Asterisk 1.8)

What we should already have:
A Linux server with internet connectivity.(CentOS in my case)

What we'll do:
Install Asterisk version 1.8.X, a widely known FREE VoIP Server/telephony toolkit.

Copy-Paste commands below to setup Asterisk.(each # is a new command)

# yum -y install gcc gcc-c++ kernel-devel bison openssl openssl-devel perl perl-Net-SSLeay perl-Crypt-SSLeay libtermcap-devel ncurses-devel doxygen curl-devel newt-devel mlocate lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron speex speex-devel unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel mysql-connector-odbc mysql mysql-devel mysql-server php-mysql php-mbstring php-mcrypt flex screen libtiff-devel

# cd /usr/src

# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8.1.1.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.2.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.4.0+2.4.0.tar.gz

# tar zxvf asterisk-1.8.1.1.tar.gz
# tar zxvf asterisk-addons-1.6.2.2.tar.gz
# tar zxvf dahdi-linux-complete-2.4.0+2.4.0.tar.gz

# cd dahdi-linux-complete-2.4.0+2.4.0
# make all
# make config
# cd..

# cd asterisk-1.8.1.1
# ./configure
# make && make install

# cd ../asterisk-addons-1.6.2.2
# ./configure
# make
# make install

# asterisk
# asterisk -r

Ast-1-8*CLI>

Viola -- Now you are all Done, Your first Asterisk server is up and running- Now All you need to do is configure it according to your requirements.

Linux in Minutes

This is somewhat interactive video towards establishing a VoIP application server. In this video we'll see the very basic Linux installation. This is CentOS which is most popular for deploying Asterisk Open Source VoIP Servers.I've used Oracle Virtual machine, another free software to create this virtual machine. CentOS 5.5 is also available free of cost. At the end of this tutorial our CentOS machine will be ready to communicate over LAN/WAN.

A brief summary of the commands or files I've used.
Command/File
Brief Description
ifconfig
Equivalent to Windows ipconfig to view network interfaces configured.
cat
Output contents of file in its argument to screen
echo
Print lines/text to screen
>>
Append output of left command to file specified at right
ip addr
Equivalent to viewing ifconfig briefly.
/etc/resolve.conf
File where IP addresses of DNS servers are mentioned (Imp. to resolve URLs)
logout
Logout from terminal session.


URL/References:
[1] Oracle VM :: http://download.virtualbox.org/virtualbox/3.2.12/VirtualBox-3.2.12-68302-Win.exe
[2] CentOS DVD ::
http://mirrors.ispros.com.bd/centos/5.5/isos/i386/

Centos Installation on VirtualBox from Gohar Ahmed on Vimeo.