Radio Serper

| Friday, June 08, 2007

Bagi kamu2 yang punya bakat presenter tapi belom kesampaian, ngga ada salahnya siaran di radio sendiri.. yuk2...buat stesyen radio sendiri..
Pertama siapkan dolo seperangkat *Nix box dengan soundcardnya
n then install icecast2 ama darkice..

ICECAST2

icecast membutuhkan pendukung sbb:
libxml2 - http://xmlsoft.org/downloads.html
libxslt - http://xmlsoft.org/XSLT/downloads.html
curl - http://curl.haxx.se/download.html (>= version 7.10 required)
NOTE: icecast may be compiled without curl, however this will disable all Directory server interaction (YP).
ogg/vorbis - http://www.vorbis.com/files (>= version 1.0 required)

Nah stl itu baru d/l souce icecast di www.icecast.org dan lakukan instalasi.
Jika setelah mencoba instalasi beberapa kali gagal terus dan sudah berputus asa dijalan Allah.. maka via port saja yha..

cd /usr/ports/audio/icecast2 && make install clean
proses instalasi akan berjalan dgn sendirinya, semetara anda harus bertobat dulu karena anda telah putus asa.. :P

Lakukan edit /usr/local/etc/icecast.xml dengan editor favorit ..



50
2
5
102400
30
15
10
1
65535



passku

passku2


admin
12345



123.134.237.237
123.134.237.237

8000
123.134.237.237

admin
runia
2
/tmp/dump-example1.ogg
65536
/test.ogg
1
1
1




/usr/local/share/icecast

/var/log/icecast
/usr/local/share/icecast/web
/usr/local/share/icecast/admin








access.log
error.log

4



0




OKeh2 sekarang jalankan icecast2nya
/usr/local/bin/icecast -c /usr/local/etc/icecast.xml &

DARKICE
cd /usr/ports/audio/darkice && make install clean
edit /usr/local/etc/darkice.cfg
# this section describes general aspects of the live streaming session
[general]
duration = 0 # duration of encoding, in seconds. 0 means forever
bufferSecs = 5 # size of internal slip buffer, in seconds
reconnect = yes
# this section describes the audio input that will be streamed
[input]
device = /dev/dsp # OSS DSP soundcard device for the audio input
sampleRate = 22050 # sample rate in Hz. try 11025, 22050 or 44100
bitsPerSample = 16 # bits per sample. try 16
channel = 1 # channels. 1 = mono, 2 = stereo

# this section describes a streaming connection to an IceCast server
# there may be up to 8 of these sections, named [icecast-0] ... [icecast-7]
# these can be mixed with [icecast2-x] and [shoutcast-x] sections
[icecast2-0]
format = mp3
bitrateMode = cbr # constant bit rate
bitrate = 16 # bitrate of the mp3 stream sent to the server
quality = 0.8 # encoding quality
server = 123.134.237.237
# host name of the server
port = 8000 # port of the IceCast server, usually 8000
password = passku # source password to the IceCast server
mountPoint = radio # mount point of this stream on the IceCast server
name = Radio - Trial
# name of the stream
description = This is only a trial
# description of the stream
url = http://123.134.237.237:8000
# URL related to the stream
genre = my own # genre of the stream
public = yes # advertise this stream?

/usr/local/bin/darkice -c /usr/local/etc/darkice.cfg &;

Sekarang akses http://123.134.237.237:8000 untuk melihat status servernya dan http://123.134.237.237:8000/admin/ untuk administrator.

Apa skr radiyo Qta sudah bisa on-er? tentu belum.. kalau sound cardnya belum diaktifken hihih...

# kldload snd_ich (jenis sonkarmu)
# ee /boot/default/loader.conf
snd_ich_load="YES" # Intel ICH
snd_driver_load="YES" # All sound drivers

Edit kernel dan compile
device sound
device snd_ich

Reboot... dan jalankan icecast & darkice

VipiEn ples Radiyus alias radi jayus hihihi...

| Thursday, June 07, 2007

Instalasi Mysql
Set password

shell> mysql --user=root mysql
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');
mysql> flush privileges;
mysql> quit;2.3-

Buat database
mysqladmin --user=root -p create radius

Buat user mengakses database radius
shell> mysql --user=root -p mysql
mysql> GRANT ALL ON ftp.* TO radius@localhost IDENTIFIED BY '';
mysql> flush privileges;
mysql> quit;


shell> gunzip /usr/share/doc/freeradius/examples/db_mysql.sql.gz
shell> mysql --user=radius -p radius < /usr/share/doc/freeradius/examples/db_mysql.sql

shell> gunzip /usr/share/doc/freeradius/examples/mysql.sql.gz
shell> mysql --user=radius -p radius < /usr/share/doc/freeradius/examples/mysql.sql



The data base is made up of 8 tables making it possible to define: rights of each user drooits of each groups

The table: nas
Cetta table contains same information as the /etc/freeradius/clients.conf file. It makes it possible to add NAS.
key value
nasname 127.0.0.1
shortname nas1
type other
ports
secret mySecret
community public
description NAS1 for the tests

The table: radacct This table contains all information of connection, disconnection, etc… It is a table which you accederer in reading primarily. No parameter to be carried out in this table.

The table: radcheck This table contains information to be checked at the time of the authentification. Primarily it will contain login/password.
key value
UserName yoann
Attribute User-Password
op ==
Value test

This table functions like the table radcheck, but with a concept of group. (It allows for example checked that the users of group PPTP have well the value “1” (PPP) for the Framed-Protocol key, value 2 would have been for SLIPWAY)
key value
GroupName PPTP
Attribute Framed-Protocol
op ==
Value 1

The table: radreply This table contains the parameters returned with the customers after an authentification succeeded. (It makes it possible for example to allot an address IP specific to a user.)
key value
UserName yoann
Attribute Framed-IP-Address
op :=
Value 192.168.40.101

The table: radgroupreply This table functions like the table radreply, but with a concept of group. (It makes it possible for example to allot the IP of a waiter DNS has all the users of group PPTP)
key value
GroupName PPTP
Attribute MS-Primary-DNS-Server
op :=
Value 192.168.40.1

The table: usergroup This table definite the membership of a user has a group. It is indeed possible to define duties applicable to a user group.
key value
UserName yoann
GroupName PPTP
priority 1

The table: radpostauth To define…

KONFIGURASI RADIUS
/etc/freeradius/sql.conf
sql {
# Database type
driver = "rlm_sql_mysql"

# Connect info
server = "localhost"
login = "radius"
password = ""

# Database table configuration
radius_db = "radius"

...

# Set to 'yes' to read radius clients from the database ('nas' table)
readclients = yesFramed-IP-Address
}

Note: The value readclients with yes, makes it possible to store the list of the NAS in the table nas of the data base radius, in addition to the NAS present in the /etc/freeradius/clients.conf file. The addition of a new entry in the table nas is not dynamic, enframed-IP-Address effect the list of the NAS is built with the launching of freeradius starting from the /etc/freeradius/clients.conf file and the table sql nas.

To take into account the changes, it to reload the files of configuration:
shell> /etc/init.d/freeradius
the /etc/freeradius/radiusd.conf file
modules {
chap {
authtype = CHAP
}

mschap {
authtype = MS-CHAP
use_mppe = yes
require_encryption = yes
require_strong = yes
}

$INCLUDE ${confdir}/sql.conf #1249
}

authorize { #1774
chap
mschap
suffix
sql
}

authenticate { #1887
Auth-Type CHAP {
chap
}

Auth-Type MS-CHAP {
mschap
}
}

accounting {
sql
}

session {
sql
}

Test of the installation of freeradius
We will add a local NAS to test the configuration. For that it is necessary to publish the /etc/freeradius/clients.conf file
client 127.0.0.1 {
secret = mySecret
shortname = localhost
nastype = other
}

It is necessary for us to create an entry for the NAS whose IP is 127.0.0.1, and to specify a key secrecy which will be used for encoding of information between the NAS and the Waiter Radius. Note: We could here, to add an entry in the table nas base sql, but we will approach this solution further.
To launch freeradius in mode comforts: debug mode

To have a maximum of information for debuger our installation, and to include/understand what it occurs, we will stop the service freeradius and the throw in mode comforts with the options which are well:

shell> /etc/init.d/freeradius stop
shell> freeradius -XXX

To add an account of test in our table radcheck

shell> mysql --user=radius -p radius
mysql> INSERT INTO radcheck(UserName,Attribute,op,Value) VALUES ('yoann','User-Password','==','test');
mysql> quit;

We added here the user “yoann” with the password “test”
Test of the authentification We go use the tool radtest whose syntax is as follows:
radtest
Note: to use the port by default radius you can use 0.

shell> radtest yoann test 127.0.0.1 0 mySecret
Sending Access-Request of id 186 to 127.0.0.1 port 1812
User-Name = "yoann"
User-Password = "test"
NAS-IP-Address = 255.255.255.255
NAS-Port = 0
rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=186, length=20

If the authentification is correct, you will receive the Access-Accept message. You can now stop freeradius in mode comforts (Ctrl+C) and start again it in time that service. shell> /etc/init.d/freeradius start

Installation/Configuration of pptpd
You must, above all, you ensure that your kernel supports the MMPE Encryption which will allow us crypter the data in MPPE-128, in addition to authentification MS-CHAP-V2

/etc/pptpd.conf
option /etc/ppp/pptpd-options
logwtmp
localip 10.1.100.254
remoteip 10.1.100.1-200
Note: The line remoteip optional, because it is perhaps replaced by the value of attribute Framed-IP-Address contained in our table radreply

/etc/ppp/pptpd-options
Name of the local system for authentication purposes
# (must match the second field in /etc/ppp/chap-secrets entries)
name pptpd

# Authentification Encryption
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2

# Data Encryption
require-mppe-128

# Disable BSD Compression
nobsdcomp

# Network and Routing
ms-dns 10.1.100.254
proxyarp
nodefaultroute

# Create a UUCP-style lock file for the pseudo-tty to ensure exclusive access.
lock

# Enable connection debugging facilities.
debug

# Print out all the option values which have been set.
# (often requested by mailing list to verify options)
dump

# Miscellaneous
ipcp-accept-local
ipcp-accept-remote

lcp-echo-failure 3
lcp-echo-interval 5

# Plugins
plugin radius.so

Menyiasati partisi penuh dgn Linking

| Monday, June 04, 2007

First of all, you must have available empty space contiguous with
the partition you wish to expand. If you do not have that, then
you will have to start from scratch, or add another disk drive.

You can use sysinstall to recreate partitions and modify slices as
long as there is space available and as long as the drive or slice
is not mounted and in use. (drive is you are modifying slices and
slice if you are modifyine partitions)

If you do not use sysinstall then fdisk is used to change slices. You
may need to do it from a fixit disk because it is likely you will be
modifying the FreeBSD slice that the system normally uses to boot.

If you want to change a partition within a slice (namely the FreeBSD
slice) you need to use bsdlabel(8). That creates and writes the slice's
label and defines partitions. After using bsdlabel, you must use
newfs(8) to create the file system on the newly created/modified partition.

But, still, to add space to a partition, there must be free space -
eg space that is not in a partition already - right next to the
partition you want to expand.

Alternatively, you do not specifically have to increase the /var partition.
you can move some of its contents to another partition where there is
sufficient free space (if such exists) and then create symbolic links
to the new location[s]. Common candidated for such moving and linking
are /var/spool, /var/log, /var/db and/or /var/mail.

My habit is to have a large partition that contains home directories
and other overflows. Typical mount point is /home.
Then, I usually put /var/spool and /var/log there as directories
named /home/var.spool and /home/var.log and link them back to
the original names in /var. eg, after copying those directories
over to /home/var.spool and /home/var.log respectively, I then
rm the original /var/spool and /var/log and then create links.
Actually, first I rename them, then do the link and check things
before actually rm-ing the originals. Something like this:

All must be done as root (and probably best in single user, but not required).
cd /var
use tar | tar or cp -Rp to make a new copy in /home
cp -Rp spool /home/var.spool
mv spool oldspool
ln -s /home/var.spool spool
cp -Rp log /home/var.log
mv log oldlog
ln -s /home/var.log log
Check it all out to make sure it is just fine
cd /var
rm -rf oldspool
rm -rf oldlog

I like to use the naming convention of var.spool and var.log for the
copies because it reminds me of where there come from.

I a similar thing with /var/db in /var
and with /uar/local, /usr/ports, and /usr/src in /usr

Then those things which grow, sometimes unexpectedly can have room
without me constantly monitoring them. It also makes backups more
straightforward. Everything that is frequently changing is in /home.

Of course, if you do not have a large directory with plenty of
space available, then you may be looking to add some disk space.

Tipz

| Saturday, June 02, 2007

FSCK Otomatis
If your server/box gets stuck at fsck after a reboot or a crash, then just add the following lines to /etc/rc.conf:

fsck_y_enable=”YES”

It will run fsck automatically and will avoid your box getting stuck after reboot waiting for somebody to manually run fsck.

IPFW tanpa compile kernel
IF you don’t want to recompile kernel, just because you want to enable ipfw, you can use the following command to do so:

kldload ipfw && ipfw add 65534 allow all from any to any

Never issue the above command without ipfw add 65534 allow all from any to any else you might end up with a locked box.

twiking

|

sysctl.conf for your high traffic server - under high load :

security.bsd.see_other_uids=0
net.inet.tcp.recvspace=65535
net.inet.tcp.sendspace=65535
#kern.ps_showallprocs=0
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
net.inet.tcp.inflight.enable=1
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
net.inet.ip.rtexpire=2
net.inet.ip.rtminexpire=2
kern.ipc.somaxconn=1024
net.inet.ip.check_interface=1

kern.maxfiles=32768
kern.maxfilesperproc=2000

kern.ipc.maxsockets=163840
kern.ipc.maxsockbuf=2097152

net.inet.ip.fw.dyn_syn_lifetime=1
net.inet.ip.fw.dyn_max=65535
net.inet.ip.fw.dyn_buckets=256
net.inet.ip.fw.dyn_udp_lifetime=5

net.inet.tcp.msl=7500