Selasa, 10 Maret 2009

INSTALASI SERVER LTSP di CENTOS 5

Instalasi & Configurasi LTSP ( Linux Terminal Server Project )

  • Sistem operasi: Centos 5.2

  • Terminal server: LTSP 4.2u2


Download LTSP iso File

Download file LTSP iso (ltsp-4.2u2.iso) dari http://ltsp.mirrors.tds.net/pub/ltsp/isos/ atau di http://www.ltsp.org dan taruh di /download/ltsp direktori.

Silakan pakai cara anda sendiri bagaimana mendapatkan LTSP iso file. Tujuan utamanya adalah menaruh file-nya di /download/ltsp direktori.

Mount LTSP iso Image

Mount LTSP iso image file ke /mnt/ltsp direktori.

# mkdir -p /mnt/ltsp

# cd /download/

# mount -o loop ltsp-4.2u2.iso /mnt/ltsp

Instal ltsp-utils Paket

# cd /mnt/ltsp

# rpm -ivh ltsp-utils-0.25-0.noarch.rpm

Jalankan ltspadmin

# ltspadmin





Pilih Configure the Installer Options

Di layar berikutnya “Where to retrieve packages from?”, masukkan “file:///mnt”. Jangan lupa bahwa garis miring-nya ada tiga bukan dua setelah file:///.

Di pertanyaan berikutnya “In which directory would you like to place the LTSP client tree?”, tekan yang berarti memilih lokasi default-nya, /opt/ltsp. Di pertanyaan berikutnya “If you want to use an HTTP proxy”, pilih “none” dan tekan . Pilih yang sama, “none”, untuk pertanyaan “If you want to use an FTP proxy”. Setelah itu pilih “y” saat ditanya “Correct?”.


Di layar berikutnya, pilih semua komponen dengan menekan “A” kemudian pilih “Q”. Tekan “y” dan saat ditanya “Ready to install/update the selected LTSP packages?”.


Di monitor anda akan melihat paket-paket ltsp-nya terinstal. Tunggu beberapa saat sebelum melanjutkan ke langkah berikutnya. Tekan bila instalasinya sudah selesai.


Konfigurasi LTSP

klik ENTER di tab configure LTSP

klik ENTER untuk melihat menu konfigurasi



S : melihat status services yang sudah berjalan atau belum

C : melakukan konfigurasi manual, sesuai dengan kebutuhannya.

Pilihlah C untuk melakukan konfigurasinya secara manual.

Lakukan prosedur standar dari point 1 sampai point 11, bila sudah selesai klik Q untuk keluar dari LTSP.

Nantinya akan terlihat service mana saja yang sudah berjalan.



Wah...DHCP services belum berjalan, lakukan agar services DHCP bisa berjalan saat booting

# vi /etc/rc.d/rc.local

========================

#!/bin/sh 

#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local

#DHCP biar nyala trus aach!!!

/etc/init.d/dhcpd start

[ESC] :wq

buat lah perintah didalam /etc/rc.d/rc.local/ agar services DHCP selalu berjalan saat komputer booting

Konfigurasi LTSP

# etc/dhcpd.conf

Edit file DHCP.conf.default menjadi dhcp.conf, buatlah konfigurasi sesuai yang dibutuhkan.

Contoh :



Melihat konfigurasi hosts didalam /etc/hosts

# vi /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost localhost.localdomain ramayana_test tester

172.16.4.48 ramayana_tester

172.16.4.1 ws001

172.16.4.2 ws002

172.16.4.3 ws003

172.16.4.4 ws004

172.16.4.5 ws005

## LTSP-begin ##

#

# The lines between 'LTSP-begin' and 'LTSP-end' were added

# on: Mon Jul 23 13:03:53 2007, by the ltspcfg configuration tool.

# For more information, visit the LTSP homepage

# at http://www.LTSP.org


Konfigurasi /etc/hosts.allow

Konfigurasi etc/exports



Konfigurasi didalam /opt/ltsp/i386/etc/lts.conf


NB : Perangkat keras yang dipakai untuk klien LTSP sangat dianjurkan pakai kartu jaringan yang mendukung PXE (Preboot eXecution Environment), bila memungkinkan, lakukan instalasi manual driver kartu jaringan didalam kernel linux. Lakukan konfigurasi manual di dalam /tftpboot/lts


*UPGRADE KERNEL LTSP*

Pemilihan kernel pada linux memungkinkan LTSP bisa berjalan dengan baik, dengan berkembangnya teknologi di indonesia maka type hardware pun akan berubah mengikuti jaman lah..

:-P

Biasanya hanya type NIC yang belum kompetibel dengan LTSP, karena itu disarankan untuk mengupgrade kernel linux.

Disini dipakai linux kernel 2.6.22.4.tar.gz, gunakan kernel diatas dari linux standarnya, lakukan extract kernel :

# tar zxvf linux-2.6.22.4.tar.gz

# cd linux-2.6.22.4

lakukan make oldconfig untuk melakukan manual edit pada kernel, atau make menuconfig untuk pilihan-pilihannya, banyak pilihan cara instalasinya, baca manual instalasi.

Bila sudah selesai, save .config nya, lakukan make dan make install , bila melakukan instalasi dengan modules, lakukan make modules_install

lakukan restart komputer bila instalasi telah selesai. :-)

Saat linux booting untuk pertama, pilih kernel yang barusan di install yaitu linux-2.6.29.4, login dan lakukan instalasi ulang LTSP nya didalam kernel yang baru.


Instalasi Linux Kernel Kit

Download paket Linux Kernel Kit

lakukan instalasi kernel kit :

# tar zxvf ltsp_kernel_kit.4.2u3.tgz

masuk kedalam direktori ltsp_kernel_kit

# cd ltsp_kernel_kit

lakukan instalasi build initramfs standar pilihan direktori ltsp.

# ./build_initramfs

[root@tester ltsp_kernel_kit]# ./build_initramfs

Preparing kernel, modules and initramfs for LTSP

Kernel source directory [/usr/src/linux-2.6.17.8]: /usr/local/src/linux-2.6.22.9 ← letak directory extract linux kernel yang baru

Location of LTSP tree [/opt/ltsp]: ← lokasi instalasi LTSP (Default)

Location of TFTP directory [/tftpboot/lts]: ← (Default)

#####################################################################

/usr/local/src/linux-2.6.22.9/arch/i386/boot/bzImage



936 blocks

Copying the kernel net modules

44581 blocks

Copying the kernel lib modules

find ./kernel/lib -print | cpio -pmud /tmp/initramfs.d/lib/modules/2.6.22.9/

731 blocks

depmod -e -a -F /usr/local/src/linux-2.6.22.9/System.map -b /tmp/initramfs.d 2.6.22.9

cpio'ing and gzipping the initramfs tree

46547 blocks

mknbi-linux not installed!

An Etherboot compatible kernel will not be generated

CURDIR=/usr/local/src/ltsp_kernel_kit

KERNEL_VER=2.6.22.9

Copying the PXE kernel to /tftpboot/lts

/tftpboot/lts/./2.6.22.9

/tftpboot/lts/./2.6.22.9/pxelinux.cfg

/tftpboot/lts/./2.6.22.9/pxelinux.cfg/default

/tftpboot/lts/./2.6.22.9/bzImage-2.6.22.9

/tftpboot/lts/./2.6.22.9/pxelinux.0

/tftpboot/lts/./2.6.22.9/initramfs.gz

23624 blocks

Installing the kernel modules

Building the LTSP modules.dep file...

depmod -e -a -F /usr/local/src/linux-2.6.22.9/System.map -b /opt/ltsp/i386 2.6.22.9

LTSP_TREE=/opt/ltsp

finished !



Bila sudah lakukan reboot komputer... !!!


Booting dari kernel yang terbaru diinstall, misalkan linux-2.6.22.9 ← pilihlah saat booting kernel, didalam kernel ini kita lakukan instalasi manual kembali kernel ltsp nya, yaitu ltsp_kernel_kit

lakukan ./build_initramfs kembali, biarkan sampai selesai... !!

restart kembali ke kernel default...


Instalasi NIC yang belum kompetibel dengan LTSP

Install dahulu driver nic yang sudah dibutuhkan, misalnya driver RTL8111b/8111c Realtek, type ini masih belum kompetibel dengan LTSP,

contoh :

# tar zxvf r8168-8.010.00.tar.gz

# cd r8168-8.010.00

# make clean modules

# modinfo src/r8168.ko

# make install

# depmod -a

# modprobe r8168

Cek kembali instalasi driver NIC sudah ada atau belum..

# lsmod | grep r8168

Bila driver NIC sudah selesai diinstall, lakukan editing pada direktori /tftpboot/lts

# vi /tftpboot/lts/2.6.22.9/pxelinux.cfg/default

tambahkan konfigurasinya NIC didalamnya...

prompt 0

label linux

kernel bzImage-2.6.22.9

append rw root=/dev/ram0 initrd=initramfs.gz NIC=r8168

:wq

Setelah disimpan, lakukan pengecekan ulang services pada sistem ltsp seperti : DHCP, TFTP, NFS, XDMCP, PORTMAP dll yang menunjang LTSP agar berjalan saat komputer direstart ulang.. :D

Lakukan pengecekan kembali bila Client masih terjadi error,

contoh : DHCP failed....!!

  • cek kembali settingan dhcpd.conf nya..!!

  • periksa alamat mac address client sudah benar atau belum..

  • cek filename didalam client diarahkan ke direktori mana..??

# kernels are specified in /tftpboot/lts/boot/pxe/pxelinux.cfg/

filename "/lts/pxe/pxelinux.0"; ← didalam direktori /tftpboot/lts/

  • lakukan restart service dhcp



contoh : failed to mount the root directory via NFS possible maybe include :

  • NFS maybe not running

  • workstation does not map to a hostname,

  • wrong address for NFS server

  • wrong pathname for root directory in the DHCP config file



  • cek pada service NFS, NFSLOCK, PORTMAP, RPCIDMAPD, RPCGSSD, RPCSVCGSSD

  • lakukan restart ulang pada setiap service tersebut :

/etc/init.d/nfs status

/etc/init.d/nfs stop

/etc/init.d/nfslock stop

/etc/init.d/nfs start

/etc/init.d/nfslock start

# /etc/init.d/nfs start

# /etc/init.d/portmap stop

# /etc/init.d/portmap start

# /etc/init.d/nfs stop

# /etc/init.d/nfslock stop

# /etc/init.d/portmap stop

# /etc/init.d/rpcidmapd start

# /etc/init.d/rpcgssd stop

# /etc/init.d/rpcsvcgssd status

# /etc/init.d/rpcsvcgssd star

# /etc/init.d/rpcgssd start

# /etc/init.d/rpcidmapd start

bash -x /etc/init.d/rpcidmapd

# /etc/init.d/rpcidmapd stop

# /etc/init.d/rpcidmapd start

  • lakukan pengecekan kernel dengan modinfo sunrpc



!!!!! Selesai !!!!!



Selasa, 03 Maret 2009

Installation PHP & Apache Compatibility

1. gzip -d httpd-2_0_xx.tar.gz
2. tar xvf httpd-2_0_xx.tar
3. gunzip php-xx.tar.gz
4. tar -xvf php-xx.tar
5. cd httpd-2_0_xx
6. ./configure --enable-so
7. make
8. make install

  Now you have Apache 2.0.xx  available under /usr/local/apache2,
  configured with loadable module support and the standard MPM prefork.
  To test the installation use your normal procedure for starting
  the Apache server, e.g.:
  /usr/local/apache2/bin/apachectl start
  and stop the server to go on with the configuration for PHP:
  /usr/local/apache2/bin/apachectl stop.

9. cd ../php-xx

10. Now, configure your PHP. This is where you customize your PHP
  with various options, like which extensions will be enabled. Do a
  ./configure --help for a list of available options. In our example
  we'll do a simple configure with Apache 2 and MySQL support. Your
  path to apxs may differ, in fact, the binary may even be named apxs2 on
  your system. 
   
  ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql

11. make
12. make install

  If you decide to change your configure options after installation,
  you only need to repeat the last three steps. You only need to
  restart apache for the new module to take effect. A recompile of
  Apache is not needed.
   
  Note that unless told otherwise, 'make install' will also install PEAR,
  various PHP tools such as phpize, install the PHP CLI, and more.
   
13. Setup your php.ini 
   
  cp php.ini-dist /usr/local/lib/php.ini
   
  You may edit your .ini file to set PHP options. If you prefer having
  php.ini in another location, use --with-config-file-path=/some/path in
  step 10.
   
  If you instead choose php.ini-recommended, be certain to read the list
  of changes within, as they affect how PHP behaves.

14. Edit your httpd.conf to load the PHP module. The path on the right hand
  side of the LoadModule statement must point to the path of the PHP
  module on your system. The make install from above may have already
  added this for you, but be sure to check.

  For PHP 4:
  
  LoadModule php4_module modules/libphp4.so
   
  For PHP 5:
   
  LoadModule php5_module modules/libphp5.so
 
15. Tell Apache to parse certain extensions as PHP. For example, let's have
  Apache parse .php files as PHP. Instead of only using the Apache AddType
  directive, we want to avoid potentially dangerous uploads and created
  files such as exploit.php.jpg from being executed as PHP. Using this
  example, you could have any extension(s) parse as PHP by simply adding
  them. We'll add .phtml to demonstrate.
   
 
  SetHandler application/x-httpd-php
 


  Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and
  .phtml files to be executed as PHP, but nothing else, we'd use this:

 
  SetHandler application/x-httpd-php
 

   
  And to allow .phps files to be executed as PHP source files, add this:

 
  SetHandler application/x-httpd-php-source
 


16. Use your normal procedure for starting the Apache server, e.g.:
   
  /usr/local/apache2/bin/apachectl start

  - OR -

  service httpd restart