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

Pro eFTePe

| Thursday, May 24, 2007

Lagi ada tugas buat FTP Server n anonymus FTP Serper..
kalo pake pureftp, setelah baca² ternyata ndak bisa support validuser, jadi kudu dipisah². Padahal ini butuhnya kan validuser bisa - anonymous pun jadi..
Setelah baca manual si proftp ternyata bisa, lha tapi koq ngga sukses² :(.
Setelah semedi, dan mandi air sumur tujuh rupa -enggadink- cuman wajah lecek doank..
Akhirnya oh akhirna.. ini nich setep²nya :

1. Download tarball di proftpd.org
2. Ekstrak tarball n masuk directory proftpd
3. ./configure => --h (sesuaikan dengan mood dan itikad dari hati yg paling dalam)
4. make && make install
5. Edit proftpd.conf

###########################################
#
# Server Configuration
#
###########################################

ServerName "AdminWannabe FTPServer"
ServerType standalone
DefaultServer on
Port 21
Umask 022
MaxInstances 100
User nobody
Group nobody
DefaultRoot ~
DefaultAddress 203.134.232.20


AllowOverwrite on


<-Anonymous /usr/local/webhosts/ftp>
User ftp
Group ftp
UserAlias anonymous ftp
MaxClients 10
DisplayLogin welcome.msg
DisplayFirstChdir .message
RequireValidShell off

# ini lho biang keroknya.. dr tadi searching² akhirna ketemu jg AnonRequirePassword off



AllowAll



# Limit WRITE everywhere in the anonymous chroot

DenyAll

<-/Anonymous>

PyurFTP :P

| Friday, May 11, 2007

Note : diasumsikan bhw mysql telah terinstall
# cd /lib/mysql/
# cp * /usr/lib
Download source pure ftpd - di ekstrak dan masuk ke directorynya
# fetch ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.21.tar.gz
# ./configure \
-–prefix=/usr/local/pureftpd \
-–with-mysql=/w3/mysql \
-–with-paranoidmsg \
-–with-shadow \
-–with-welcomemsg \
-–with-uploadscript \
-–with-quotas \
-–with-cookie \
-–with-pam \
-–with-virtualhosts \
-–with-virtualchroot \
-–with-diraliases \
-–with-sysquotas \
-–with-ratios \
-–with-ftpwho \
-–with-throttling \
-–with-largefile
# make && make install

Then we create an ftp group (”ftpgroup”) and user (”ftpuser”) that all our virtual users will be mapped to. Replace the group- and userid 2001 with a number that is free on your system:
groupadd -g 2001 ftpgroup
useradd -u 2001 -s /bin/false -d /bin/null -c “pureftpd user” -g ftpgroup ftpuser

Now we create a database called pureftpd and a MySQL user named pureftpd which the PureFTPd daemon will use later on to connect to the pureftpd database:
mysql -u root -p
CREATE DATABASE pureftpd;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO ‘pureftpd’@'localhost’ IDENTIFIED BY ‘ftpdpass’;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO ‘pureftpd’@'localhost.localdomain’ IDENTIFIED BY ‘ftpdpass’;
FLUSH PRIVILEGES;

Replace the string ftpdpass with whatever password you want to use for the MySQL user pureftpd. Still on the MySQL shell, we create the database table we need (yes, there is only one table!):
USE pureftpd;
CREATE TABLE ftpd (
User varchar(16) NOT NULL default '',
status enum('0','1') NOT NULL default '0',
Password varchar(64) NOT NULL default '',
Uid varchar(11) NOT NULL default '10',
Gid varchar(11) NOT NULL default '1010',
Dir varchar(128) NOT NULL default '/usr/local/webhosts',
ULBandwidth smallint(5) NOT NULL default '100',
DLBandwidth smallint(5) NOT NULL default '100',
comment tinytext NOT NULL,
ipaccess varchar(15) NOT NULL default '*',
QuotaSize smallint(5) NOT NULL default '0',
QuotaFiles int(11) NOT NULL default 0,
PRIMARY KEY (User),
UNIQUE KEY User (User)
) TYPE=MyISAM;
quit;

BTW, (I’m suggesting that the hostname of your ftp server system is server1.example.com) you can access phpMyAdmin over http://server1.example.com/phpmyadmin/ (you can also use the IP address instead of server1.example.com) in a browser and log in as pureftpd. Then you can have a look at the database. Later on you can use phpMyAdmin to administrate your PureFTPd server.
Configure PureFTPd
#ee /etc/pureftpd-mysql.conf
MYSQLServer localhost
#MYSQLPort 3306
MYSQLUser pureftpd
MYSQLPassword ftpadmin1
MYSQLDatabase pureftpd
#MYSQLCrypt md5, cleartext, crypt() or password() - md5 is VERY RECOMMENDABLE uppon cleartext
MYSQLCrypt md5
MYSQLGetPW SELECT Password FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetUID SELECT Uid FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetGID SELECT Gid FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MYSQLGetDir SELECT Dir FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE
"\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE
"\R")
MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")

# In the following directives, parts of the strings are replaced at
# run-time before performing queries :
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting.

Make sure that you replace the string ftpdpass with the real password for the MySQL user pureftpd in the line MYSQLPassword! Please note that we use md5 as MYSQLCrypt method, which means we will store the users’ passwords as an MD5 string in the database which is far more secure than using plain text passwords!

ChrootEveryone Yes
CreateHomeDir Yes
MySQLConfigFile /etc/pureftpd-mysql.conf

Now we create the user exampleuser with the status 1 (which means his ftp account is active), the password secret (which will be stored encrypted using MySQL’s MD5 function), the UID and GID 2001 (use the userid and groupid of the user/group you created at the end of step two!), the home directory /home/www.example.com, an upload and download bandwidth of 100 KB/sec. (kilobytes per second), and a quota of 50 MB:
INSERT INTO `ftpd` (`User`, `status`, `Password`, `Uid`, `Gid`, `Dir`, `ULBandwidth`, `DLBandwidth`, `comment`, `ipaccess`, `QuotaSize`, `QuotaFiles`) VALUES (’exampleuser’, ‘1′, MD5(’secret’), ‘2001′, ‘2001′, ‘/home/www.example.com’, ‘100′, ‘100′, ”, ‘*’, ‘50′, ‘0′);

Jalankan pureftp : /usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf

trickle moga2 okeee...

|

Iseng2 nyoba bwlimit & port priority, namanya trickle bisa running di linux, *BSD.
Bismillah.. let's give it a try.. cihuyyyy....

1. Download tarballnya trickle dulu dunk & ekstrak
# fetch http://monkey.org/~marius/trickle/trickle-1.06.tar.gz
2. Sebelum di install, libevent perlu diinstall dolo kalee...
# fetch http://monkey.org/~provos/libevent-1.3b.tar.gz

Nah setelah semua terinstall, 2 program akan terinstall yaitu trickle dan trickled.

Trickle bisa digunakan secara instan tanpa konfigurasi script, misalna sbb :
# trickle -d 50 wget ftp://mirror.switch.ch/i386/iso/F-6.92-i386-DVD.iso
artinya kita melimit 50Kbps u. download via ftp dr situs tsb.

Trickled bisa digunakan dengan konfigurasi dalam file /etc/trickled.conf
# trickled -c /etc/trickled.conf
/etc/trickled.conf
[ssh]
Priority = 1
Time-Smoothing = 0.1
Length-Smoothing = 1
[ftp]
Priority = 8
Time-Smoothing = 5
Length-Smoothing = 20
[www]
Priority = 2
Time-Smoothing = 0.1
Length-Smoothing = 2

Priorty terendah adalah prioritas utama.

Time smoothing is defined in seconds and is meant to define the time intervals trickled uses to let the application transceive data. The smaller the value, the smoother the session will feel. For example, suppose you limit the FTP transfer to 50Kbps, and have time smoothing set to 1 second. You should get a transfer rate of exactly 50Kbps. If you increase the traffic smoothing number to a higher value (15 seconds, for example), the transfer rate may change between 40 and 60Kbps. With different limitations you'll get different numbers.

Length smoothing defines the smoothing fallback time. That is, if trickled cannot meet the requested smoothing time, it will instead fall back to sending the number of KB of data specified here. If no value is specified, the default is 10Kbps.

You can also use trickled to set global traffic limits, so that you don't need to specify each time the maximum upload and download volumes. For instance, if you want to globally set the download limit to 80Kbps and the upload limit to 10Kbps, you can use a command like:

~# trickled -d 80 -u 10 -s

Note that even when trickled is running, you still need to use trickle binary to run SSH, FTP, HTML, and other commands in order to make traffic shaping work. But when trickled is running, you don't need to specify any parameters to the trickle command.

http://monkey.org/~marius/pages/?page=trickle
read the trickle technical paper

Info Hardware

| Wednesday, May 09, 2007

# cat /var/run/dmesg.boot (generic info on devices and drivers attached)
# pciconf -lv (for pci devices)
# usbdevs -v (for usb devices)
# atacontrol list
There are some more specific utilities. For example,> ports/sysutils/dmidecode is somewhat useful.

Type/platform:
# uname -m

Determining machine processor architecture:
# uname -p

Determining FreeBSD release level:
# uname -r

Generally, following command is use to get all info at a time:
# uname -mrs
FreeBSD 5.0-RELEASE i386

Determining CPU information such as speed, make etc
# dmesg grep CPU

CPU: Pentium 4 (1716.41-MHz 686-class CPU)
acpi_cpu0: on acpi0
acpi_cpu: CPU throttling enabled, 8 steps from 100% to 12.5%

Determining real and available memory to FreeBSD:
# dmesg grep memory
real memory = 201326592 (192 MB)
avail memory = 188555264 (179 MB)
OR

# sysctl -a grep hw.*mem
# sysctl -a grep mem

hw.physmem: 194985984
hw.usermem: 167641088
hw.cbb.start_memory: 2281701376

Note systcl has more info, just type to see rest of all info
# sysctl -a less

Determining how long a system has been up
# uptime

Determining when a system was last rebooted or shutdown
# last -1 reboot
# last -1 shutdown

Determining swap file system usage
# swapinfo -k

Determining who is logged in and what they are doing
Following all commands can be use. users command displays the list of all logged in users only.

# w
# who
# users

10) Find out when user was last logged in
You can use last command as follows:

# last user-name
(a) To find out user vivek was last logged at what time use last as follows
# last vivek

Update 20/May/2005 See FreeBSD getsysinfo.bash script. It is use to find general FreeBSD system information such as, hostname, OS version, Kernel version, Processor/CPU, Total RAM, System load, network interface, total logged in users, Hard disks, Runlevel etc.

PeHPMyAdhemin

| Tuesday, February 20, 2007

Step #1

phpMyAdmin – Download and Install

Home:
http://www.phpmyadmin.net

# Unzip and Untar
tar xvf phpMyAdmin-2.8.1.tar.gz -C /opt/apache/htdocs/
mv /opt/apache/htdocs/phpMyAdmin-2.8.1/ /opt/apache/htdocs/phpMyAdmin/


Step #2
Configure and Test phpMyAdmin
# Configure (by editing a few lines to match your setup):
cp /opt/apache/htdocs/phpMyAdmin/config.default.php
/opt/apache/htdocs/phpMyAdmin/config.inc.php

vi /opt/apache/htdocs/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'YourPassword'; // MySQL password

# Quick test in your web browser:
http://YourServerIP/phpMyAdmin/index.php

# Edit httpd.conf to allow "main.php" as a default web page for a directory listing, add main.php to the end of this line:
vi /opt/apache/conf/httpd.conf
DirectoryIndex index.html index.php

# Create an ".htaccess" file to permit only users you specify to access phpMyAdmin from the web
vi /opt/apache/htdocs/phpMyAdmin/.htaccess
AuthUserFile /etc/phpMyAdminhtpasswd.users
AuthName "phpMyAdmin Access"
AuthType Basic
require valid-user

# Add the first user to create the password file:
/opt/apache/bin/htpasswd -c /etc/phpMyAdminhtpasswd.users admin

# Add more users without creating a new file:
/opt/apache/bin/htpasswd /etc/phpMyAdminhtpasswd.users SomeUserNameHere

# Edit the Apache configuration file (Add to the very bottom of the file!)
vi /opt/apache/conf/httpd.conf
Alias /phpMyAdmin "/opt/apache/htdocs/phpMyAdmin"

AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all


# Update permissions
chown -R nobody:nobody /opt/apache/htdocs/

# Restart Apache
/opt/apache/bin/apachectl -k restart

# Quick test in your web browser (You should be prompted for a password:
http://YourServerIP/phpMyAdmin

Pe.. HaPe tak iyeh...

|

PHP v5.1.4 on FreeBSD 6.1

Pemanasan :
FreeBSD (Base + Autoconf, Automake, Bash and GCC)
OpenSSL
GD
LibXML
Apache
MySQL
----------------------------------------------------------------
FreeTDS - Connect to a Microsoft SQL Server via Perl from UNIX
Prerequisites:
FreeBSD (Base + Autoconf, Automake, Bash and GCC)
Perl Modules (DBI)

Overview:
Step #1 - Download, Unzip, Untar, Configure, Compile and Install FreeTDS
Step #2 - Download, Unzip, Untar, Configure, Compile and Install DBD::Sybase
Step #3 - unixODBC (Not required for FreeTDS, but logical to install it now)
-----------------------------------------------------------------

PHP - Portable Hypertext Preprocessor

Home:
http://www.php.net

# Download (Notes: Users behind a Proxy Server should read this and users without Internet but have a CDRom read this.)
cd /usr/src
fetch http://us2.php.net/distributions/php-5.1.4.tar.gz

# Unzip and Untar
tar xvf php-5.1.4.tar.gz

# Stop Apache
/opt/apache/bin/apachectl -k stop

# Configure
cd php-5.1.4
./configure --with-apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql --with-openssl=/usr/local/ssl --with-mssql=/usr/local --with-zlib-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --enable-exif --with-png-dir=/usr/local/lib --enable-calendar --enable-ftp --with-libxml-dir=/usr/local/lib --with-snmp=/opt/net-snmp/ --enable-fastcgi --enable-magic-quotes --enable-mbstring --enable-sockets --with-gd --enable-gd-native-ttf --enable-soap --enable-sigchild --enable-dbase --enable-filepro --with-mssql


./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --enable-ftp --with-libxml-dir=/usr/local --enable-fastcgi --enable-magic-quotes --enable-mbstring --enable-sockets --with-gd --enable-gd-native-ttf --enable-filepro --enable-module=so --with-freetype-dir=/usr/local/lib --with-snmp --enable-calendar --enable-exif

# make && make install


Step #2 - Configure and Test

php.ini and phpinfo.php

# Copy the "php.ini" file
cp php.ini-dist /usr/local/lib/php.ini

# Edit the Apache configuration file (Add to the very bottom of the file!)
vi /opt/apache/conf/httpd.conf
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

# Restart Apache:
/opt/apache/bin/apachectl -k restart

# Create a PHP Info file
vi /opt/apache/htdocs/phpinfo.php


# Test the phpinfo.php file with your web browser:
http://YourServerIP/phpinfo.php

# Edit the "php.ini" to suit your needs!
vi /usr/local/lib/php.ini
# You may want to add: /usr/local/lib/php to your php.ini include_path
include_path = ".:/usr/local/lib/php"

# Notes:
# PEAR system config file at: /usr/local/etc/pear.conf
# PDO headers: /usr/local/include/php/ext/pdo/


Open eSeSeL

|

OpenSSL v0.9.8b – Secure Sockets Layer

Home:
http://www.openssl.org

# Download (Notes: Users behind a Proxy Server should read this and users without Internet but have a CDRom read this.)
fetch http://www.openssl.org/source/openssl-0.9.8b.tar.gz

# Unzip and Untar
tar xvf openssl-0.9.8b.tar.gz
# Configure
cd openssl-0.9.8b
./config
# Compile - Install
make && make install

Apa Che?

|

Apache – Web server

# Looking for the older Apache v2.0.55?
fetch http://www.ip97.com/apache.org/httpd/httpd-2.2.2.tar.gz
# Unzip and Untar
tar xvf httpd-2.2.2.tar.gz
# Configure
cd httpd-2.2.2
./configure --prefix=/opt/apache --enable-modules=all --enable-mods-shared=all --enable-http --enable-ssl --enable-cgi --enable-cgid --enable-expires
--enable-headers --enable-mime-magic --enable-imagemap --enable-cern-meta --enable-usertrack --enable-unique-id --enable-speling --enable-rewrite --enable-so
--enable-info --enable-auth-dbm --enable-authn-anon --enable-authn-dbd --enable-authn-alias --enable-authz-owner --enable-auth-digest --enable-cache
--enable-mem-cache --enable-dav --enable-dav-fs --enable-dav-lock --enable-dbd --enable-dumpio --enable-ext-filter --enable-deflate --enable-log-forensic
--enable-logio --enable-ident --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-vhost-alias --enable-suexec

# Compile
make && make install


Create an “rc” script to start traplogd at boot time

# Create an “rc” script to start at boot time:
vi /usr/local/etc/rc.d/apache.sh

#!/bin/sh
CHROOT=/opt/apache
PIDFILE=/logs/httpd.pid
echo -n " apache"
case "$1" in
start)
/opt/apache/bin/apachectl -k start
;;
stop)
kill `cat ${CHROOT}/${PIDFILE}`
;;
*)
echo ""
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
exit 0
# Make the startup script executable:
chmod 755 /usr/local/etc/rc.d/apache.sh

Apache Notes for Admins

# Edit the "httpd.conf" to suit your needs, at least change the variables:
vi /opt/apache/conf/httpd.conf
User nobody
Group nobody
ServerAdmin you@example.com

# Set directory permissions:
chown -R nobody /opt/apache/htdocs/

# Commands to remember:
/opt/apache/bin/apachectl -k start
/opt/apache/bin/apachectl -k restart
/opt/apache/bin/apachectl -k stop

# The Apache configuration file:
vi /opt/apache/conf/httpd.conf

# Apache logs:
cd /opt/apache/logs
tail -f /opt/apache/logs/error_log
cat /opt/apache/logs/access_log

# See Also:
http://www.devshed.com/c/a/Apache/Building-Apache-the-Way-You-Want-It/


mod_perl

Home:
http://perl.apache.org/

# Change to the /tmp directory not your normal source dir!
cd /tmp
# Download
fetch http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz
# Unzip and Untar
tar xvf mod_perl-2.0-current.tar.gz
# Configure
cd mod_perl-2.0.2
perl Makefile.PL MP_APXS=/opt/apache/bin/apxs
# Edit the "httpd.conf" and add the new perl module to load, at the very bottom of the conf file
vi /opt/apache/conf/httpd.conf
LoadModule perl_module modules/mod_perl.so
# Compile
make && make test && make install

Instalasi LibXML u/ PHP

|

Step #1 - XML Library
Step #2 - PERL Modules

libxml – XML Library
fetch ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.24.tar.gz
# Unzip and Untar
tar xvf libxml2-2.6.24.tar.gz
# Configure
cd libxml2-2.6.24
./configure
# Compile and install
make && make install

XML Perl Modules

fetch XML-LibXML-Common-0.13.tar.gz
# Unzip and Untar
tar xvf XML-LibXML-Common-0.13.tar.gz
# Configure
cd XML-LibXML-Common-0.13
perl Makefile.PL
# Compile
make && make install

# XML-NamespaceSupport-1.08
http://search.cpan.org/CPAN/authors/id/R/RB/RBERJON/XML-NamespaceSupport-1.09.tar.gz
# Unzip and Untar
tar xvf XML-NamespaceSupport-1.09.tar.gz
# Configure
cd XML-NamespaceSupport-1.09
perl Makefile.PL
# Compile
make && make install

# XML-SAX-0.14
fetch http://search.cpan.org/CPAN/authors/id/M/MS/MSERGEANT/XML-SAX-0.14.tar.gz
# Unzip and Untar
tar xvf XML-SAX-0.14.tar.gz
# Configure
cd XML-SAX-0.14
perl Makefile.PL
# Compile
make && make install

# XML-LibXML-1.58
fetch http://search.cpan.org/CPAN/authors/id/P/PH/PHISH/XML-LibXML-1.58.tar.gz
# Unzip and Untar
tar xvf XML-LibXML-1.58.tar.gz
# Configure
cd XML-LibXML-1.58
perl Makefile.PL
# Compile
make && make install

GD u/ PHP

|

Overview:
Step #1 - Download, Unzip, Untar, Configure, Compile and Install zlib
Step #2 - Download, Unzip, Untar, Configure, Compile and Install libpng
Step #3 - Using the built-in to FreeBSD "Ports" System: Download and Install libjpeg
Step #4 - Download, Unzip, Untar, Configure, Compile and Install GD

zlib – Free open source compression library
fetch http://www.zlib.net/zlib-1.2.3.tar.gz
# Unzip and Untar
tar xvf zlib-1.2.3.tar.gz
# Configure
cd zlib-1.2.3
./configure
# Compile
make
# Install
make install

libpng – PNG reference library for creating graphics / images
cd /usr/src
fetch http://easynews.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.10.tar.gz
tar xvf libpng-1.2.10.tar.gz
cd libpng-1.2.10
./configure
make
make install

libjpeg – JPG reference library for creating graphics / images
# WARNING: Could not get jpeg library to install correctly via:
# cd /usr/src
# fetch http://www.ijg.org/files/jpegsrc.v6b.tar.gz
# tar xvf jpegsrc.v6b.tar.gz
# cd jpeg-6b/
# ./configure
# make
# make install
# ** GD could not correctly locate it during compile!

# Currently must use fall back method via FreeBSD Ports:
cd /usr/ports/graphics/jpeg
make install

cd /usr/src
fetch http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
tar xvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --disable-shared
make
make install

# Note: Installing software the looks for GD may require adding configure options when you install that software:
# --with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include/

Atau langsung saja install via port, hasilnya sbb :
freetype2-2.1.10_3 A free and portable TrueType font rendering engine
gd-2.0.33_4,1 A graphics library for fast creation of images
gettext-0.14.5_2 GNU gettext package
gmake-3.80_2 GNU version of 'make' utility
jpeg-6b_4 IJG's jpeg compression utilities
libiconv-1.9.2_2 A character set conversion library
libtool-1.5.22_2 Generic shared library support script
pkgconfig-0.20 A utility to retrieve information about installed libraries
png-1.2.8_3 Library for manipulating PNG images

Instalasi Mysql Server

|

MySQL install :

Download binary mysql-5.0.21.tar.gz
# tar xvf mysql-5.0.21.tar.gz
# cd mysql-5.0.21
# ./configure --prefix=/opt/mysql --with-mysqld-user=mysql
# make all && make install

# Install the base database
/opt/mysql/bin/mysql_install_db
# Add a “mysql” user to your system: (MySQL should not need to run as root!)
pw groupadd mysql
pw useradd mysql -g mysql


# Set permissions to correct owner
chown -R mysql:mysql /opt/mysql/

# Start the server
/opt/mysql/bin/mysqld_safe &

# Perform Basic Checks
/opt/mysql/bin/mysqladmin version
/opt/mysql/bin/mysqladmin variables

# Set a Password!
/opt/mysql/bin/mysqladmin -u root password wekQ

# Add a "database" user with password and grant that user permission to connect
/opt/mysql/bin/mysql --user=root --password mysql
wekQ

GRANT ALL PRIVILEGES ON *.* TO mysql@localhost IDENTIFIED BY 'wekQ' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO mysql@"%" IDENTIFIED BY 'wekQ' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

# Run some tests before going into production (optional)
/opt/mysql/mysql-test/mysql-test-run --force


Copy and test the "rc" boot time startup script
# Copy the "rc" startup script
cp /usr/src/mysql-5.0.21/support-files/mysql.server /usr/local/etc/rc.d/mysql.sh
chmod 755 /usr/local/etc/rc.d/mysql.sh

# Test the "rc" script
/usr/local/etc/rc.d/mysql.sh restart
/usr/local/etc/rc.d/mysql.sh stop
/usr/local/etc/rc.d/mysql.sh start
/usr/local/etc/rc.d/mysql.sh reload