FREEBSD… Feel FREE….Installation (Fresh)
1) Boot CD & skip kernel
2) Choose ‘standard install’
3) Partition – make sure hdd ada 1 partition saja… delete sebarang FAT format (A - to flag ‘C’, Q to quit)
4) Choose ‘standard MBR’
5) Partition – press ‘A’ for auto default, Q to quit
– my partition
C root 1GB / FS
C swap 2GB swap swap
C var 4GB /var FS
C usr all /usr FS6) Choose ‘X-developer’ – press ‘space’ & ‘OK’ (make sure all item is ‘X’), exit
7) Choose install from CD/DVD
8 ) Press OK after installation
Server Configuration (section 1)1) configure ethernet – NO
2) function network gateway – NO
3) configure inetd – NO
4) anonymous ftp – NO
5) configure nfs (server/client) NO
6) default security – NO
7) press OK
Server Configuration (section 2)
1) customize console – NO
2) time zone – YES (select time)
3) linux library – YES
4) usb – NO/YES (depend on tools)
5) x-server – NO
6) view application – NO
7) add user – NO
8 ) new password (set password)
9) visit general configuration – NO
10) exit install (take out CD & Restart)
Network Configuration1) ifconfig – check active ethernet
2) cd /etc – ee rc.conf (vi rc.conf) ee is the best woooo… that’s BSD for..
3) add line to ‘ ifconfig – [code for network card rl0/ed0] = "DHCP" or "ip address" '
4) Esc (save)
5) ifconfig r[code for network card rl0/ed0] down/up
6) shutdown -r now
Setup IP Server1) /stand/sysinstall
2) configure - networking
3) interfaces - select card - NO - NO
4) host
5) domain
6) gateway
7) ip
8 ) netmask
9) save
10) init 1 (exit)
dns, server IP can be configured at /etc/resolv.conf
allow access can be configured at /etc/hosts.allow
activate ftp/telnet can be configured at /etc/inetd.conf
Syslog Info1) check syslog - ps -ax | grep syslogd
2) /usr/sbin/syslogd
3) -kill [id] (can kill process)
4) configure syslog - ee /etc/syslog - enable (buang # pada line /var/log/all.log)
5) check log - touch /var/log/all.log
6) run syslog - /etc/rc.d/syslogd start
7) stop syslog - /etc/rc.d/syslogd stop
Apache Download & Install1) cd /usr/ports/www/apache2
2) make install (make install clean)
3) wait until finish
4) configure apache - ee /usr/local/etc/apache2/httpd.conf
line >300 [put 'servername ip :80']
5) start apache - /usr/local/etc/rc.d/apache2.sh start / stop
6) check apache - ps -ax | grep httpd
NOTES
*********************************************************************
# - simbol ini akan dipaparkan dalam akaun root
% - simbol ini akan dipaparkan dalam C shell (/bin/csh)
$ - simbol ini akan dipaparkan dalam Bourne shell (/bin/bsh)
$ - simbol ini akan dipaparkan dalam Korne shell (/bin/ksh)
**********************************************************************
Ringkasan perkataan
csh - C shell
bsh - Bourne shell
ksh - Korne shell
GUI - Graphical User Interface
CLI - Command Line
inet - internet net
ppp0 - streamyx
rl0 - realteak network card
csh (default file)
- .cshrc
- .login
ksh (default file)
- .profile
bourne (default file)
- .profile
bourne again shell (default file)
- .bash_profile
GUI (Graphical User Interface)
- admintool
- solstice
- solaris management console (smc)
Change Password
passwd
Changing local password for root
New password:
Retype new password:
Compile Sound FreeBSD
find / -name GENERIC
cd /sys/i386/conf
ls
vi GENERIC
masukkan
options CPU_ENABLE_SSE
options USER_LDT
device pcm
:wq!
kemudian
cp GENERIC CONFIGFILE
config CONFIGFILE
cd ../../compile/CONFIGFILE
make depend
make
make install
---------------------------------------------------------
Compile & Install A New Kernel FreeBSD (Contoh: compile sound)
Mengandaikan kernel ialah CONFIGFILE
Method 1:
#cd /sys/i386/conf
#/usr/sbin/config CONFIGFILE
#cd ../../compile/CONFIGFILE
#make depend
#make
#make install
#shutdown -r now
atau
Method 2:
#cd /usr/src
#make buildkernel KERNCONF=CONFIGFILE
#make installkernel KERNCONF=CONFIGFILE
atau
Method 3:
#vi /etc/make.conf
Setkan KERNCONF=CONFIGFILE
---------------------------------------------------------------
Install Applications FreeBSD
cd /usr/ports/www/mozilla - contoh (web browser)
cd /usr/ports/multimedia/xine - contoh (wayang)
cd /usr/ports/net/gaim - contoh (chatting)
make;make install;make clean
atau
make install && make clean
atau
make install clean
------------------------------------------------
Configure Untuk Update The latest Version Applications FreeBSD
cd /usr/share/examples/cvsup
vi ports-supfile
untuk cari default host dalam ports-supfile
esc +/ type default host
delete CHANGE_THIS.FreeBSD.org
gantikan dengan cvsup1.FreeBSD.org
# cvsup adalah sama dengan cvs - dia akan sync dengan source yang ada dekat server
yang di cari iaitu dari 1 sehingga 18 server supaya dapat applications atau version
yang paling up to date untuk semua direktori dalam port.
masuk dalam direktori cd /usr/port/net/cvsup
make install clean
cvsup /usr/share/examples/cvsup
cvsup usr/ports/net/cvsup
tekan butang play
------------------------------------------------------------------------------------
Bagaimana Untuk Menjalankan Binary UNIX lain ke atas FreeBSD
Dalam kernel, masukkan arahan-arahan ini, dan compile
option COMPAT_SVR4 # binary compatibility with SVR4
option COMPAT_IBCS2 # binary compatibility with SCO and ISC
option COMPAT_LINUX # binary compatibility with Linux
option COMPAT_FREEBSD # binary compatibility with FreeBSD
option COMPAT_BSDOS # binary compatibility with BSD/OS
-----------------------------------------------------------------------------------------
Bagaimana hendak switch console ke console FreeBSDALT+F1 atau F[2,3,4,5,6,7,8,9,10,11,12]
--------------------------------------------------
Permissions
d - directory
l - link
- rw- r-- r--
type file owner group other permission
1 - execute
2 - write
4 - read
Contoh: 657 bermakna 6 untuk owner (iaitu 2+4=6/write+read)
5 untuk group (iaitu 1+4=5/execute+read)
7 untuk other permission (1+2+4=7/execute+write+read)
---------------------------------------------------------------------------------------
Edit MOTD (Message Of The Day)
cd /etc
vi motd (esc,:wql,enter) @ ee motd (esc,leave editor,save changes)
------------------------------------------------------------------------------------------
Nak configure IP
/stand/sysinstall
configure --> networking --> no --> no --> exit secara GUI --> init 1 --> exit
-------------------------------------------------------------------------------
Nak disable IPv6
vi @ ee etc/rc.conf
cari IPv6
tambahkan simbol ini #
---------------------------------------
Nak tambah user
/stand/sysinstall
configure --> user management --> exit
--------------------------------------
Nak buang user
rmuser -y namauser
----------------------------Nak disable @ enable ftp, rlogin dan lain-lain yang lebih kurang sama
vi @ ee inetd.conf
tambah(enable) atau buang(disable) simbol #
---------------------------------------------------------------------
Nak tukar maklumat pengguna
chfn
---------------------------
Command
ifconfig -a =mencari maklumat ip@network
---------------------------------------------------------MAKLUMAT TAMBAHAN
User & Web
dengan adanya webserver Apache pada server anda.. anda boleh wujudkan web user dengan cara mewujudkan direktori 'public_html' kat dalam home direktori server anda, ini kerana secara 'default', Apache akan mencari fail utk web (index.html) dalam direktori tersebut... lkita pelru tukar mode untuk direktori home tersebut supaya membolehkan webserver membaca fail web dari akaun anda...
contoh :
[id_anda@serverku /home/users]$ chmod o+x id_anda
tapi sebelum tu ikuti contoh langkah2 ini :
[freebsd@serverku ~]$ cd adi
[freebsd@serverku ~/adi]$ mkdir public_html
[freebsd@serverku ~/adi]$ cd ..
[freebsd@serverku /home/users]$ chmod o+x adi
letakkan / uploadkan semua fail html anda ke dalam direktori public_html tersebut... dan gunakan URL berikut :
http://localhost/~adi
Zip dan Unzip Web
untuk zip folder n file
tar cvf [nama.gz] htdocs (compress)
tar xvf [nama.gz] htdocs (extract)
(htdocs tu ialah folder)
atau copy sahaja...
#!/bin/sh
for i in `ls home`
do
cp test.123 /home/$i
done
atau
for i in `ls /home` ; do ; cp test.123 /home/$i ; done
ataupun
#!/bin/sh
for f in `ls /home`
do
siapa=`id -u $f`
geng=`id -g $f`
cp /direktori/nama_fail.doc /home/$f
chown $siapa:$geng /home/$f/nama_fail.doc
done