ubuntu static ip configuration

Linux Basics - Set A Static IP On CentOS/ Ubuntu


This tutorial explains how to set a static IP on an Ubuntu system from the command line.
Static IP configuration on RHEL/centos(working config)
=========================================
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
HWADDR=00:0c:29:07:74:eb
TYPE=Ethernet

BOOTPROTO=none
IPADDR=192.168.213.10
NETMASK=255.255.255.0
GATEWAY=192.168.213.2
NM_CONTROLLED=no
DNS1=8.8.8.8
USERCTL=no
IPV6INIT=no

Step 1

You can copy and paste directly from this line.
sudo nano /etc/network/interfaces

If you have more than one network card, please be sure to make changes to the correct network interface.
Statically configured network cards will have a section like:

Here is an example:
auto lo eth0
iface lo inet loopback
iface eth0 inet static   #dynamic for dhcp
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4

#dns ns ip changed here will have corresponding change in /etc/resolv.conf 

cat /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
nameserver 8.8.4.4
 resolvconf -u

=>if not seen change on /etc/resolv.conf   edit that file and add
nameserver 8.8.8.8
nameserver 8.8.4.4
 save/exit

you can change with chattr +i /etc/resolv.conf
#service networking restart
or
#ifdown eth0
#ifup eth0

Configuring Wowza "live" media streaming server

#1. 

Go to wowza.com and create a liscence [Trial ver.] & copy the serial provided in email

#2.
Preparing machine ..eg. Centos 6.4 x64,ram=2G,HDD=70G (vmware10)

#3.
#  yum install  java-1.6.0-openjdk-devel.x86_64

#4. goto > http://www.wowza.com/pricing/installer
download rpm from gui  OR ..

#wget http://www.wowza.com/downloads/WowzaMediaServer-3-6-4/WowzaMediaServer-3.6      .4.rpm.bin

#chmod +x WowzaMediaServer-3.6.4.rpm.bin

#./ WowzaMediaServer-3.6.4.rpm.bin
#cd /usr/local/WowzaMediaServer
#./startup.sh

.....now setupstarts enter serial/liscence number when asked and complete
#  /etc/init.d/WowzaMediaServer status
# /etc/init.d/WowzaMediaServer start

<<<your Video contents are here >>>
 [root@server2 content]# pwd
/usr/local/WowzaMediaServer/content

#5.
allow ports 80,1935(tcp/udp)(macromedia),
#

#6    To Test media server goto http://www.wowza.com/gettingstarted
put your media servers ip i,e centos vm ip, click connect and see the content play.

#7     <<<< Configuration For Live Media Stream >>>

#step1.
mkdir /usr/local/WowzaMediaServer/applications/live

[root@server2 conf]# pwd
/usr/local/WowzaMediaServer/conf

[root@server2 conf]# mkdir live && cp Application.xml live/

now edit the newly copied Application.xml

#vim /usr/local/WowzaMediaServer/conf/live/Application.xml

 Steps for configuration:
Steps for configuration:

1.     Set the Streams/StreamType property to:
Code:
<StreamType>live</StreamType>

2.     Set the HTTPStreamers property to:
Code:
<HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>

3.     Set the Streams/LiveStreamPacketizers property to:
Code:
<LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer</LiveStreamPacketizers>

4.     Set the RTP/Authentication/PlayMethod property to:
Code:
<PlayMethod>none</PlayMethod>
  

For Securing Access

[root@server2 conf]# pwd
/usr/local/WowzaMediaServer/conf
[root@server2 conf]# cp publish.password live/
[root@server2 conf]# pwd
/usr/local/WowzaMediaServer/conf
[root@server2 conf]# cd live/
[root@server2 live]# ls
Application.xml  publish.password
[root@server2 live]# cat publish.password
#Publish password file (format [username][space][password])
#username     password   
   admin          admin1234
##to set web login passwod for viewing info of the viewers..edit the file admin.password like below..


[root@server2 conf]# cat /usr/local/WowzaMediaServer/conf/admin.password
# Admin password file (format [username][space][password])
#username password
admin    admin123

###Now start wowza media server

to test  download flash media encoder
Adobe media encoder

make sure to put proper parameters






Blocking Bit Torrent traffic

The following Iptables rules will block all Torrent traffic on your server:

Log all torrent blocked traffic:

iptables -N LOG > /dev/null 2> /dev/null
iptables -F LOG
iptables -A LOG -j LOG --log-prefix "LOG"
iptables -A LOG -j DROP

Torrent block rules:

iptables -A FORWARD -m string --algo bm --string "BitTorrent" -j LOG
iptables -A FORWARD -m string --algo bm --string "BitTorrent protocol" -j LOG
iptables -A FORWARD -m string --algo bm --string "peer_id=" -j LOG
iptables -A FORWARD -m string --algo bm --string ".torrent" -j LOG
iptables -A FORWARD -m string --algo bm --string "announce.php?passkey=" -j LOG
iptables -A FORWARD -m string --algo bm --string "torrent" -j LOG
iptables -A FORWARD -m string --algo bm --string "announce" -j LOG
iptables -A FORWARD -m string --algo bm --string "info_hash" -j LOG

Exim MTA part1

Install the EPEL (Extra Packages for Enterprise Linux) repository:

wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm 
 
rpm -i epel-release-6-5.noarch.rpm

Install the Exim package
yum install -y exim
 
Disable Postfix (the default MTA)
service postfix stop chkconfig postfix off

Set Exim as the default MTA
alternatives --config mta
And finally start Exim
chkconfig exim on service exim start

Contd..