PengantarSejarah Lahirnya OpenBSDPada awal 1990, Theo de Raadt bertanggungjawab untuk melakukan porting NetBSD pada mesin-mesin SPARC. Namun karena terjadi ketidakcocokan antara Theo dan NetBSD core team untuk masalah pengembangan NetBSD, membuat Theo hengkang dengan mendirikan proyek baru bernama OpenBSD. OpenBSD lebih memfokuskan pada tujuan memproduksi sebuah operating system yang secure. Pada awal 1996, OpenBSD team membuat analisa baris-per-baris untuk setiap source code yang disertakan untuk menghindari adanya potensi bugs dan security hole. Dengan tujuan menemukan bugs sebelum orang lain menemukannya, membuat OpenBSD semakin matang dengan konsep “secure by default”-nya. OpenBSD juga mengembangkan porting ke banyak mesin, hal ini sepertinya terinfluence dengan pengembangan NetBSD mengingat OpenBSD juga lahir dari NetBSD, telah banyak mesin-mesin Motorola 86k, VAX, dan Intel yang berhasil diinstall OpenBSD sebagai operating systemnya.
Apa saja yang disertakan dengan OpenBSDOpenBSD menyertakan applikasi-aplikasi yang umumnya diperlukan di setiap rilisnya. Diantaranya adalah:
InstallFile ISO OpenBSDPertanyaan yang sangat sering muncul bagi yang baru kenal dengan OpenBSD adalah : dimana sih ngedownload file .iso nya OpenBSD ? kok di official dan mirror-mirror FTP nya gak ada. Jawabannya adalah : Memang tidak ada !. OpenBSD tidak menyediakan file .iso seperti yang disediakan oleh Linux, FreeBSD, NetBSD dan lainnya Untuk lebih lengkapnya silahkan baca http://www.openbsd.org/faq/faq3.html#3.1.2 Meskipun begitu, ada beberapa pihak yang membuat file ISO OpenBSD dan tersedia untuk di download di internet. Tentu saja file-file ISO tersebut bukan berasal dari OpenBSD. Saya pribadi tidak menganjurkan untuk menggunakan file yang beredar di internet ini. Kenapa ? Alasan yang masuk akal adalah security. Apa jadinya kalau distribusi OpenBSD yang anda download iso nya itu sudah dimodifikasi oleh pihak-pihak tertentu untuk tujuan tertentu pula. Membuat file ISO OpenBSD tidak terlalu sulit. Berikut adalah langkah-langkah (dengan menggunakan Windows) untuk membuat file ISO OpenBSD 3.8 untuk arsitektur mesin i386 (cara yang sama bisa digunakan untuk membuat file iso untuk arsitektur mesin yang lain, seperti alpha, amd64, dsb). Walaupun ada menggunakan UNIX varian untuk membuat file ISO ini, anda bisa melakukannnya dengan cara yang sama, selama di environment anda terdapat aplikasi
3.8/ i386/ bsd bsd.mp bsd.rd cdrom38.fs base38.tgz comp38.tgz etc38.tgz game38.tgz man38.tgz misc38.tgz xbase38.tgz xetc38.tgz xfont38.tgz xserv38.tgz xshare38.tgz ports.tar.gz src.tar.gz srcsys.tar.gz HARDWARE PACKAGES PORTS README TRANS.TBL song38.mp3
c:\isotools\mkisofs -v -r -T -J -V "OpenBSD-Release" -b C:/OpenBSD/3.8/i386/cdrom38.fs -c boot.catalog -o C:/OpenBSD/OpenBSD-38.iso -x C:/OpenBSD/OpenBSD-38.iso C:/OpenBSD/.
Catatan : Cara yang sama dapat digunakan untuk membuat DVD-ROM OpenBSD dengan menyertakan semua file-file packages yang tersedia. Total ukurannya sekitar 2.5 GB. InstalasiProses instalasi OpenBSD, termasuk proses instalasi yang paling cepat dibandingkan dengan Operating System yang lainnya. Perlu dicatat, bahwa instalasi OpenBSD tidak sekedar instalasi kernel. Umumnya OpenBSD dapat diinstal melalui FTP, HTTP ataupun dari CD-ROM, untuk ISO resmi tidak disediakan oleh OpenBSD 1). Untuk ISO yang tidak resmi bisa didownload pada http://ftp.giga.net.tw/OS/OpenBSD/iso/ , jika anda menyukai OpenBSD, mohon dipertimbangkan untuk membeli CD resmi yang dapat membantu membiayai project OpenBSD SinglebootDalam kasus ini, instalasi OpenBSD menggunakan CDROM Booting melalui CDROM Loading;.......... probing: pc0 com0 com1 apm mem[634K 509M 1024K a20=on] disk: fd0 fd1 hd0+* >> OpenBSD/i386 BOOT 2.06 boot> <enter> Install: untuk menginstalasi OpenBSD ke sistem yang baru. Catatan: hanya beda 1 versi, seperti 3.6 → 3.7, atau, dari 3.7 → 3.8, untuk perbedaan 2-3 versi, disarankan untuk membackup data & configuration, dan melakukan instalasi baru. rootdev=0x1100 rrootdev=0x2f00 rawdev=0x2f02 erase ^?, werase ^W, kill ^U, intr ^C, status ^T (I)nstall, (U)pgrade or (S)hell? i <enter> Welcome to the OpenBSD/i386 3.8 install program. This program will help you install OpenBSD in a simple and rational way. At any prompt except password prompts you can run a shell command by typing '!foo', or escape to a shell by typing '!'. Default answers are shown in []'s and are selected by pressing RETURN. At any time you can exit this program by pressing Control-C and then RETURN, but quitting during an install can leave your system in an inconsistent state. Specify terminal type: [vt220] <Enter> Do you wish to select a keyboard encoding table? [no] <Enter> IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this program can cause SIGNIFICANT data loss. It is often helpful to have the installation notes handy. For complex disk configurations, relevant disk hardware manuals and a calculator are useful. Proceed with install? [no] y <enter> Cool! Let's get to it... You will now initialize the disk(s) that OpenBSD will use. To enable all available security features you should configure the disk(s) to allow the creation of separate filesystems for /, /tmp, /var, /usr, and /home. Available disks are: wd0. Which one is the root disk? (or done) [wd0] <Enter> Untuk server ataupun firewall, sangat jarang menggunakan dual operating system, untuk kasus ini, semua space harddisk didedikasi untuk OpenBSD Do you want to use *all* of wd0 for OpenBSD? [no] y <enter> Partisi Putting all of wd0 into an active OpenBSD MBR partition (type 'A6')...done. You will now create an OpenBSD disklabel inside the OpenBSD MBR partition. The disklabel defines how OpenBSD splits up the MBR partition into OpenBSD partitions in which filesystems and swap space are created. The offsets used in the disklabel are ABSOLUTE, i.e. relative to the start of the disk, NOT the start of the OpenBSD MBR partition. # using MBR partition 3: type A6 off 63 (0x3f) size 41929587 (0x27fcb73) Treating sectors 63-41929650 as the OpenBSD portion of the disk. You can use the 'b' command to change this. Initial label editor (enter '?' for help at any prompt) > ? Available commands: ? [cmnd] - this message or command specific help. a [part] - add new partition. b - set OpenBSD disk boundaries. c [part] - change partition size. D - set label to default. d [part] - delete partition. e - edit drive parameters. g [b|d|u] - use [b]ios, [d]isk or [u]ser geometry. M - show entire OpenBSD man page for disklabel. m [part] - modify existing partition. n [part] - set the mount point for a partition. p [unit] - print label. q - quit and save changes. r - recalculate free space. s [path] - save label to file. u - undo last change. w - write label to disk. X - toggle expert mode. x - exit without saving changes. z - zero out partition table. Numeric parameters may use suffixes to indicate units: 'b' for bytes, 'c' for cylinders, 'k' for kilobytes, 'm' for megabytes, 'g' for gigabytes or no suffix for sectors (usually 512 bytes). '%' for percent of total disk size, '&' for percent of free space. Non-sector units will be rounded to the nearest cylinder. Entering '?' at most prompts will give you (simple) context sensitive help. > Untuk skema partisi, digunakan > p m device: /dev/rwd0c type: ESDI disk: ESDI/IDE disk label: QUANTUM FIREBALL bytes/sector: 512 sectors/track: 63 tracks/cylinder: 15 sectors/cylinder: 945 cylinders: 16383 total sectors: 20480.0M free sectors: 20473.4M rpm: 3600 16 partitions: # size offset fstype [fsize bsize cpg] a: 20473.4M 0.0M unused 0 0 c: 20480.0M 0.0M unused 0 0 > d a <enter> > a a <enter> offset: [63] <enter> size: [41929587] 128M <enter> Rouding to nearest cylinder: 261702 FS type: [4.2BSD] <enter> mount point: [none] / <enter> > a b <enter> offset: [261765] <enter> size: [41667885] 256M <enter> Rouding to nearest cylinder: 524475 FS type: [swap] <enter> > a d <enter> offset: [786240] <enter> size: [41143410] 1G <enter> Rouding to nearest cylinder: 2096955 FS typeL [4.2BSD] <enter> mount point: [none] /tmp <enter> > a e <enter> offset: [2883195] <enter> size: [39046455] 8G <enter> Rouding to nearest cyclinder: 16777530 FS typeL [4.2BSD] <enter> mount point: [none] /var <enter> > a f <enter> offset: [19660725] <enter> size: [22268925] 2G <enter> Rouding to nearest cylinder: 4193910 FS typeL [4.2BSD] <enter> mount point: [none] /usr <enter> > a g <enter> offset: [23854635] <enter> size: [18075015] <enter> FS typeL [4.2BSD] <enter> mount point: [none] /home <enter> > p m <enter> device: /dev/rwd0c type: ESDI disk: ESDI/IDE disk label: QUANTUM FIREBALL bytes/sector: 512 sectors/track: 63 tracks/cylinder: 15 sectors/cylinder: 945 cylinders: 16383 total sectors: 20480.0M free sectors: 0.0M rpm: 3600 16 partitions: # size offset fstype [fsize bsize cpg] a: 127.8M 0.0M 4.2BSD 2048 16384 16 # / b: 256.1M 127.8M swap c: 20480.0M 0.0M unused 0 0 d: 1023.9M 383.9M 4.2BSD 2048 16384 16 # /tmp e: 8192.2M 1407.8M 4.2BSD 2048 16384 16 # /var f: 2047.8M 9600.0M 4.2BSD 2048 16384 16 # /usr g: 8825.7M 11648.8M 4.2BSD 2048 16384 16 # /home > q Write new label?: [y] <enter> Mount point dan format system Mount point for wd0d (size=1048477k), none or done? [/tmp] <enter> Mount point for wd0e (size=8388765k), none or done? [/var] <enter> Mount point for wd0f (size=2096955k), none or done? [/usr] <enter> Mount point for wd0g (size=9037507k), none or done? [/home] <enter> Mount point for wd0d (size=1048477k), none or done? [/tmp] done <enter> No more disks to initialize. OpenBSD filesystems: wd0a / wd0d /tmp wd0e /var wd0f /usr wd0g /home The next step *DESTROYS* all existing data on these partitions! Are you really sure that you're ready to proceed? [no] y <enter> /dev/rwd0a: 261700 sectors in 277 cylinders of 15 tracks, 63 sectors 127.8MB in 1 cyl groups (288 c/g, 132.89MB/g, 17024 i/g) /dev/rwd0d: 2096952 sectors in 2219 cylinders of 15 tracks, 63 sectors 1023.9MB in 7 cyl groups (320 c/g, 147.66MB/g, 18944 i/g) /dev/rwd0e: 16777528 sectors in 17754 cylinders of 15 tracks, 63 sectors 8192.2MB in 56 cyl groups (320 c/g, 147.66MB/g, 18944 i/g) /dev/rwd0f: 4193908 sectors in 4438 cylinders of 15 tracks, 63 sectors 2047.8MB in 14 cyl groups (320 c/g, 147.66MB/g, 18944 i/g) /dev/rwd0g: 18075012 sectors in 19127 cylinders of 15 tracks, 63 sectors 8825.7MB in 60 cyl groups (328 c/g, 147.66MB/g, 18944 i/g) /dev/wd0a on /mnt type ffs (rw, asynchronous, local, ctime=Thu Oct 6 16:38:01 2 005) /dev/wd0g on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid, ctime=T hu Oct 6 16:38:01 2005) /dev/wd0d on /mnt/tmp type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Th u Oct 6 16:38:01 2005) /dev/wd0f on /mnt/usr type ffs (rw, asynchronous, local, nodev, ctime=Thu Oct 6 16:38:01 2005) /dev/wd0e on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Th u Oct 6 16:38:01 2005) Konfigurasi jaringan Enter system hostname (short form, e.g. 'foo'): fw <enter> Configure the network? [yes] <enter> Available interfaces are: sis0. Which one do you wish to initialize? (or 'done') [sis0] <enter> Symbolic (host) name for sis0? [fw] Enter IP address for sis0? (or 'dhcp') 192.168.0.254 <enter> Netmask? [255.255.255.0] <enter> No more interfaces to initalize. DNS domain name? (e.g. 'bar.com') [my.domain] example.or.id <enter> NS nameserver? (IP address or 'none') [none] 192.168.0.7 <enter> Use the nameserver now? [yes] <enter> Default route? (IP address, 'dhcp' or 'none') 192.168.0.1 <enter> add net default: gateway 192.168.0.1 Edit hosts with ed? [no] <enter> Do you want to do any manual network configuration? [no] <enter> Password for root account? (will not echo) pAssWOrd <enter> Password for root account? (again) pAssWOrd <enter> Instalasi base system dan set yang lain You will now specify the location and names of the install sets you want to load. You will be able to repeat this step until all of your sets have been successfully loaded. If you are not sure what sets to install, refer to the installation notes for details on the contents of each. Sets can be located on a (m)ounted filesystem; a (c)drom, (d)isk or (t)ape device; or a (f)tp, (n)fs or (h)ttp server. Where are the install sets? c <enter> Available CD-ROMs are: cd0. Available CD-ROMs are: cd0. Which one contains the install media? (or 'done') [cd0] <enter> Pathname to the sets? (or 'done') [3.8/i386] <enter> The following sets are available. Enter a filename, 'all' to select all the sets, or 'done'. You may de-select a set by prepending a '-' to its name. [X] bsd [X] bsd.rd [ ] bsd.mp [X] base38.tgz [X] etc38.tgz [X] misc38.tgz [X] comp38.tgz [X] man38.tgz [X] game38.tgz [ ] xbase38.tgz [ ] xetc38.tgz [ ] xshare38.tgz [ ] xfont38.tgz [ ] xserv38.tgz File Name? (or 'done') [bsd.mp] -game38.tgz The following sets are available. Enter a filename, 'all' to select all the sets, or 'done'. You may de-select a set by prepending a '-' to its name. [X] bsd [X] bsd.rd [ ] bsd.mp [X] base38.tgz [X] etc38.tgz [X] misc38.tgz [X] comp38.tgz [X] man38.tgz [ ] game38.tgz [ ] xbase38.tgz [ ] xetc38.tgz [ ] xshare38.tgz [ ] xfont38.tgz [ ] xserv38.tgz File Name? (or 'done') [done] <enter> Ready to install sets? [yes] <enter> Getting bsd ... 100% |**************************************************| 5030 KB 00:05 Getting bsd.rd ... 100% |**************************************************| 4478 KB 00:05 Getting base38.tgz ... 100% |**************************************************| 34337 KB 00:43 Getting etc38.tgz ... 100% |**************************************************| 1636 KB 00:02 Getting misc38.tgz ... 100% |**************************************************| 2222 KB 00:02 Getting comp38.tgz ... 100% |**************************************************| 21606 KB 00:27 Getting man38.tgz ... 100% |**************************************************| 7199 KB 00:59 Sets can be located on a (m)ounted filesystem; a (c)drom, (d)isk or (t)ape device; or a (f)tp, (n)fs or (h)ttp server. Where are the install sets? (or 'done') [done] <enter> Start sshd(8) by default? [yes] <enter> Start ntpd(8) by default? [no] y <enter> Change the default console to com0? [no] <enter> Untuk timezone dapat dicocokan dengan waktu setempat Saving configuration files......done. Generating initial host.random file ......done. What timezone are you in? ('?' for list) [Canada/Mountain] ? <enter> Africa/ Chile/ GB-Eire Israel NZ-CHAT Turkey America/ Cuba GMT Jamaica Navajo UCT Antarctica/ EET GMT+0 Japan PRC US/ Arctic/ EST GMT-0 Kwajalein PST8PDT UTC Asia/ EST5EDT GMT0 Libya Pacific/ Universal Atlantic/ Egypt Greenwich MET Poland W-SU Australia/ Eire HST MST Portugal WET Brazil/ Etc/ Hongkong MST7MDT ROC Zulu CET Europe/ Iceland Mexico/ ROK posix/ CST6CDT Factory Indian/ Mideast/ Singapore posixrules Canada/ GB Iran NZ SystemV/ right/ What timezone are you in? ('?' for list) [Canada/Mountain] Asia <enter> What sub-timezone of 'Asia' are you in? ('?' for list) ? <enter> Aden Chungking Kamchatka Phnom_Penh Tbilisi Almaty Colombo Karchi Pontianak Tehran Amman Dacca Kashgar Pyongyang Tel_Aviv Anadyr Damascus Katmandu Qatar Thimbu Aqtau Dhaka Krasnoyarsk Qyzylorda Thimphu Aqtobe Dili Kuala_Lumpur Rangoon Tokyo Ashgabat Dubai Kuching Riyadh Ujung_Pandang Ashkhabad Dushanbe Kuwait Riyadh87 Ulaanbaatar Baghdad Gaza Macao Riyadh88 Ulan_Bator Bahrain Harbin Macau Riyadh89 Urumqi Baku Hong_Kong Magadan Saigon Vientiane Bangkok Hovd Makassar Sakhalin Vladivostok Beirut Irkutsk Manila Samarkand Yakutsk Bishkek Istanbul Muscat Seoul Yekaterinburg Brunei Jakarta Nicosia Shanghai Yerevan Calcutta Jayapura Novosibirsk Singapore Choibalsan Jerusalem Omsk Taipei Chongqing Kabul Oral Tashkent What sub-timezone of 'Asia' are you in? ('?' for list) ? Jakarta <enter> Setting local timezone to 'Asia/Jakarta'...done. Making all device nodes...done. Installing boot block... boot: /mnt/boot proto: /usr/mdec/biosboot device: /dev/rwd0c /usr/mdec/biosboot: entry point 0 proto bootblock size 512 /mnt/boot is 3 blocks x 16384 bytes fs block shift 2; part offset 63; inode block 120, offset 14248 using MBR partition 3: type 166 (0xa6) offset 63 (0x3f) done. CONGRATULATIONS! Your OpenBSD install has been successfully completed! To boot the new system, enter halt at the command prompt. Once the system has halted, reset the machine and boot from the disk. # halt <enter> syncing disks... done The operating system has halted. Please press any key to reboot. MultibootWindows → OpenBSD → FreeBSD atau Linux
Setting dan Konfigurasi/etc/rc.conf Post-InstallBerikut ini adalah hal-hal yang dilakukan sesudah proses Instalasi berhasil dilakukan.
Bagi yang baru menggunakan OpenBSD disarankan untuk memaca manual
Dianjurkan untuk tidak menggunakan user # vi /etc/group wheel:root,ayam,monyet,buaya,kuya #visudo %wheel ALL:ALL Artinya memberikan akses superuser kepada user-user yang termasuk ke dalam group SystemVersi
,------o-----------o----X 3.5 Stable | . . | . ,------o---------o----X 3.6 Stable | . | . . | . | . ,----o----------o--> 3.7 Stable | . | . | . . | . | . | . ,-----o--> 3.8 Stable | . | . | . | . | . | . | . | . -->3.5Rel----->3.6Rel----->3.7Rel----->3.8Rel----> Current
Merupakan versi terakhir dari OpenBSD. Versi -CURRENT adalah versi OpenBSD yang digunakan oleh para developer untuk menguji fitur-fitur baru, atau juga oleh para Administrator yang ingin ikut mencoba atau menguji fitur-fitur baru yang disediakan oleh OpenBSD. Jika anda tidak bisa bahasa C, Perl, Shell, tidak ingin melakukan
Sekali dalam beberapa hari, para developer me
Tiap 6 bulan,
Versi ini merupakan kelanjutan dari versi -RELEASE yang menyediakan perbaikan-perbaikan (jika ada), dari sisi . KernelDimana Ports dan PackagesAda dua metode yang disediakan untuk memudahkan proses instalasi dan pengaturan applikasi/software/program di OpenBSD (juga varian BSD yang lainnya)
Merupakan kumpulan file binari (hasil kompilasi) yang dibuat oleh para developer OpenBSD dengan menggunakan ports sebagai dasarnya. Jika anda membeli CD official OpenBSD, di dalamnya sudah disertakan package-package yang umumnya diperlukan. Biasanya ciri dari package di OpenBSD adalah file yang berekstensi # pkg_add -v packagenya.tgz Option # pkg_info Delete package # pkg_delete namapackage Selain itu kita juga dapat menginstall packages secara langsung dari internet. untuk csh, tcsh # setenv PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/3.8/packages/i386/ untuk ksh, bash # export PKG_PATH ftp://ftp.openbsd.org/pub/OpenBSD/3.8/packages/i386/ Contoh penggunaan # pkg_add ${PKG_PATH}gimp-1.2.5.tgz Agar dapat menginstall GIMP, kita juga perlu menginstall package-package lain, yang diperlukan agar GIMP dapat berfungsi dengan baik. Dan karena kita sudah mendefenisikan dimana lokasi package kita dengan cara di atas, maka perintah
# make search key=keyword # make fetch # make depends # make build # make install # make package # make clean sekaligus # make install clean UpdateRata-rata pengguna BSD sudah cukup akrab untuk mengupdate sistem mereka dengan menggunakan # pkg_add -v ftp://ftp.openbsd.org/pub/OpenBSD/3.8/packages/i386/cvsup-16.1h-no_x11.tgz Proses update yang akan kita lakukan dalam contoh ini adalah proses update dari versi -RELEASE ke versi -STABLE.
# Defaults that apply to all the collections *default release=cvs *default delete use-rel-suffix *default umask=002 *default host=anoncvs3.usa.openbsd.org *default base=/usr *default prefix=/usr *default tag=OPENBSD_3_8 #Repository yang tersedia #OpenBSD-all OpenBSD-src OpenBSD-ports #OpenBSD-www #OpenBSD-x11 #OpenBSD-xf4 Perhatikan bagian # cvsup -g -L 2 stable-supfile Perintah diatas akan melakukan proses update terhadap source tree KernelAplikasi tidak ada yang perlu di update # cd /usr/ports # ./out-of-date Make sure your ports tree is up-to-date Generating specs Checking new package names Recording old package names Showing discrepancies # Aplikasi ada yang perlu di update, berdasarkan susunan ports yang baru saja di fetch # ./out-of-date Make sure your ports tree is up-to-date Generating specs Checking new package names Recording old package names Showing discrepancies --- /tmp/outdated.dmwN17408/old Thu Aug 11 18:06:36 2005 +++ /tmp/outdated.dmwN17408/new Thu Aug 11 18:06:36 2005 @@ -1,9 +1,9 @@ -bash-3.0.16p0 -cvsup-16.1g-no_x11 -gettext-0.10.40p2 -libiconv-1.9.2 -lsof-4.69p0 -pico-4.9 -pine-4.62 -unzip-5.51 +bash-3.0.16p1 +cvsup-16.1h-no_x11 +gettext-0.10.40p3 +libiconv-1.9.2p1 +lsof-4.75 +pico-4.10 +pine-4.63 +unzip-5.52 zip-2.3p0 # # cp /bsd /bsd.old # cd /usr/src/sys/arch/i386/conf Tips : Untuk membuat kernel yang spesifik dengan hardware yang ada di box tersebut, selain dengan mengedit file /usr/src/sys/arch/i386/conf/GENERIC juga bisa menggunakan tool dmassage . Contoh penggunaan dmassage adalah sebagai berikut: # cd /usr/src/sys/arch/i386/conf/ # dmassage -s GENERIC >KERNELKU lanjutkan dengan # config KERNELKU Don't forget to run "make depend" If config tells you to make clean, do so before running make depend. [make clean && make depend] # cd /usr/src/sys/arch/i386/compile/GENERIC/ # make depend && make # cp /usr/src/sys/arch/i386/compile/GENERIC/bsd / Rebuilding the system# cd /usr/src # find . -type l -name obj | xargs rm # make cleandir # rm -rf /usr/obj/* # make obj # cd /usr/src/etc # make DESTDIR=/ distrib-dirs # cd /usr/src # make build DaemonDNSBind/NameddjbdnsSendmailApache / WebserverVirtual HostSSL# openssl genrsa -out /etc/ssl/private/server.key 1024 # openssl req -new -key /etc/ssl/private/server.key -out /etc/ssl/private/server.csr # openssl x509 -req -days 365 -in /etc/ssl/private/server.csr \ -signkey /etc/ssl/private/server.key -out /etc/ssl/server.crt File rc.conf httpd_flags="-DSSL" # for normal use: "" (or "-DSSL" after reading ssl(8)) Start Apache+SSL # apachectl startssl chrootPersiapan direktori untuk chroot, dengan catatan, webserver ini disiapkan untuk support PHP dan Perl # mkdir -p /var/www/var/db # mkdir -p /var/www/usr/bin # mkdir -p /var/www/usr/lib # mkdir -p /var/www/usr/libdata/perl5 # mkdir -p /var/www/usr/local/libdata/perl5 # mkdir -p /var/www/usr/libexec # mkdir -p /var/www/etc # mkdir -p /var/www/tmp # chmod a+w /var/www/tmp # chmod u+t /var/www/tmp Perl# cp /usr/bin/perl /var/www/usr/bin/ # cp /usr/lib/libc.so.34.1 /var/www/usr/lib/ # cp /usr/lib/libm.so.2.0 /var/www/usr/lib/ # cp /usr/lib/libperl.so.10.0 /var/www/usr/lib/ # cp /usr/lib/libutil.so.11.0 /var/www/usr/lib/ # cp /usr/libexec/ld.so /var/www/usr/libexec/ # cd /usr/libdata/perl5; tar cf - . | (cd /var/www/usr/libdata/perl5; tar xfBp -) # cd /usr/local/libdata/perl5; tar cf - . | (cd /var/www/usr/local/libdata/perl5; tar xfBp -) Untuk memeriksa apakah chroot berjalan dengan baik, install MovableType PHPDi dalam susunan ports OpenBSD terdapat dua macam versi PHP, yaitu PHP4 dan PHP5, dan rata-rata aplikasi web yang ada di ports yang menggunakan PHP, mensyaratkan untuk menggunakan PHP5. Karena itu disini juga akan digunakan PHP5. Kemungkinan masalah yang akan timbul adalah tidak kompatibelnya aplikasi web yang akan digunakan dengan PHP5. # cd /usr/ports/www/php5; make install clean Dengan metode instalasi di atas, secara default akan terinstall dua package yaitu php5-core dan php5-extension, seperti di bawah ini : php5-core-5.0.4p0 server-side HTML-embedded scripting language php5-extensions-5.0.4 informational package about PHP5 extensions Untuk mengaktifkan PHP di webserver, lakukan hal-hal berikut, seperti terdapat di post-message nya PORTS # /usr/local/sbin/phpxs -s pastikan baris berikut terdapat di dalam file /var/www/conf/httpd.conf AddType application/x-httpd-php .php Kopi file konfigurasi php (php.ini) dari direktori contoh # cp /usr/local/share/examples/php5/php.ini-recommended /var/www/conf/php.ini edit file php.ini pada bagian session.save_path = /tmp Kemudian restart apache nya # apachectl stop # apachectl startssl Catatan : karena kita menggunakan Apache dengan fitur SSL, kita tidak bisa langsung mengetikkan apachectl restart Lalu bagaimana jika seandainya kita ingin PHP nya support mysql ? PHP5 yang baru saja kita install, dipisahkan dalam beberapa extension, coba perhatikan extension-extension yang sudah di build begitu kita melakukan perintah make install clean tadi # ls /usr/ports/packages/i386/all/ | grep php5 php5-bz2-5.0.4.tgz php5-core-5.0.4p0.tgz php5-curl-5.0.4.tgz php5-dba-5.0.4.tgz php5-dbase-5.0.4.tgz php5-dbx-5.0.4.tgz php5-extensions-5.0.4.tgz php5-filepro-5.0.4.tgz php5-gd-5.0.4p1-no_x11.tgz php5-gmp-5.0.4.tgz php5-imap-5.0.4.tgz php5-ldap-5.0.4.tgz php5-mbstring-5.0.4.tgz php5-mcrypt-5.0.4.tgz php5-mhash-5.0.4.tgz php5-mysql-5.0.4.tgz php5-ncurses-5.0.4.tgz php5-odbc-5.0.4.tgz php5-pear-5.0.4.tgz php5-pgsql-5.0.4.tgz php5-shmop-5.0.4.tgz php5-snmp-5.0.4.tgz php5-soap-5.0.4.tgz php5-sqlite-5.0.4.tgz php5-sybase_ct-5.0.4.tgz php5-xmlrpc-5.0.4p0.tgz php5-xsl-5.0.4.tgz Jika kita ingin menambahkan ekstensi mysql, yang memungkinkan PHP5 untuk berinteraksi dengan MySQL, berarti kita harus menginstall dan mengaktifkan ekstensi PHP5-mysql # pkg_add -v /usr/ports/packages/i386/all/php5-mysql-5.0.4.tgz # /usr/local/sbin/phpxs -a mysql bash-3.00# cp jhead /var/www/usr/local/bin/ bash-3.00# ldd jhead jhead: Start End Type Ref Name 00000000 00000000 exe 1 jhead 03663000 2366a000 rlib 1 /usr/lib/libm.so.2.0 08914000 2894c000 rlib 1 /usr/lib/libc.so.34.1 0c0ec000 0c0ec000 rtld 1 /usr/libexec/ld.so bash-3.00# cp /usr/lib/libm.so.2.0 bash-3.00# cp /usr/lib/libm.so.2.0 /var/www/usr/lib/ bash-3.00# cp /usr/libexec/ld.so /var/www/usr/libe bash-3.00# mkdir /var/www/usr/libexec bash-3.00# cp /usr/libexec/ld.so /var/www/usr/libexec/ bash-3.00# history | grep sysctl 2078 sysctl kern.emul.freebsd=1 2126 history | grep sysctl bash-3.00# sysctl kern.emul.freebsd=0 kern.emul.freebsd: 1 -> 0 bash-3.00# Untuk memeriksa apakah chroot berjalan dengan baik, install Gallery Caching/ProxySquidInstall Squid #cd /usr/ports/www/squid #env FLAVOR=transparent make install #addgroup -gid _squid #vipw _squid:*:uid:gid::0:0:Squid Daemon:/var/empty:/sbin/nologin Konfigurasi squid #vi /var/squid/etc/squid.conf http_port 3128 http_access deny to_localhost acl our_networks src 192.168.0.0/24 http_access allow our_networks cache_effective_user _squid cache_effective_group _squid cache_dir ufs /var/log/squid/cache 15360 16 256 cache_access_log /dev/null cache_log /dev/null cache_store_log none httpd_accel_host virtual httpd_accel_port 80 httpd_accel_with_proxy on httpd_accel_uses_host_header on Setting permission dari direktori log squid #mkdir -p /var/log/squid /var/log/squid/logs /var/log/squid/cache #chown _squid:_squid /var/log/squid Jalankan squid dengan membentuk file swap terlebih dahulu #squid -z, dan jalankan squid #squid -sYD Transparent ProxyUntuk melakukan setting transparent proxy, pertama-tama adalah mengenablekan pf,edit /etc/rc.conf #vi /etc/rc.conf pf=YES edit /etc/pf.conf #vi /etc/pf.conf #macros #interface ext_if0="rl0" int_if1="rl1" int_ip="192.168.0.1/32" nat on $ext_if0 from !($ext_if0) -> ($ext_if0:0) rdr pass on $int_if1 proto tcp to port 80 -> $int_ip port 3128 FTP ServerAnonymous FTP# adduser Use option ``-silent'' if you don't want to see all warnings and questions. Reading /etc/shells Reading /etc/login.conf Check /etc/master.passwd Check /etc/group Ok, let's go. Don't worry about mistakes. I will give you the chance later to correct any input. Enter username []: ftp Enter full name []: anonymous ftp Enter shell csh false ksh nologin sh tcsh zsh [sh]: false Uid [1002]: Enter Login group ftp [ftp]: Enter Login group is ``ftp''. Invite ftp into other groups: guest no [no]: no Login class auth-defaults auth-ftp-defaults daemon default staff [default]: Enter Enter password []: Enter Set the password so that user cannot logon? (y/n) [n]: y Name: ftp Password: **** Fullname: anonymous ftp Uid: 1002 Gid: 1002 (ftp) Groups: ftp Login Class: default HOME: /home/ftp Shell: /usr/bin/false OK? (y/n) [y]: y Added user ``ftp'' Copy files from /etc/skel to /home/ftp Add another user? (y/n) [y]: n Goodbye! FTP-only UserTambahkan baris berikut di file /etc/shells /usr/bin/false Gunakan /usr/bin/false sebagai shell dari user yang hanya diizinkan untuk menggunakan FTP File & Print ServicesSambaNFSAFSDatabaseMySQL# pkg_add -v ftp://ftp.openbsd.org/pub/OpenBSD/3.8/packages/i386/mysql-server-4.0.24p1.tgz Adding ftp://ftp.openbsd.org/pub/OpenBSD/3.8/packages/i386/mysql-server-4.0.24p1.tgz Dependencies for mysql-server-4.0.24p1 resolve to: mysql-client-4.0.24,p5-DBD-mysql-3.0002 (todo: mysql-client-4.0.24,p5-DBD-mysql-3.0002) Adding mysql-client-4.0.24 Adding p5-DBD-mysql-3.0002 Dependencies for p5-DBD-mysql-3.0002 resolve to: p5-DBI-1.43,mysql-client-4.0.24 (todo: p5-DBI-1.45p1) Adding p5-DBI-1.45p1 Dependencies for p5-DBI-1.45p1 resolve to: p5-PlRPC-0.2018 (todo: p5-PlRPC-0.2018) Adding p5-PlRPC-0.2018 Dependencies for p5-PlRPC-0.2018 resolve to: p5-Net-Daemon-0.38 (todo: p5-Net-Daemon-0.38) Adding p5-Net-Daemon-0.38 ===> Creating _mysql group for MySQL ===> Creating _mysql user for MySQL Preparing db table Preparing host table Preparing user table Preparing func table Preparing tables_priv table Preparing columns_priv table Installing all prepared tables 050402 6:14:07 /usr/local/libexec/mysqld: Shutdown Complete # /usr/local/bin/mysqladmin -u root password 'new-password' # /usr/local/bin/mysqladmin -u root -h obsd3.securemarmot.com password 'new-password' # /usr/local/bin/mysqld_safe & [1] 5452 # Starting mysqld daemon with databases from /var/mysql Agar mysql bisa diakses dari aplikasi web yang menggunakan sistem chroot, perlu ditambahkan : file /etc/rc.local if [ -x /usr/local/bin/mysqld_safe ]; then echo -n " mysqld" /usr/local/bin/mysqld_safe --user=_mysql --log=/var/log/mysqld sleep 4 rm -f /var/www/var/run/mysql/mysql.sock ln /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock fi PostgreSQLX-WindowsKDE# pkg_add -v kdebase-3.4.tgz KDM# /usr/local/bin/genkdmconf PWMNetworkFirewallContoh pf.conf from phoenix contoh sederhana pf.conf Bandwith LimiterIPV6NTP (Network Time Protocl)Server# vi /etc/ntpd.conf # $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $ # sample ntpd configuration file, see ntpd.conf(5) # Addresses to listen on (ntpd does not listen by default) #listen on * listen on ::1 # sync to a single server #server ntp.example.org # use a random selection of 8 public stratum 2 servers # see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers servers pool.ntp.org # vi /etc/rc.conf.local ntpd_flags= # enabled during install Unix Client# vi /etc/ntpd.conf # $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $ # sample ntpd configuration file, see ntpd.conf(5) # Addresses to listen on (ntpd does not listen by default) #listen on * # sync to a single server #server ntp.example.org server 192.168.1.20 # use a random selection of 8 public stratum 2 servers # see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers #servers pool.ntp.org # vi /etc/rc.conf.local ntpd_flags= # enabled during install Windows ClientC:\>net time /setsntp:192.168.1.20 The command completed successfully. C:\>net stop w32time The Windows Time service is stopping. The Windows Time service was stopped successfully. C:\>net start w32time The Windows Time service is starting. The Windows Time service was started successfully. C:\>net time /querysntp The current SNTP value is: 192.168.1.20 The command completed successfully. Check konfigurasi $ grep ntpd daemon May 22 17:23:15 obsd3 ntpd[29943]: adjusting local clock by 0.175522s May 22 18:44:44 obsd3 ntpd[14662]: adjusting local clock by 0.184475s May 22 19:42:26 obsd3 ntpd[14662]: adjusting local clock by 0.159438s May 22 23:08:08 obsd3 ntpd[14662]: adjusting local clock by 0.185314s May 23 00:19:29 obsd3 ntpd[14662]: adjusting local clock by 0.158105s May 23 17:55:48 obsd3 ntpd[31680]: adjusting local clock by -0.921275s May 23 17:59:07 obsd3 ntpd[31680]: adjusting local clock by -0.778339s May 23 18:01:12 obsd3 ntpd[31680]: adjusting local clock by -0.297160s etc... Filosofi
— Hengky Anwar 2005/06/11 03:20 |
Articles >