Sabtu, 02 Februari 2008

setting ip pada server freebsd

Hari ini coba-coba mau posting tentang Freebsd, berhubung baru mulai maka saya akan coba terangkan bagaimana setting IP di FreeBSD:

setelah selesai install masuk pake user root

login:root
passwd:

#

tanda kress diatas menunjukkan kalo anda telah masuk sebagai user root
selanjutnya melihat interface yang telah terpasang.

# ifconfig
fxp0: flags=8843 mtu 1500
inet6 fe80::204:acff:fe5b:4ad4%fxp0 prefixlen 64 scopeid 0x1
ether 00:04:ac:5b:4a:d4
media: Ethernet autoselect (100baseTX )
status: active
rl0: flags=8843 mtu 1500
inet6 fe80::250:fcff:fe62:bb38%rl0 prefixlen 64 scopeid 0x2
ether 00:50:fc:62:bb:38
media: Ethernet autoselect (10baseT/UTP)
status: active
lo0: flags=8049 mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000

ada 2 ethernet (tergantung berapa ethernet yang anda pasang) fxp0 & rl0 sedangkan lo0 itu adalah loopbacknya. Sedikit berbeda dengan dilinux yaitu eth0 & eth1 bila di FreeBSD bisa berubah-ubah tergantung janis interfacenya.

fxp0 = card intel
rl0 = card realtek

cukup sekian pengenalannya sekarang saya jelaskan bagaimana melakukan setting IP.

# vi /etc/defaults/rc.conf

cari baris ifconfig_lo0
kamudian tambahkan baris berikut diatas baris ifconfig_lo0

ifconfig_fxp0="inet 203.89.xx.xx netmask 255.255.255.xxx"
ifconfig_rl0="inet 192.168.1.1 netmask 255.255.255.0"

sekali lagi untuk card interfacenya sesuaikan sendiri dengan card anda
selanjutnya cari baris gateway dan masukkan IP gateway anda

defaultrouter="NO" ----> defaultnya "NO" silahkan hapus dan ganti

setelah selesai simpan dengan perintah :wq!
reboot mesin FreeBSD anda dan cek kembali apakah setting sukses atau belum dengan perintah "ifconfig"

Administrasi Dasar FreeBSD


Minggu, 25 Desember 05 - oleh : ropix

Setelah selesai proses instalasi, tahap berikutnya adalah bagaimana kita
memanajemen FreeBSD tersebut. Karena sebelum menginstal kita tentunya
sudah memiliki tujuan menginstall-nya. Sebelum melakukan tujuan utama,
berikut dasar administrasi sistem FreeBSD :

SYSTEM
KOMPILASI KERNEL
Cara Baru
#cd /usr/src
#make buildkernel KERNCONF=KERNELMU && make installkernel KERNCONF=KERNELMU
#reboot
Anda bisa langsung mendefinisikan kernel anda pada
/etc/make.conf..tambahkan :
KERNCONF=KERNELMUDISINI

CATATAN : NOTE*** If you are running your system with a secure_level set,
then the install operations will be forbidden. You have to set
'kern_securelevel="-1"' in /etc/rc.conf and reboot. Once the install is
complete, you can reset it to the original level.

Cara Lama
#pwd
#/usr/local/src/sys/i386/conf/
#make config KERNELMU
#cd ../../compile/KERNELMU
#make clean <----catatan 1
#make depend
#make
#make install
#reboot

Catatan 1 = Lakukan "make clean" pada setiap kernel yang tergantung pada
Makefile. There are times when the build should be cleaned up and you can
either do a "make clean" or use the "config -r" to clean the obj space up.
Doing it every time may make your kernel build run twice as long or more
and wasn't really necessary.

Cara Membuat File LINT pada FreeBSD 5.x
#cd /usr/src/sys/i386/conf
#make LINT

INSTALL CVSUP
cd /usr/ports/net/cvsup
make && make install

UPDATE DB
/usr/local/bin/cvsup -g -L 2 ports-supfile
portsdb -Uu

INSTALASI PAKET FREEBSD
Ada 4 cara :

1. Tarball/Source (file .tar.gz)
2. pkg_add (file .tgz)
3. /stand/sysinstall
4. ports collection (/usr/ports). Dengan perintah umum "make && make
install && make clean"

Terlalu banyak ports collections akan membingunkan kita. Berikut tips
mencari paket untuk memirror suatu website:

* Mencari tool untuk memirror website (contoh) #cd /usr/ports && make
search key=mirror

hasil =
Port: w3mir-1.0.10
Info: All-purpose HTTP copying and mirroring tool
Maint: ache@freebsd.org
Index: www perl5
B-deps: p5-Digest-MD5-2.14 p5-HTML-Parser-3.25 p5-HTML-Tagset-3.03
p5-MD5-2.02 p
5-MIME-Base64-2.12 p5-Net-1.0703 p5-URI-1.15 p5-libwww-5.53 R-deps:

Port: webcopy-0.98b7
Path: /usr/ports/www/webcopy
Info: A Web Mirroring Program
Maint: ports@FreeBSD.org
Index: www
B-deps:
R-deps:


Contoh 2:
2. saya akan mencari tools kalkulator netmasking
#cd /usr/ports/ && make search key=calculator
Port: cidr-2.3
Path: /usr/ports/net/cidr
Info: RFC 1878 subnet calculator / helper
Maint: midom@dammit.lt
Index: net
B-deps:
R-deps:

Port: ipcalc-0.34
Path: /usr/ports/net/ipcalc
Info: IP Calculator
Maint: petef@databits.net
Index: net
B-deps:
R-deps:

Port: ipsc-0.4.2
Path: /usr/ports/sysutils/ipsc
Info: An IP Subnet Calculator
Maint: jeremy@external.org
Index: sysutils gnome
B-deps: prips-0.9.4
R-deps:

Memberi Warna Terminal
1. Cari warna di ports
bash$>cd /usr/ports/misc/colorls
bash$>make install

2. Hampir selesai. Untuk Versi 4.x keatas pada direktori /home rubah alias
untuk ls
#alias ls ls -G -f

Cara Kedua
- install /usr/ports/misc/gnuls
- letakan alias ls="gnuls --color=always" in ~/.profile or ~/.cshrc
- Rubah seting warna dengan man dircolors dan dircolors.....hehehehe..baca
ndiri

Kembali Ke Kernel Lama
1. Restart komputer
[home]chris# shutdown -r now

2. Pada Hitungan Mundur..(9 sampai 0) hentikan dengan menekan sembarang
tombol,kecuali tombol enter.
( Tekan tombol spasi)

3. setelah itu.. unload kernel
ok?unload

4. setelah itu load kernel yang akan di pakai, ( misal kernel.old)
ok load kernel.old

5. setelah itu boot komputer kita
ok boot

6. Kernel yang jalan adalah kernel yang lama.


DESKTOP
Untuk layanan Aplikasi Desktop yang lengkap, gunakan ports otomatis akan
menginstal software berguna:
teot#cd /usr/ports/misc/instant-workstation
teot#make

KDE secara otomatis pada saat boot, :
echo 'ttyv9 "/usr/local/bin/kdm" xterm on secure' >> /etc/ttys,
Atau gunakan KDE dengan startx:
echo exec startkde > ~/.xinitrc
Penamaan Interface di FreeBSD
device dc # DEC/Intel 21143 and various workalikes
device fxp # Intel EtherExpress PRO/100B (82557,
82558)
device my # Myson Fast Ethernet (MTD80X, MTD89X)
device pcn # AMD Am79C97x PCI 10/100 NICs
device rl # RealTek 8129/8139
device sf # Adaptec AIC-6915 (``Starfire'')
device sis # Silicon Integrated Systems SiS
900/SiS 7016
device ste # Sundance ST201 (D-Link DFE-550TX)
device tl # Texas Instruments ThunderLAN
device tx # SMC EtherPower II (83c17x ``EPIC'')
device vr # VIA Rhine, Rhine II
device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'',
``Cyclone'')

Membuat IP Aliases di FreeBSD
ifconfig ed1 alias 192.168.0.200 netmask 255.255.255.255 up
ifconfig ed1 alias 192.168.0.201 netmask 255.255.255.255 up

QUOTA FILESYSTEM
Quota filesystem berguna untuk melindungi server dari serangan DOS(Denial
of Service Attack) yang salah satunya yaitu dengan berusaha memenuhi space
dari hardisk di server, untuk menghindari hal ini perlu diperhatikan
pembuatan partisi pada saat instalasi pertama, Contoh pembagian partisi
yang baik untuk HD 3.2 GB:

* /boot 5MB Partisi untuk kernel image.
* /usr 512MB Partisi untuk menyimpan file binary-binary dari system.
* /home 1146MB Partisi untuk user, besar partisi disesuaikan dengan
jumlah user. 1 user = 10 MB, 114 user = 1140 MB)
* /chroot 256MB Partisi untuk installasi program di chroot environment
contohnya: DNS. Chroot environment berguna agar apabila intruders
dapat memasuki system melalui service tertentu misalnya DNS, maka
intruders tidak dapat berbuat banyak bagi system keseluruhan karena
intruders hanya mendapat shell (baca: command prompt) di chroot
environment dan bukan di system sebenarnya.
* /cache 256MB Cache untuk proxy server(squid).
* /var 256MB Mengandung file-file log dari system dan service-service.
128MB Swap memory.
* /tmp 256MB Temporary file dari system.
* / 256MB root dari filesystem.


Dengan quota kita membatasi tiap user hanya dapat memakai quota sebesar 10
MB di partisi /home. quota , berguna untuk menampilan space yang digunakan
oleh user dan limit space yang boleh digunakan oleh user di partisi
hardisk di server dimana partisi tersebut telah didefinisikan mempunyai
quota (lihat quotaon di keterangan dibawah).
Contoh :
# quota
Disk quotas for user lfs (uid 2040):
Filesystem blocks quota limit grace files quota limit grace
/dev/hda5 4060 0 50000 563 0 12000

edquota , edit quota yang dipunyai user. Perintah ini harus dijalankan
oleh user yang mempunyai root access, file quota yang diedit:
aquota.user dan aquota.group untuk versi 2
quota.user dan quota.group untuk versi 1
untuk meng-set quota dengan edquota memerlukan akses root.

Contoh :
# man su
# su - root
# edquota -u lfs
Disk quotas for user lfs (uid 2040):
Filesystem blocks soft hard inodes soft hard
/dev/hda5 4056 0 50000 562 0 12000
/dev/hdb1 0 0 0 0 0 0
/dev/hdb2 0 0 0 0 0 0

repquota , menampilkan quota yang dipunyai seluruh user yang ada di suatu
server, dan penggunaan space yang ada baik di suatu partisi ataupun di
seluruh partisi yang didefinisikan di /etc/mtab yang mempunyai quota.
Contoh :
# repquota /dev/hdb1
*** Report for user quotas on device /dev/hdb1
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
------
root -- 1013952 0 0 830 0 0
nobody -- 4 0 0 1 0 0

quotaon dan quotaoff, berguna untuk sistim quota bekerja dan berhenti di
suatu filesystem, yang telah didefinisikan pada /etc/fstab dengan mount
options usrquota dan grpquota.
Contoh :
# man grep
# grep home /etc/fstab
LABEL=/home /home ext3 exec,dev,rw,usrquota,grpquota 1 2
# quotaon

quotacheck , berguna untuk mengecek keadaan dari quota dari filesystem dan
menampilkan hasilnya, memperbaiki file quota yang rusak, membuat file
quota pertama kali(quota.user, quota.group -> versi 1 dan aquota.user
aquota.group -> versi 2)
Contoh :
# quotacheck -u -g -c -a ---> untuk create quota file dan membuat quota
secara default di filesystem yang telah didefinisikan mempunyai quota di
/etc/mtab.

Untuk server FreeBSD diperlukan untuk create file quota.user dan
quota.group terlebih dahulu :

# cd /home ; touch quota.user quota.group change dir ke /home, partisi
yang mau kita set quota dan membuat file quota di dir /home

# chmod 400 quota.user quota.group change permissions file(lihat
keterangan chmod)

# quotacheck -u -g /home check quota berdasar user dan group yang ada di
/etc/passwd dan /etc/group

MENJALANKAN DAEMON
Pada Server FreeBSD script untuk menjalankan daemon ada pada directory :

# cd /usr/local/etc/rc.d
# ls -la

total 34
drwxr-xr-x 2 root wheel 512 Apr 28 14:21 .
drwxr-xr-x 14 root wheel 1536 Apr 28 13:39 ..
-r-xr-xr-- 1 root pgsql 769 Apr 28 13:29 010pgsql.sh
-rwxr-x--x 1 root wheel 437 Apr 26 10:17 apache.sh....dan lain lain.

Di directory ini akan diload setiap kalo server FreeBSD reboot, untuk
menjalankan secara manual :
# /usr/local/etc/rc.d/proftpd.sh start

Server FreeBSD menggunakan /etc/rc.conf untuk pengaturan daemon-daemon
yang diexecute pada waktu server boot.
Log dari daemon biasanya terletak di /var/log, di directory /var/log/ kita
dapat menemukan banyak informasi tentang system, termasuk : dmesg, xferlog
(untuk ftp), maillog (untuk mail server), httpd/access.log (untuk web
server), message.
ADMINISTRASI USER
adduser , berguna untuk create user baru, dan update informasi bagi user
baru.
Contoh :
# adduser newuser
Untuk create user baru dengan setting default, yaitu home dir di /home,
dan group sama dengan nama user yang akan di add dan mempunyai bash shell.
# adduser newuser -g students
Untuk create user dengan group students.

userdel , berguna untuk user account dan file yang bersangkutan dengan
user tersebut.
Contoh :
# userdel newuser
Menghapus account di /etc/passwd dan /etc/shadow
# userdel -r newuser
Menghapus account di /etc/passwd dan /etc/shadow beserta semua file di
/home/newuser

usermod, berguna mengubah properties dari user yang sudah ada, berfungsi
hanya di RedHat Linux.
Contoh :
# usermod -g wheel ichtus
Untuk mengubah initial group dari user ichtus ke group wheel.
# usermod -d /usr/home ichtus
Untuk mengubah home dir dari user ichtus ke home dir yang baru.

passwd, berguna untuk mengupdate informasi password dari user.
Contoh :
# passwd newuser
Untuk mengubah password current user.
Changing password for newuser
(current) UNIX password:
New password:
Retype new password:
passwd: all authentication tokens updated successfully
# su -
# passwd -l newuser
Lock password dari user dengan menambah char ! di /etc/shadow.
# passwd -r newuser
Kebalikan dari parameter -l, unlock password dari user.

groupadd , berguna untuk mebuat group baru. Group akan sangat berguna
dalam administrasi user berserta dengan permission yang diperbolehkan oleh
user tertentu, sehingga dengan group kita dapat mengelompokkan user untuk
permission tertentu dan quota pula.
Contoh :
# groupadd students

groupdel , berfungsi untuk menghapus group.
Contoh :
# groupdel ichtus Untuk menghapus group ichtus.

ADMINISTRASI XINETD PADA REDHAT LINUX,
inetd adalah menangani beberapa server secara bersama misalnya: wu-ftpd,
imap, pop3 telnet, dll. xinetd adalah hanya satu proses daemon, pada saat
ada request untuk service tertentu, xinetd akan menyediakan service
tersebut yang ditanganinya oleh karena itu xinetd dan inetd disebut juga
super-server.
# ls /etc/inetd.d
chargen daytime-udp echo-udp.rpmnew imap klogin pop3s rexec talk
chargen-udp daytime-udp.rpmnew eklogin imaps krb5-telnet pop3se rlogin
telnet chargen-udp.rpmnew echo finger ipop2 kshell pop3st rsh time daytime
echo-udp gssftp ipop3 ntalk proftpd rsync time-udp

Untuk mengubah setting service apa saja yang ditangani oleh xinetd,
# vi /etc/inetd.d/ntalk

### File ntalk ### #
description: The ntalk server accepts ntalk connections, for chatting \
# with users on different systems.
service ntalk
{
disable = yes
socket_type = dgram
wait = yes
user = nobody
group = tty
server = /usr/sbin/in.ntalkd }
### End of File ###

kemudian ubah entry disable menjadi disable = no, service xinetd harus
di-restart setelah perubahan setting :
# kill -s HUP inetd_pid Untuk FreeBSD ( setting inetd ada di /etc/inetd.conf)

CARA MENCARI HELP

man, berguna untuk mencari informasi akan kegunaan suatu command berserta
dengan cara penggunaanya. Contoh :
# man top

apropos , berguna untuk mencari keyword dari whatis database, seringkali
digunakan apabila kita hanya tahu keyword dari kegunaan suatu command
tetapi lupa akan nama command tersebut.
Contoh :
# apropos user mencari command-command yang mempunyai keyword user untuk
penjelasannya.

info, berguna untuk membaca info dokumen
Contoh :
# info date
/usr/share/doc/name_of_service/, di directory ini terdapat dokumentasi
dari developer dari pembuat software dari service.
http://www.tldp.org, TheLinux Dokomentasi Project


ARCHIVING FILES
tar, berguna untuk archiving tar yang sangat banyak sekali digunakan di
kalangan Linux, tujuan pertama dibuatnya tar adalah supaya file dengan
jumlah yang banyak dapat digabungkan menjadi satu untuk memudahkan backup
file. Contoh :
# tar xfv kernel-2.4.18.tar
Extract kernel-2.4.18.tar ke current directory.
# tar xfvz kernel-2.4.18.tar.gz
Extract kernel-2.4.18.tar.gz ke current directory dengan tanpa sebelumnya
extraxt dengan gunzip(lihat keterangan gunzip).
# tar cfv filename_archive.tar directory_atau_filename
Untuk membuat tar archive dari directory atau filename menjadi
filename_archive.tar

gzip, gunzip , berguna untuk compress dan uncompress file.
Contoh :
# gzip kernel-2.4.18.tar
Compress file kernel-2.4.18.tar menjadi kernel-2.4.18.tar.gz
# gunzip kernel-2.4.18.tar.gz
Uncompress file kernel-2.4.18.tar.gz menjadi kernel-2.4.18.tar

bzip2, berguna compressing dan decompressing file dengan menggunakan
alogoritma Burrows-Wheeler block sorting text compression algorithm.
Contoh :
# bzip2 -z nama_file Compressing file.
# bzip2 -d kernel-2.4.18.bzip2
Decompressing file kernel-2.4.18.bzip2

zip, unzip , Compressing utility untuk berbagai OS seperti UNIX, BSD,
Linux, VMS, OS/2, Atari, Macintosh, Amiga, dan Acorn RISC OS
Contoh :
# zip filename_archive.zip filename Compress filename.
# unzip filename_archive.zip Uncompress filename_archive.zip

ref:email dari mas chris

Senin, 28 Januari 2008

Building a FreeBSD Build System

by Bjorn Nelson
04/13/2006

Updating software--many fear this task. It risks interruption of service. It introduces a big, gray unknown. Even with a test system and usage reports, it may bring doom to your applications. With great confidence and trust in his abilities, the system administrator must tread down this uncertain path. Sometimes this requires persuading, as many people don't see the need. Trying to quantify the risk of a compromise is not easy, especially for those who have never experienced an attack. The process of rebuilding software can sometimes be lengthy, and merging configuration files can be tedious. It's a thankless task, and not many users will recognize the effort.

Fortunately, FreeBSD has a pretty good track record of not breaking during updates--or maybe I underestimate my sysadmin skills. Unfortunately, keeping FreeBSD current is a very time-consuming job. I started seeing how daunting this is while watching our 20-plus FreeBSD servers age and fall into legacy mode. I noticed that Red Hat took very little time to stay up-to-date, and I thought there had to be a way to do something similar on FreeBSD.

I set out on a search for what was available. I tried binary updating from bsdupdates.com, which was pretty easy to set up and was great for security updates, but it didn't really help with updating configuration files--and upgrades cost money. I then attempted radmind, but quite honestly, waiting for it to traverse my machine and build an image didn't give me the sense of time savings I wanted.

Eventually I put it on hold for year until I could find an official document or article describing best practices and procedures for updating a bunch of servers. Then, while glancing at the FreeBSD Handbook, I found what I had been looking for: tracking for multiple machines. I read about it and rejoiced. With great guidance and direction, I proceeded to build the ultimate updater: the FreeBSD build system.

The section in the handbook is a great start, but it will leave you with a system that is far from ultimate status. Never fear; when you finish this article, you will have an unbeatable update system. Even mergemaster will work faster. You will have an update system in which a machine update/upgrade will take less than 10 minutes.

To set up a FreeBSD build system, you need three components. A build server is the first requirement. It should be either a fairly beefy uniprocessor or a lesser SMP-based machine. The second component is a staging server, which is basically a test machine where you can test the build without potentially destroying a production box. This doesn't have to be a machine with much fanfare, but it should be as close as possible to the rest of your machines to ensure an accurate test platform. The third component, called the build set, consists of all the clients to which you want to install the updates. These are your production machines.
Build Server

Most of the scripts I've included here have optimizations for parallel processing, so it would be wise to use a build server that supports SMP of some form. The hardware I used is a quad PIII 700MHz with 4GB of RAM (although it would probably run fine on 512MB, 1.7GB inactive and 1.6GB free on normal load). My buildworld/buildkernel commands take not much more than 45 minutes each.
Configure make

One nice aspect to running a source-based operating system is the ability to configure all compiles to follow the same behavior. The BSD make uses a centralized /etc/make.conf file that needs to match on all the machines that will use the build server. For my build server I set:

NO_PROFILE=true
USA_RESIDENT=true

This is a fairly small, centralized make configuration. Most people disable parts of the core system such as X and games. For the most part I do too, but sometimes you will run across a requirement that needs things like X. I haven't run into any harm building more than what the build server requires, and restricting the build set by enabling variables such as NO_X or NO_GAMES on the clients. As always, test on the staging server before installing on the build set.
Synchronize the source

Next, you need a way to synchronize usr/src with the latest code from an official FreeBSD repository on a regular schedule. Many methods of doing this are documented in the handbook. I used cvsup. Set it up by installing it from ports:

% cd /usr/ports/net/cvsup && make install

Then add a command to your /etc/crontab, which will start this process every morning:

# cvsup local sources and ports
0 7 * * * root /usr/local/bin/cvsup -g -L 2 /etc/cvsupfile \
>> /var/log/cvsup-client.out

Obviously, the schedule you use is your decision. You may want to slow the interval from daily to weekly or monthly to allow yourself more time for testing and to ensure that you can update all your machines using the same update baseline.

The next step is to build your /etc/cvsupfile. I set my host to localhost because I use a local cvsup-mirror:

*default host=localhost
*default prefix=/usr
*default base=/usr/local/etc/cvsup
*default release=cvstag=RELENG_6_0
*default delete use-rel-suffix

src-all
*default tag=.
ports-all
doc-all

I track the RELENG_6_0 tag, which gives me security updates and bug fixes for 6.0. Then, when a later version comes out, I will switch on my own schedule and start updating all our servers.

Add to your /etc/make.conf:

SUP_UPDATE=true
SUP=/usr/local/bin/cvsup
SUPFLAGS=-g -L 2
SUPFILE=/etc/cvsupfile
PORTSSUPFILE=/etc/cvsupfile
DOCSUPFILE=/etc/cvsupfile

and start a synchronization:

% cd /usr/ports && make update

continu......

Tutorial PHP:

Apa sih PHP itu?

Apa sih PHP itu ? Mungkin itu pertanyaan yang ada di benak rekan-rekan saat mendengar kata PHP. PHP merupakan script yang menyatu dengan HTML dan berada pada server (server side HTML embedded scripting). Dengan PHP ini Anda dapat membuat beragam aplikasi berbasis web, mulai dari halaman web yang sederhana sampai aplikasi komplek yang membutuhkan koneksi ke database.

Sampai saat ini telah banyak database yang telah didukung oleh PHP dan kemungkinan akan terus bertambah. Database tersebut adalah :

* dBase
* DBM
* FilePro
* mSQL
* MySQL
* ODBC
* Oracle
* Postgres
* Sybase
* Velocis

Selain itu PHP juga mendukung koneksi dengan protokol IMAP, SNMP, NNTP dan POP3.

Tutorial PHP:
Yang dibutuhkan untuk menjalankan PHP

Untuk dapat menjalankan PHP Anda membutuhkan sebuah web server. Anda yang pake Linux dapat menggunakan Apache (www.apache.org) sebagai web servernya. Anda pemakai Windows 98 paling enak menggunakan Personal Web Server (sama2 produk Microsot, keuntungannya bisa sekalian buat belajar ASP). Web server Xitami (www.imatix.com) dapat digunakan apabila Anda menggunakan Windows NT.

Sedangkan PHP-nya sendiri dapat Anda download dari www.php.net. Perhatikan bahwa PHP yang Anda download sesuai dengan sistem operasi komputer Anda (Linux atau Windows).

Install PHP pada Windows 98

1. Setelah Anda mendapatkan PHP dalam bentuk file zip, segera ekstrak dengan menggunakan WinZip atau pun WinRar.
2. Ganti nama file php.ini-dist menjadi php.ini.
3. Copy semua file tersebut (totalnya ada 10 file) ke directory Windows Anda (biasanya C:\Windows).

Langkah selanjutnya adalah mengganti setting pada registry Windows.

1. Dari menu Start, pilih Run.
2. Ketikkan regedit, klik OK.
3. Buka cabang HKEY_CLASSES_ROOT.
4. Buat key baru dengan cara klik kanan pada HKEY_CLASSES_ROOT, pilih New - Key.
5. Beri nama key tersebut dengan .php3.
6. Pada panel sebelah kanan klik 2x pada [Default] dan isi dengan php3file.
7. Buat key baru lagi pada HKEY_CLASSES_ROOT.
8. Beri nama key baru tersebut dengan php3file.
9. Pada php3file, buat key baru dengan nama Shell.
10. Pada php3file\Shell, buat key baru dengan nama Open.
11. Pada php3file\Shell\Open, buat key baru dengan nama Command.
12. Pada panel sebelah kanan klik2x pada [Default] dan isi dengan C:\Windows\php.exe.
13. Buka key HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\W3SVC\Parameters\Script Map.
14. Pada panel sebelah kanan buat string value baru dengan cara klik kanan (pada panel sebelah kanan), pilih New - String Value.
15. Beri nama dengan .php3.
16. Klik 2x pada .php3 tersebut.
17. Isi dengan C:\Windows\Php.exe.

Untuk mengecek apakah PHP Anda sudah terinstall dengan baik, tulis kode berikut ini dan simpan dengan nama test.php3.

phpinfo()
?>

Jika PHP sudah terinstall dengan baik maka saat file tersebut dibaca dari browser akan terlihat informasi mengenai PHP.


Tutorial PHP:
Menginstall PHP Triad

Selama ini Anda mungkin hanya mengenal Personal Web Server (PWS) sebagai web server untuk menjalankan PHP pada sistem operasi Windows 9x. Padahal selain PWS Anda juga bisa menggunakan Apache sebagai web servernya. Untuk menginstall Apache for Windows Anda dapat menggunakan PHP Triad yang merupakan "kumpulan" dari berbagai software yaitu:

* PHP - 4.0.5
* MySQL - 3.23.32 (database server)
* Apache - 1.3.14 (web server)
* PHPMyAdmin - 2.1.0 (untuk administrasi database)
* Perl - nsPerl 5.005_03

Jadi dengan menginstall PHP Triad Anda dapat menggunakannya untuk belajar PHP, Perl dan database MySQL. Untuk menginstall PHP Triad caranya adalah sebagai berikut:
1 Download PHP Triad di http://www.phpgeek.com
2 Untuk memulai proses install, klik 2x pada file yang baru Anda download tersebut dan tunggu sampai proses install selesai.
3

Untuk menjalankan Apache, klik Start - Programs - PHP Triad - Start Apache.

Untuk menjalankan MySQL, klik Start - Programs - PHP Triad - Start MySQL.

4. Untuk mengecek Apache, klik shortcut Launch Site. Jika pada browser muncul tulisan "Welcome to PHPTriad for Windows ... " maka proses install yang Anda lakukan berhasil.
5. Untuk mengecek MySQL, klik Start MySQL dan PHPMyAdmin. Jika Anda melihat tulisan "Welcome to phpMyAdmin..." berarti proses install berhasil.
6. Sampai di sini proses intall telah selesai. Jika sewaktu-waktu Anda ingin mencoba script PHP dan database MySQL Anda harus menjalankan Apache dan MySQL terlebih dahulu.

tambahan :

Letakkan script PHP Anda di C:\apache\htdocs.

Mengenal IP Command

Di bawah ini adalah perintah-perintah yang berhubungan dengan jaringan. Untuk melakukan perintah-perintah tersebut Anda harus masuk ke MS DOS Prompt.

ipconfig /all
Menampilkan informasi konfigurasi koneksi, misalnya Host Name, Primary DNS Type, Ethernet Adapter LAN.

ipconfig /displaydns
Menampilkan DNS Cache.

ipconfig /flushdns
Menghapus DNS Cache

ipconfig /release
"Menghapus" semua koneksi IP Address.

ipconfig /renew
Membuat IP Address baru untuk adapter tertentu.

ipconfig /registerdns
Melakukan refresh DNS dan meregister kembali koneksi DNS.

ipconfig /showclassid
Menampilkan informasi DHCP Class.

ipconfig /setclassid
Mengubah DHCP Class ID

control netconnections
Menampilkan Network Connection.

ping
Contoh: ping www.klik-kanan.com
Melakukan test koneksi ke situs www.klik-kanan.com. Semakin sedikit % loss-nya makan semakin baik koneksinya.

tracert
Menampilkan informasi IP Address route.

netstat
Menampilkan informasi koneksi TCP/IP yang sedang aktif.

route
Menampilkan local route.

hostname
Menampilkan nama komputer.
Menamplkan informasi system

Untuk menampilkan informasi system pada Windows XP, Anda dapat mengetikkan pada MS DOS Prompt:

systeminfo

Konfigurasi Linux Untuk Dijadikan Gateaway

April 18, 2007 — Arief Solikhin

Pada artikel kali ini membahas tentang bagaimana mengkonfigurasi Linux yang kita miliki sebagai gateway yang menghubungkan jaringan lokal kita ke dunia luar.
Catatan:
Telah berhasil dilakukan pada sistem distribusi Redhat dan Mandrake
1. Konfigurasi I (Hubungan Dial-Up)
Pada konfigurasi pertama ini yang akan dilakukan adalah memasang 2 jenis interface dalam Linux yg kita miliki (Dial Up Modem dan ethernet card).
Langkah-langkah:
a. Instalasi ethernet
Instalasi ethernet cukup terbilang mudah jika kita mengetahui betul apa merk dari ethernet kita dan modul apa yang dibutuhkan oleh ethernet yang kita miliki. Apalagi jika kita telah membaca Ethernet HOWTO ) dan dokumen-dokumen yang semisal. Jika jenis ethernet card yang kita miliki adalah jenis card slot PCI, dan modulnya telah didukung oleh Linux, maka cara yang paling mudah untuk menginstal ethernet adalah dengan memasang ethernet card sebelum instalasi Linux dilakukan, karena pada saat instalasi, Linux kita akan mengenali secara otomatis ethernet yang telah terpasang dan kita hanya tinggal mengkonfigurasi pengalamatan IP nya saja.
Bagaimana jika kita memasang ethernet card setelah instalasi Linux selesai dilakukan? Jawabannya…kita tanya Galileo . Begini…, jika ethernet dipasang setelah instalasi Linux selesai dilakukan, maka yang harus kita lakukan hanyalah memanggil modul yang dibutuhkan oleh si ethernet tadi jika modul tersebut telah include dalam kernel Linux kita. Untuk memanggil modul bisa menggunakan command modprobe atau insmod. Sebagai contoh, jika saya memiliki ethernet card RTL8139 dengan jenis slot PCI, maka untuk memanggil modulnya saya akan mengetikkan command:
# modprobe rtl8139too

di mana rtl8139too adalah nama modul yang dibutuhkan oleh RTL8139, sesuaikanlah dengan modul yg dibutuhkan oleh ethernet anda. Jika ethernet card yang anda punya memiliki jenis slot ISA, maka yang harus anda lakukan adalah memanggil modulnya beserta parameter irq dan io nya. Contoh, jika saya memiliki ethernet card ISA dengan merk NE2000, maka untuk memanggil modulnya saya akan mengetikkan:

# modprobe ne irq=9 io=0×300

di situ saya mendefinisikan bahwa NE2000 yang saya miliki mempunya irq=9 dan io=300, sesuaikanlah parameter itu dengan parameter irq dan io yang anda miliki. Ingatlah bahwa tidaklah mudah untuk menentukan pada irq dan io berapa ethernet card kita berada. Anda akan sangat terbantu bila memiliki software utility dari ethernet card yg bersangkutan (biasanya berbasis DOS), atau terapkan metode “try and error” ) .
Jika ethernet card kita telah terdeteksi, maka masukkanlah parameter modul ethernet kita di dalam file /etc/modules.conf atau dalam file /etc/conf.modules utk redhat versi 6. Hal ini bertujuan agar ethernet kita tetap dikenali oleh Linux apabila Linux direboot. Contoh:
Untuk ethernet rtl8139 PCI (sesuaikan dengan modul ethernet anda):
alias eth0 8139too
Untuk ethernet NE2000 ISA (sesuaikan dengan modul ethernet, irq, dan io anda):
alias eth0 ne
options irq=9 io=0×300

b. Konfigurasi IP ethernet
Untuk menjadikan Linux kita sebagai gateway dengan dial up modem, pengalamatan IP memegang peranan yang cukup penting dari jalan tidaknya gateway yang kita buat. Yang harus dilakukan adalah berikan IP lokal pada ethernet kita dengan default gateway dikosongkan. Perintah di bawah ini akan membuat hal itu terjadi:

# ifconfig eth0 192.168.1.254 netmask 255.255.255.0

Perintah di atas adalah “on the fly configuration”, maksudnya akan berlaku pada saat itu saja, dan jika komputer kita direboot konfigurasi itu akan hilang.
Untuk mempertahankan konfigurasi, saya lebih menyukai mengedit file /etc/sysconfig/network-script/ifcfg-eth0, masukkanlah DEVICE, IP, netmask, network, dsb. Contoh:
DEVICE = eth0
IPADDR = 192.168.1.254
NETMASK = 255.255.255.0
NETWORK = 192.168.1.0
BROADCAST = 192.168.1.255
ONBOOT = yes

Agar paket dari jaringan client dapat berjalan ke jaringan di luarnya melalui gateway, maka harus diterapkan forwarding.
Edit file /etc/sysctl.conf untuk mengeset forwarding di Linux kita. Contoh:

net.ipv4.ip_forward = 1

Internet hanya mengenal IP publik. Oleh karena itu dalam berinternet ria kita menggunakan IP publik. Lalu bagaimana halnya jika jaringan client
yang kita miliki memiliki IP lokal? Di sinilah fungsi masquerading. Dengan masquerading, maka IP lokal dari jaringan client akan diwakilkan oleh
IP publik di sisi modem. Set masquerading pada Linux anda:

# ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0.0.0.0/0 (untuk kernel 2.2.x dan 2.4.x yg kompatibel dgn ipchains)

# iptables -A POSTROUTING -j MASQUERADE -t nat -s 192.168.1.0/24 -o ppp0 (kernel 2.4.x)

Setelah selesai mengedit file tsb, cobalah restart jaringan anda dengan mengetikkan command:

# /etc/rc.d/init.d/network restart

c. Instalasi dan konfigurasi modem dial-up
Karena saya lebih prefer menggunakan wvdial, maka saya akan menjelaskan bagaimana menginstal modem dial-up dengan menggunakan wvdial.
- Pastikan wvdial telah terinstal di komputer anda:

[root@nasuha root]# rpm -qa |grep wvdial
wvdial-1.41-15

Jika outputnya memunculkan wvdial maka wvdial telah terinstal. Jika belum, maka installah wvdial dengan commannd:
rpm -Uvh wvdial-1.41-15.i386.rpm
Untuk RH7.2 wvdial-1.41-15.i386.rpm terdapat pada cdrom dalam direktori RedHat/RPMS/.

- Pastikan kernel anda telah mendukung PPP
- Pasang modem dial-up anda, nyalakan, hubungkan dengan port serial (jika external modem), lalu ketikkan command berikut:

# wvdialconf /etc/wvdial.conf

- Edit file /etc/wvdial.conf. Hapus semua tanda ; di awal setiap baris dan isikan Phone, Username, dan password dengan account dial-up yang anda miliki. Contoh:

[Dialer Defaults]
Modem = /dev/ttyS0
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0
Phone = 4567899
Username = adadech
Password = adadech

- Edit file /etc/resolv.conf. Isikan servername dengan IP DNS tempat ISP anda. Misalnya DNS ISP anda adalah 202.155.3.4 maka editlah jadi seperti ini:

nameserver 202.155.3.4

- Cobalah modem dial-up anda dengan mengetikkan wvdial ) (jangan lupa untuk menghubungkan ke line telephone ya :p ):

[root@nasuha root]# wvdial
–> WvDial: Internet dialer version 1.41
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0
OK
–> Modem initialized.
–> Sending: ATDT 4553333
–> Waiting for carrier.
ATDT 4567899
CONNECT 46666/ARQ/x2/LAPM/V42BIS
–> Carrier detected. Waiting for prompt.
Welcome to 3Com Total Control HiPer ARC ™
Networks That Go The Distance ™
login:
–> Looks like a login prompt.
–> Sending: adadech
adadech
Password:
–> Looks like a password prompt.
–> Sending: (password)
~[7f]}#@!}!}!} }?}!}$}%j}”}&[7f][7f][7f][7f]}%}&[04]k=@}’}”}(}”}1}$}%j}3}#} *[~
–> PPP negotiation detected.
–> Starting pppd at Thu Mar 28 12:01:16 2002

- Pastikan ppp telah up:

[root@nasuha root]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:50:BF:18:50:DF
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:185 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:28203 (27.5 Kb)
Interrupt:5 Base address:0×7000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:183 errors:0 dropped:0 overruns:0 frame:0
TX packets:183 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24786 (24.2 Kb) TX bytes:24786 (24.2 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:202.53.232.141 P-t-P:202.53.252.18 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1514 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:123 (123.0 b) TX bytes:91 (91.0 b)

- Pastikan default gw telah mengarah ke IP gateway ISP (P-t-P modem):

[root@nasuha root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
202.53.252.18 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 202.53.252.18 0.0.0.0 UG 0 0 0 ppp0

- Lakukan test dengan melakukan browsing dari jaringan client. Ingat bahwa gateway di client haruslah mengarah ke IP di eth0.

2. Konfigurasi II (hubungan leased line)
Pada konfigurasi yang kedua ini, akan dipasang 2 ethernet dalam satu Linux Box. Hal ini dapat diterapkan pada kasus berikut:

Gambar dapat dilihat di http://www.arinet.org/skema-gateway2.txt

Langkah-langkah:
a. Install kedua ethernet yang akan digunakan. Proses instalasi sama seperti di atas. Hanya saja di /etc/modules.conf ada dua parameter alias yg harus didefinisikan. Contoh, jika saya memiliki eth0 RTL8139 dan eth1 rtl8029, maka parameter di modules.conf sbb:
alias eth0 8139too
alias eth1 ne2k-pci

b. Konfigurasi IP
Sebagai contoh:
router memiliki IP 202.155.1.1 netmask 255.255.255.0 (interface yg berhadapan langsung dengan eth0)
ethernet 1 (eth0) memiliki IP 202.155.1.2 netmask 255.255.255.0
ethernet 2 (eth1) memiliki IP 192.168.1.254 netmask 255.255.255.0
Maka yang harus diset adalah default gateway dari ethernet 1 mengarah ke IP interface router yang langsung mengarah ke ethernet 1. Sebagai contoh di atas, maka setlah default gateway dari ethernet 1 ke 202.155.1.1 netmask 255.255.255.0.
- Edit file /etc/sysconfig/network-script/ifcfg-eth0. Contoh:

DEVICE = eth0
IPADDR = 202.155.1.2
NETMASK = 255.255.255.0
NETWORK = 202.155.1.0
BROADCAST = 202.155.1.255
ONBOOT = yes

- Edit file /etc/sysconfig/network-script/ifcfg-eth1. Contoh:

DEVICE = eth1
IPADDR = 192.168.1.254
NETMASK = 255.255.255.0
NETWORK = 192.168.1.0
BROADCAST = 192.168.1.255
ONBOOT = yes

- Edit file /etc/sysconfig/network. Contoh:

NETWORKING=yes
HOSTNAME=nasuha.homelinux.org
GATEWAY=202.155.1.1
GATEWAYDEV=eth0

- Edit file /etc/sysctl.conf untuk mengeset forwarding di Linux kita. Contoh:

net.ipv4.ip_forward = 1

- Set masquerading pada Linux anda:

# ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0.0.0.0/0 (untuk kernel 2.2.x dan 2.4.x yg kompatibel dgn ipchains)
# iptables -A POSTROUTING -j MASQUERADE -t nat -s 192.168.1.0/24 -o eth0 (kernel 2.4.x)

- Setelah selesai mengedit file tsb, cobalah restart jaringan anda dengan mengetikkan command:

# /etc/rc.d/init.d/network restart

- Jangan lupa untuk memasukkan DNS ISP anda pada /etc/resolv.conf
- Lakukan test pada jaringan client. Ingatlah bahwa gateway di sisi client harus diset pada interface yang berhadapan langsung dengannya. Contoh di atas interface tersebut adalah eth1.

Selamat mencoba……….
Sumber : dedenthea.wordpress.com

conf server freebsd

- /etc/rc.conf - berisi konfigurasi tentang interface network dan servis-servis mana saja yang dijalankan saat boot.

….
defaultrouter=”192.168.0.12″
hostname=”bsd.gatot.net”
ifconfig_lnc0=”inet 192.168.0.13 netmask 255.255.255.0″
keymap=”us.iso”
linux_enable=”YES”
moused_enable=”YES”
nfs_server_enable=”YES”
rpcbind_enable=”YES”
sshd_enable=”YES”
usbd_enable=”YES”
….

Untuk konfigurasi secara lengkap ada di /etc/defaults/rc.conf. file rc.conf ini mengganti konfiguurasi di defaultsnya

- /etc/resov.conf - Konfigurasi untuk DnS server (resolver)

search gatot.net
nameserver 192.168.0.10

Pada contoh diatas, misal kita melookup domain bsd, maka otomatis akan dicari nama bsd.gatot.net pada DNS server 192.168.0.10 , apabila tidak ada nameserver maka otomatis akan diresolve oleh localhost

- /etc.passwd - file database user
file ini berisi data user-user (tidak termasuk password), seperti nama, home direktori, shell dan lain-lain

- /etc/sysctl.conf - konfigurasi untuk perintah sysctl (merubah parameter kernel on the fly). apabila konfigurasi ini kosong maka sysctl dijalankan secara default. Secara umum, konfigurasi sysctl.conf ini adalah cara lain mengubah parameter kernel selain dengan command sysctl.
Contoh:

bsd# sysctl kern.logsigexit=0
kern.logsigexit: 1 -> 0

sama dengan, konfigurasi di sysctl.conf berisi

kern.logsigexit=0

- /etc/inetd.conf - Konfigurasi server-server bawaan BSD

……..
ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l
ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -l
#ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
#ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i -6
#telnet stream tcp nowait root /usr/libexec/telnetd telnetd
……..

Secara default, BSD menyediakan inetd sebagai daemon berbagai layanan server sebagai alternatif menjalankan stand alone server. Berbagai servis seperti ssh, ftp, telnet. karena merupakan bawaan BSD, maka edit konfigurasi mungkin hanya mencakup enable-disable service (Beri/hilangkan tanda # )), untuk direktori file binari sudah didefinisikan default.

- /etc/hosts.allow - Merupakan file konfigurasi untuk mengijinkan/tidak servis untuk diakses oleh pihak tertentu
Secara umum konfigurasi file ini ada 3 bagian
[servis]:[IP / Subnet/domain pengakses] : allow/deny

……..
exim : localhost : allow
sendmail : ALL : allow
rpcbind : 192.0.2.96/255.255.255.224 : deny
……..

- /etc/make.conf - File konfigurasi untuk proses menginstall / mem-build
Ada beberapa parameter, parameter yang saya temui paling-paling hanya letak repositori berada, apabila dibutuhka file dependency, Tapi dari manual page make.conf, ada banyak parameter…. (hmmm.. belum wa p