Beyaz.Net İpucu

KATEGORİLER

Genel
FreeBSD
Debian
Ubuntu

Debian Kurulum Squezee


# Lenny'e gore farklılıklar ekleniyor. Daha sonra temize cekilecek

DEBIAN SQUEEZE KURULUM NOTLARI
------------------------------


-----------------------------------------------
Temel Kurulum ve İlk Açılışta Yapılacak Ayarlar
-----------------------------------------------
Netinstall CD'si ile kurulum yap
Kuruluma başlamadan önce CD'nin MD5 kontrolunu yap
Türkçe kurulumda problem var
    Expert Install
    Select a language        : English
    Select your location        : other -> Asia -> Turkey
    Configure locales        : United States en_US.UTF-8
    Additional locales        : tr_TR.UTF-8
    System Locale            : en_US.UTF-8
    Select a keyboard layout    : PC-style -> Turkish (Q layout)
    Configure the network        : Özel bi durum olmadıkça DHCP kulan, sabit IP adresi alacak makineleri DHCP sunucudan ayarla
                      DNS ayarlamak gerekirse, aşağıdakiler kullanılabilir
                      208.67.222.222    OpenDNS
                      208.67.220.220    OpenDNS
                      8.8.8.8        Google
                      8.8.4.4        Google
    Configure the clock (time zone)    : Europe+Istanbul
    Partitition disks        : Manual
                      Dosya sistemleri ext4
                      örnek bölümlendirme
                      +        500 MB sda1    (bootable)
                      +usr       5 GB sda5    (default kurulumda 3 GB altında)
                      +var       5 GB sda6    (default kurulumda 2 GB altında. Veritabanı, proxy sunucu vs. olacaksa büyük tut)
                      +tmp     500 MB sda7    (tmpfs de yapılabilir)
                      swap       1 GB sda9    (hibernate yapılacaksa mevcut RAM'den biraz büyük seçilebilir.     )
                      +home      X GB sda8

                      USB stick kurulumları için örnek bölümlendirme
                      +boot    100 MB sda1    (bootable) (ISO'dan boot olacaksa ext2, 500 MB)
                      crypt    XXX MB sda2    (şifrelenmiş bölüm)
                      +        XXX MB +dev+mapper+sda2_crypt
    Hiçbir depoyu ekleme. Sonra elle eklenecek
    OpenSSH sunucu ve Standart paketleri seç


. APT ayarları
    . +etc+apt+sources.list
        deb     http:++ftp.us.debian.org+debian+            squeeze          main
        deb-src http:++ftp.us.debian.org+debian+            squeeze          main
        deb     http:++security.debian.org+                 squeeze+updates  main
        deb-src http:++security.debian.org+                 squeeze+updates  main

    . +etc+apt+apt.conf.d+80recommends
        APT::Install-Recommends "0";
        APT::Install-Suggests "0";

    . ilk güncelleme
        aptitude update && aptitude -dy full-upgrade && aptitude autoclean && aptitude full-upgrade && aptitude purge ˜c

    . ilk kurulacak paketler
        aptitude install vim screen less

        "Vim Kullanım Notları" bölümünde anlatıldığı gibi kullanıcı ve root için .vimrc oluşturulacak.
        NERD_tree kurulacak
        http:++emrah.com+notlar+vim_kullanim_notlari.txt

        "Screen Notları" bölümünde anlatıldığı gibi +etc+screenrc dosyası düzenlenecek
        http:++emrah.com+notlar+screen_notlari.txt

    . ilk silinecek paketler
        aptitude purge tasksel tasksel-data installation-report laptop-detect nano

        Bu paketler var mı diye de kontrol et; varsa standart kurulun için silinebilir
        aptitude purge portmap nfs-common bsd-mailx exim4-daemon-light exim4-base mutt urlview procmail manpages-tr


. Grub ayarları
    . Grub güncellemelerinde diğer sistemlerin otomatik bulunması isteniyorsa
        aptitude install os-prober

    . +etc+default+grub
        GRUB_TIMEOUT=2
        GRUB_CMDLINE_LINUX="ipv6.disable=1"    # ipv6 şart değilse kullanılmayacak
        GRUB_GFXMODE=1024x768

    . +etc+grub.d+00_header
        set gfxmode=$
        set gfxpayload=keep

    . Grub için parola
      Sadece default ayarlar değiştirilmek istenirse sorulacak

        grub-mkpasswd-pbkdf2 >>+etc+grub.d+01_password
        iki kere parola girilecek, görüntü gelmeyecek

        +etc+grub.d+01_password
            #!+bin+sh
            # parola grub-mkpasswd-pbkdf2 komutu ile üretiliyor
            cat <<EOF
            set superusers="emrah"
            password_pbkdf2 emrah grub.pbkdf2.sha512.10000.596F22EFFB36830CAF9C22B.....
            EOF


    . ipv6 iptali ile ilgili not:
      +etc+sysctl.d+bindv6only.conf dosyası varsa
        # bind icin ipv6 olmayacak
        #net.ipv6.bindv6only = 1


. DHCP ayarları
  Mümkün olduğunca DHCP istemci kullanılacak.
  Statik IP adresleri, DHCP sunucudan MAC adresine göre ayarlanacak
  DHCP sunucunun gönderdiği DNS adresleri sorunlu ise ve DHCP sunucudan değiştirilemiyorsa:
    . +etc+dhcp+dhclient-enter-hooks.d+nodnsupdate
        #!+bin+sh
        make_resolv_conf(){
            :
        }

    . dosya çalıştırılabilir
      chmod +x +etc+dhcp+dhclient-enter-hooks.d+nodnsupdate

    . +etc+resolv.conf
        nameserver 208.67.222.222
        nameserver 208.67.220.220


. fstab ayarları
  UUID kullanılacak, noatime eklenecek
    . +etc+fstab
        # <file system>                           <mount point>   <type>      <options>                  <dump> <pass>
        proc                                      +proc           proc        defaults                   0      0
        UUID=c0328107-dc56-4398-73fe-0b3ae8a2a111 +               ext4        noatime,errors=remount-ro  0      1
        UUID=9132811f-1c54-43cb-7380-1436c8b2a7ee +home           ext4        defaults,noatime           0      2
        UUID=ff3281b4-cc55-43b5-7376-ec3bd3b2a032 +tmp            ext4        defaults,noatime           0      2
        UUID=e3328141-6c5f-4329-731c-ce37e072aae1 +usr            ext4        defaults,noatime           0      2
        UUID=0032812f-3c5e-438e-73bd-4036eb32af72 +var            ext4        defaults,noatime           0      2
        UUID=a93281aa-ac51-4378-7379-2a32be02ac0d none            swap        sw                         0      0
        +dev+scd0                                 +media+cdrom0   udf,iso9660 user,noauto                0      0
        +dev+fd0                                  +media+floppy0  auto        rw,user,noauto             0      0

        # USB stick kurulumları icin fstab
        # <file system>                           <mount point>    <type>      <options>                             <d> <p>
        proc                                      +proc            proc        defaults                              0    0
        +dev+mapper+sda2_crypt                    +                ext4        noatime,errors=remount-ro             0    1
        UUID=47f8bc94-a5e4-2c21-b544-4c75aff4a3e6 +boot            ext4        noatime                               0    2
        +dev+scd0                                 +media+cdrom0    udf,iso9660 user,noauto                           0    0
        tmpfs                                     +tmp             tmpfs       defaults,noatime,mode=1777,size=100M  0    0
        tmpfs                                     +var+tmp         tmpfs       defaults,noatime,mode=1777,size=100M  0    0
        tmpfs                                     +var+log         tmpfs       defaults,noatime,mode=0755,size=100M  0    0
        tmpfs                                     +var+run         tmpfs       defaults,noatime,mode=0755,size=10M   0    0
        tmpfs                                     +var+lock        tmpfs       defaults,noatime,mode=1777,size=10M   0    0
        tmpfs                                     +etc+network+run tmpfs       defaults,noatime,size=1M              0    0
        tmpfs                                     +var+lib+dhcp    tmpfs       defaults,noatime,size=1M              0    0


. Kullanılmayacak moduller yüklenmesin
    . +etc+modprobe.d+blacklist.conf
        # speaker modulu iptal
        blacklist pcspkr


. OpenSSH Server ayarları
    . +etc+ssh+sshd_config
        Port 22                    # standart port kullanilmayacak
        PermitRootLogin    no
        AllowUsers kullanici1 kullanici2
        PasswordAuthentication no        # sadece key ile baglanmaya izin verilecekse


. Terminal sayısını azalt
  Sunucu değilse CTRL-ALT-DEL resetlemesin, makineyi kapatsın
    . +etc+inittab
        # CTRL-ALT-DEL ile sistem kapatilacaksa ('-t1' -> '-t5' ve '-r' -> '-h')
        ca:12345:ctrlaltdel:+sbin+shutdown -t5 -a -h now

        #3:23:respawn:+sbin+getty 38400 tty3
        #4:23:respawn:+sbin+getty 38400 tty4
        #5:23:respawn:+sbin+getty 38400 tty5
        #6:23:respawn:+sbin+getty 38400 tty6


. yeniden başlatma
    . normal kurulum için
        reboot

    . USB stick kurulumları için
        rm -rf +var+tmp+* +tmp+* +var+log+* +var+run+* +var+lock+* +etc+network+run+* +var+lib+dhcp+*; sync; reboot



-----------------------------------------------
Paketlerin Kurulumu
-----------------------------------------------
. python (temel) paketleri
    aptitude install python ipython
 
. monitoring paketleri
    aptitude install htop iotop bmon bwm-ng smartmontools

. network paketleri
    aptitude install fping arping nmap whois tcpdump curl dnsutils

. sürücüler
  USB stick kurulumları için wireless+ethernet sürücülerinin hepsi olsun
  Diğer makinelerde sadece gereken sürücüler olsun
    aptitude install firmware-linux-free
    #aptitude install firmware-linux-nonfree atmel-firmware firmware-ipw2x00    # non-free depo
    #aptitude install firmware-iwlwifi firmware-ralink firmware-realtek        # non-free depo

. wireless
  USB stick kurulumlarında wireless araçları olsun
  Diğer makinelerde wireless adaptör varsa olsun
    aptitude install wicd-curses wicd-cli

. dosyalar, dosya sistemi, uzaktan dosya sistemlerine erişim ile ilgili paketler
    aptitude install bzip2 zip unzip patch diff tree
    aptitude install ncftp sshfs rsync
    aptitude install ntfsprogs ntfs-3g
    aptitude install cryptsetup

. CD+DVD paketleri
    aptitude install wodim dvd+rw-tools

. Programlama paketleri
    aptitude install git bouml                # versiyon kontrol sistemi ve uml
    aptitude install python-nose                # unittest
    aptitude install python-pysqlite2 sqlite3        # SQLite kullanılacaksa
    aptitude install python-mysqldb                # MySQL kullanılacaksa
    aptitude install python-psycopg2            # PostgreSQL kullanılacaksa
    aptitude install python-serial python-parallel        # Seri ve parallel portan haberleşme için
    aptitude install php5-cli                # komut satırından PHP


. Masaüstü paketleri
    aptitude install xorg openbox menu
    aptitude install rxvt-unicode xtrlock unclutter numlockx && aptitude purge xterm
    #aptitude install conky-std                # contrib depoda oldugu icin default kuruluma alinmadi
    aptitude install alsa-base alsa-utils mplayer smplayer
    aptitude install epdfview iceweasel xul-ext-noscript iceweasel-vimperator weechat-curses weechat-plugins
    aptitude install flashplugin-nonfree            # contrib depoda
    aptitude install x11vnc xvnc4viewer rdesktop
    aptitude install zenity                    # checkPOP3 kullanilacaksa...

. Programlama (masaüstü) paketleri
    aptitude install gitk
    aptitude install python-qt4 pyqt4-dev-tools qt4-designer

. kernel
  USB stick kurulumlarında alternatif kernel yükle
    aptitude install linux-image-2.6-486
    aptitude install linux-headers-2.6-486

. Sanal makine paketleri
    aptitude install virtualbox-ose virtualbox-ose-dkms virtualbox-ose-qt linux-headers-$(uname -r)
    #aptitude install virtualbox-guest-additions        # non-free depoda olduğu için default kuruluma alinmadi

. Debian kaynak kod paketleri ile çalışılacaksa
    aptitude install dpkg-dev build-essential fakeroot



-----------------------------------------------
Konsolda Yapılacak Ayarlar
-----------------------------------------------
. locales
  Yerelin nasıl ayarlanacağına henüz karar verilmedi
  Sistem geneli için "en_US.UTF-8" default olarak seçilip kullanıcılar için "tr_TR.UTF-8" seçilebilir.
  Sistem geneli için "tr_TR.UTF-8" kullanmak riskli görünüyor.
  Dökümana göre yapılan kurulumda zaten bu haliyle geldiğinden, aşağıdaki komutu uygulamaya gerek yok. Ek bilgi olsun diye...

    dpkg-reconfigure locales
        . en_US.UTF-8 ve tr_TR.UTF-8 ekli olacak
        . sistem defaultu en_US.UTF-8


. ağ ayarları
    . wireless varsa
      +etc+network+interfaces (eklenecek)
        # The primary wireless interface
        allow-hotplug wlan0
        iface wlan0 inet dhcp

    . USB stick kurulumlarında MAC adresine bakmadan isimlendirme için
      +etc+udev+rules.d+70-persistent-net.rules
        SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR=="?*", ATTR=="0x0", ATTR=="1", KERNEL=="eth*", NAME="eth0"
        SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR=="?*", ATTR=="0x0", ATTR=="1", KERNEL=="wlan*", NAME="wlan0"


. bash ayarları
    . +root+.bashrc
        export LS_OPTIONS='--color=auto'
        eval "`dircolors`"
        alias ls='ls $LS_OPTIONS'
        alias ll='ls $LS_OPTIONS -l'


        alias l='ls $LS_OPTIONS -lA'

        # vi modu
        set -o vi

        # timeout
        export TMOUT=1200

    . +home+kullanici+.bashrc
        # vi modu
        set -o vi

# sunucu kurulumlarinda history kayitli kalmasin
        export HISTSIZE=200
        export HISTFILESIZE=0

# google translator
        trans(){

alias t='trans'

. ssh client ayarları
    . +home+kullanici+.ssh+config
        Host *
            Cipher=blowfish
            CompressionLevel=9

. sqlite3
    . +home+kullanici+.sqliterc
        .header ON

. smartmontools
    . +etc+default+smartmontools
        start_smartd=yes

. sshfs ayarları
    adduser kullanici fuse

. openbox ayarları
    su +l kullanici
    mkdir +p ˜+.config+openbox
    cd ˜+.config+openbox
    cp +etc+xdg+openbox+menu.xml .
    cp +etc+xdg+openbox+rc.xml .
    cp +etc+xdg+openbox+autostart.sh .

    "Openbox Notları" bölümünde anlatıldığı gibi düzenlenecek
    http:++emrah.com+notlar+openbox_notlari.txt

. conky ayarları
    cp +etc+conky+conky.conf .conkyrc   
    "Conky Notları" bölümünde anlatıldığı gibi düzenlenecek
    http:++emrah.com+notlar+conky_notlari.txt

. alsa ayarları
    alsactl init
    alsamixer
        F6 +> Ses kartı seçimi
        Master
        Master M
        PCM

. weechat ayarları
    . Ayar dosyalarını default değerleri ile oluşturmak için program bir kere başlatılıp kapatılacak
        weechat+curses

    . ˜+.weechat+weechat.conf
        item_time_format = "%a, %d %b %Y %H:%M"
       
    . ˜+.weechat+logger.conf
        auto_log = off

. ˜+.weechat+irc.conf
        [server]
        freenode.addresses = "chat.freenode.net+7000"
        freenode.proxy
        freenode.ipv6 = off
        freenode.ssl = on
        freenode.ssl_cert
        freenode.ssl_dhkey_size = 512
        freenode.ssl_verify = off
        freenode.password = "parola"
        freenode.sasl_mechanism
        freenode.sasl_username
        freenode.sasl_password
        freenode.sasl_timeout
        freenode.autoconnect = on
        freenode.autoreconnect = on
        freenode.autoreconnect_delay = 10
        freenode.nicks = "nick,nick_,nick__"
        freenode.username = "nick"
        freenode.realname = "nick"
        freenode.local_hostname
        freenode.command
        freenode.command_delay
        freenode.autojoin = "#debian"
        freenode.autorejoin = on
        freenode.autorejoin_delay = 1

. VNC ayarları
    . parola oluşturma
        x11vnc +storepasswd

    . otomatik başlatılacaksa
      ˜+.config+openbox+autostart.sh
        (sleep 5; x11vnc +display :0 +nolookup +forever +rfbauth ˜+.vnc+passwd +autoport 5900) &
   Masaüstünde Yapılacak Ayarlar
+++++++++++++++++++++++++++++++++++++++++++++++
. numlockx
    numlockx on

. iceweasel ayarları
    . preferences
        . Main +> When Iceweasel starts: Show a blank page
        . Content +> Enable JavaScript + Advanced +> Hepsi İptal
        . Content +> Enable Java +> İptal
        . Content +> Languages +> Choose +> Turkish (En üstte)
        . Privacy +> Never Remember History
        . Privacy +> Location Bar +> Nothing
        . Security +> Block reported attack sites +> İptal
        . Security +> Block reported web forgeries +> İptal
        . Security +> Remember passwords for sites +> İptal
        . Advanced +> General +> Warn me when web sites try to redirect or reload the page +> Aktif
        . Advanced +> General +> Check my spelling as I type +> İptal
        . Advanced +> Update +> Installed Add+ons +> İptal
        . Advanced +> Update +> Search Engines +> İptal

http:++fpdownload.macromedia.com+get+flashplayer+current+install_flash_player_10_linux.tar.gz
        tar zxf install_flash_player_10_linux.tar.gz
        mkdir +p ˜+.mozilla+plugins+
        cp libflashplayer.so ˜+.mozilla+plugins+

    . BetterPrivacy (add+on)
      Flashlı bir siteye girilip iceweasel kapatılıp açılmış olacak
        Flash+veri klasörü            : +home+kullanici+.macromedia
        Zamanlayıcı ile Flashçerezlerini sil    : 30 dk
        Flashplayerin  yanında gelen çerezi de sil

    . tmpfs'den çalıştırma
        cp ˜+.mozilla ˜+proje+browser_live+mozilla.org
        rm +rf .mozilla
        ln +s +var+cache+browser+mozilla .mozilla

        . ˜+proje+browser_live+mozilla2disk.sh
            #!+bin+bash
            rm +rf ˜+proje+browser_live+mozilla.org
            mkdir +p ˜+proje+browser_live+mozilla.org
            cp +arp +var+cache+browser+mozilla+* ˜+proje+browser_live+mozilla.org+

        . ˜+proje+browser_live+mozilla2ram.sh
            #!+bin+bash
            rm +rf +var+cache+browser+mozilla
            mkdir +p +var+cache+browser+mozilla
            cp +arp ˜+proje+browser_live+mozilla.org+* +var+cache+browser+mozilla+

        . ˜+.config+openbox+autostart.sh
            (sleep 2; ˜+proje+browser_live+mozilla2ram.sh) &

        . +etc+fstab
            tmpfs   +var+cache+browser   tmpfs   noatime,size=150M,nr_inodes=10k,mode=777   0   0

        . mkdir +p +var+cache+browser
          mount +var+cache+browser
       

   
+++++++++++++++++++++++++++++++++++++++++++++++
Servisler
+++++++++++++++++++++++++++++++++++++++++++++++
. IP ve sistem raporu gönderme
    . +root+scripts+cron_sendip.sh
        #!+bin+sh
        ### BEGIN INIT INFO
        # Provides:          sendip
        # Required+Start:    $remote_fs $syslog
        # Required+Stop:     $remote_fs $syslog
        # Default+Start:     2
        # Default+Stop:     
        # Short+Description: sendip
        ### END INIT INFO

        echo "Send IP address"
        ps aux | grep python | grep sendip | awk '{print $2}' | xargs kill >+dev+null 2>&1
        +root+scripts+sendip.py &
        ps aux | grep python | grep sendreport | awk '{print $2}' | xargs kill >+dev+null 2>&1
        +root+scripts+sendreport.py &

    . +etc+crontab
        01 *    * * *   root    +root+scripts+cron_sendip.sh >+dev+null 2>&1

    . init.d ayarları
        cd +etc+init.d+
                ln +s +root+scripts+cron_sendip.sh sendip
                update+rc.d sendip start 99 2 .

. Ntpdate
    . istemci kurulumu
        aptitude install ntpdate

    . ilk saat ayarı
        ntpdate+debian
        hwclock +w

. +root+scripts+cron_ntpdate.sh
        #!+bin+sh
        ### BEGIN INIT INFO
        # Provides:          ntpdate
        # Required+Start:    $remote_fs $syslog
        # Required+Stop:     $remote_fs $syslog
        # Default+Start:     2
        # Default+Stop:     
        # Short+Description: ntpdate
        ### END INIT INFO

        echo "Ntpdate update"
        (ntpdate+debian >+dev+null 2>&1 && hwclock +w >+dev+null 2>&1) &
        # USB stick kurulumu ise donanım saatini değiştirme, ustteki satiri iptal et
        (ntpdate+debian >+dev+null 2>&1)  &

    . +etc+crontab
        03 *    * * *   root    +root+scripts+cron_ntpdate.sh >+dev+null 2>&1

    . init.d ayarları
        cd +etc+init.d+
        ln +s +root+scripts+cron_ntpdate.sh ntpdate
        update+rc.d ntpdate start 99 2 .

. Otomatik paket güncelleme
  Sadece dosyalar indiriliyor. Kurulum yine elle yapılacak.
  aptitude yerine apt+get ile dosyalar indirilecek. aptitude sorun çıkarıyor.
    . +root+scripts+cron_aptitude.sh
        #!+bin+sh
        apt+get update
        apt+get +dy dist+upgrade
        apt+get autoclean

    . +etc+crontab
        05 5    * * *   root    +root+scripts+cron_aptitude.sh >+dev+null 2>&1

. CPU Frekans Düzenleme
  Pentium 4 makinede p4_clockmod ve governor_ondemand birlikte çalışmadığı için özel düzenleme yapıldı

    . aptitude install cpufrequtils

    . +etc+modules (ekleme)
        p4_clockmod

    . +etc+init.d+cpufrequtils
        GOVERNOR = "userspace"

    . p4freqd kurulacak
        +root+scripts+p4freqd.py

        +root+scripts+p4freqd.sh
            #!+bin+sh
            ### BEGIN INIT INFO
            # Provides:          p4freqd
            # Required+Start:    $remote_fs $syslog cpufrequtils
            # Required+Stop:     $remote_fs $syslog cpufrequtils
            # Default+Start:     2
            # Default+Stop:     
            # Short+Description: p4freqd
            ### END INIT INFO

            echo "P4 Frequency Scaling"
            +root+scripts+p4freqd.py >+dev+null 2>&1 &

        cd +etc+init.d+
        ln +s +root+scripts+p4freqd.sh p4freqd
        update+rc.d p4freqd start 99 2 .


Kategorideki Güncel Makaleler