Top Banner
linux open source 2010 Modul Admin Server Debian Lenny By Arafat SMK Telkom Sandhy Putra Banjarbaru
49
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • l i n u x o p e n s o u r c e

    2010

    Modul Admin Server Debian Lenny

    By Arafat

    SMK Telkom Sandhy Putra Banjarbaru

  • 1

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Konfigurasi IP Address dan Hostname pada DEBIAN LENNY

    Untuk konfigurasi IP Address dari mode teks dapat dilakukan dengan cara.

    #cd /etc/network

    #gedit interfaces

    # This file describes the network interfaces available on your system

    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface

    auto lo

    iface lo inet loopback

    # The primary network interface

    allow-hotplug eth0

    iface eth0 inet static

    address 192.168.1.1

    netmask 255.255.255.0

    network 192.168.1.0

    broadcast 192.168.1.255

    gateway 192.168.1.1

    # dns-* options are implemented by the resolvconf package, if

    installed

    dns-nameservers 192.168.1.1

    dns-search net

    #jika Anda mengcopy file VDI dari virtualbox maka tambahkan konfigurasi IP

    dengan eth1 di baris berikut, karena otomatis akan dikenali sebagai eth1.

    Sedangkan eth0 tidak akan dibaca.

    iface eth1 inet static

    address 192.168.1.1

    netmask 255.255.255.0

    gateway 192.168.1.1

    auto eth1

    untuk mengganti hostname dari mode teks dapat dilakukan dengan cara berikut:

    #gedit /etc/hostname

    Selanjutnya tinggal mengganti hostname nya.

    Jangan lupa untuk mereload ulang konfigurasi IP address dan hostname dengan perintah:

    #/etc/init.d/networking force-reload

    Jika masih belum berubah restart lagi service networknya dengan perintah:

    #/etc/init.d/networking restart

  • 2

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Konfigurasi IP address dengan mode GUI

    Dari menu System Administration Network

    Kemudian klik tombol properties untuk merubah konfigurasi IP Address

    Hilangkan tanda Centang pada Enable roaming mode dan pada Configuration pilih Static IP address.

    Konfigurasi Hostname dari mode GUI

    Klik tab General untuk merubah hostname

  • 3

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Jangan lupa untuk mereload ulang konfigurasi IP address dan hostname dengan perintah:

    #/etc/init.d/networking force-reload

    Jika masih belum berubah restart lagi service networknya dengan perintah:

    #/etc/init.d/networking restart

    Sampai disini seharusnya konfigurasi IP Address dan Hostname sudah dapat berjalan dengan baik.

  • 4

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    INSTALASI DAN KONFIGURASI DHCP SERVER

    Sebelum mengkonfigurasi DHCP Server, install terlebih dahulu paket dhcp3-server . Masukan DVD

    Linux Debian Lenny kedalam DVD-ROM.

    Masuk kedalam user root dengan mengetikan perintah su dan masukan password user root :

    $su

    password:

    cek IP Address server dan hostname linux dengan mengetikanperintah:

    #ifconfig

    #hostname

    Catat berapa IP Address nya dan hostname nya.

    Sebelum melakukan konfigurasi dhcp server, maka Anda harus menginstall paketnya terlebih

    dahulu.

    Cek apakah paket dhcp3-server sudah terinstall. Perintahnya Adela :

    #dpkg -l |grep dhpc3-server

    Perintah diatas Adela untuk mencari query program yang mengandung kata dhcp3-server, jika telah

    terinstall maka yang muncul Adalah:

    Ii dhcp3-server 3.1.1-6 DHCP Server

    #apt-cdrom add

    #apt-get install dhcp3-server

    KONFIGURASI DHCP Server

    Backup terlebih dahulu file dhcpd.conf dengan perintah :

    #cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf.bak

    Buka file dhcpd.conf didalam direktori /etc/dhcp3 dengan perintah :

  • 5

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    #gedit /etc/dhcp3/dhcpd.conf

    Kemudian cari baris berikut, sesuaikan dengan konfigurasi server kita.

    Contoh script file dhcpd.conf

    # Sample configuration file for ISC dhcpd for Debian

    #

    # $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $

    #

    # The ddns-updates-style parameter controls whether or not the server will

    # attempt to do a DNS update when a lease is confirmed. We default to the

    # behavior of the version 2 packages ('none', since DHCP v2 didn't

    # have support for DDNS.)

    ddns-update-style none;

    # option definitions common to all supported networks...

    option domain-name "example.org";

    option domain-name-servers ns1.example.org, ns2.example.org;

    default-lease-time 600;

    max-lease-time 7200;

    # If this DHCP server is the official DHCP server for the local

    # network, the authoritative directive should be uncommented.

    #authoritative;

    # Use this to send dhcp log messages to a different log file (you also

    # have to hack syslog.conf to complete the redirection).

    log-facility local7;

    # No service will be given on this subnet, but declaring it helps the

    # DHCP server to understand the network topology.

    #subnet 10.152.187.0 netmask 255.255.255.0 {

    #}

    # This is a very basic subnet declaration.

    #subnet 10.254.239.0 netmask 255.255.255.224 {

    # range 10.254.239.10 10.254.239.20;

    # option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;

    #}

    # This declaration allows BOOTP clients to get dynamic addresses,

    # which we don't really recommend.

    #subnet 10.254.239.32 netmask 255.255.255.224 {

    # range dynamic-bootp 10.254.239.40 10.254.239.60;

    # option broadcast-address 10.254.239.31;

    # option routers rtr-239-32-1.example.org;

    #}

    # A slightly different configuration for an internal subnet.

  • 6

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    #subnet 10.5.5.0 netmask 255.255.255.224 {

    # range 10.5.5.26 10.5.5.30;

    # option domain-name-servers ns1.internal.example.org;

    # option domain-name "internal.example.org";

    # option routers 10.5.5.1;

    # option broadcast-address 10.5.5.31;

    # default-lease-time 600;

    # max-lease-time 7200;

    #}

    # Hosts which require special configuration options can be listed in

    # host statements. If no address is specified, the address will be

    # allocated dynamically (if possible), but the host-specific information

    # will still come from the host declaration.

    #host passacaglia {

    # hardware ethernet 0:0:c0:5d:bd:95;

    # filename "vmunix.passacaglia";

    # server-name "toccata.fugue.com";

    #}

    # Fixed IP addresses can also be specified for hosts. These addresses

    # should not also be listed as being available for dynamic assignment.

    # Hosts for which fixed IP addresses have been specified can boot using

    # BOOTP or DHCP. Hosts for which no fixed address is specified can only

    # be booted with DHCP, unless there is an address range on the subnet

    # to which a BOOTP client is connected which has the dynamic-bootp flag

    # set.

    #host fantasia {

    # hardware ethernet 08:00:07:26:c0:a5;

    # fixed-address fantasia.fugue.com;

    #}

    # You can declare a class of clients and then do address allocation

    # based on that. The example below shows a case where all clients

    # in a certain class get addresses on the 10.17.224/24 subnet, and all

    # other clients get addresses on the 10.0.29/24 subnet.

    #class "foo" {

    # match if substring (option vendor-class-identifier, 0, 4) = "SUNW";

    #}

    #shared-network 224-29 {

    # subnet 10.17.224.0 netmask 255.255.255.0 {

    # option routers rtr-224.example.org;

    # }

    # subnet 10.0.29.0 netmask 255.255.255.0 {

    # option routers rtr-29.example.org;

    # }

    # pool {

    # allow members of "foo";

    # range 10.17.224.10 10.17.224.250;

    # }

    # pool {

    # deny members of "foo";

    # range 10.0.29.10 10.0.29.230;

  • 7

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    # }

    #}

    Ubah teks yang bertanda bold dan italic di sesuaikan dengan konfigurasi server kita, misalnya seperi

    dibawah:

    # A slightly different configuration for an internal subnet.

    subnet 192.168.1.0 netmask 255.255.255.0 {

    range 192.168.1.10 192.168.1.15;

    option domain-name-servers smktelkom.sch.id;

    option domain-name "192.168.1.1";

    # option routers 10.5.5.1;

    option broadcast-address 192.168.1.255;

    default-lease-time 600;

    max-lease-time 7200;

    }

    Kemudian star atau restart service dari dhcp server dengan mengunakan perintah:

    #/etc/init.d/dhcp3-server restart

    Stoping DHCP server :dhcpd3.

    Starting DHCP server : dhcpd3.

    Jika tidak muncul pesan, maka kemungkinan konfigurasi dhcp server telah berhasil. Untuk melihat

    hasilnya maka atur IP Address di windows XP menjadi Obtain by DHCP.

  • 8

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    KONFIGURASI DNS SERVER

    Cek apakah paket bind9 sudah terinstall dengan perintah :

    #dpkg -l |grep bind9

    Jika sudah terinstall selanjutnya melakukan konfigurasi file named.conf.

    Konfigurasi DNS Server

    Backup terlebih dahulu file named.conf.

    #cd /etc/bind

    #cp named.conf. named.conf.bak

    #gedit named.conf

    File named.conf

    // This is the primary configuration file for the BIND DNS server named.

    //

    // Please read /usr/share/doc/bind9/README.Debian.gz for information on the

    // structure of BIND configuration files in Debian, *BEFORE* you customize

    // this configuration file.

    //

    // If you are just adding zones, please do that in

    /etc/bind/named.conf.local

    include "/etc/bind/named.conf.options";

    // prime the server with knowledge of the root servers

    zone "." {

    type hint;

    file "/etc/bind/db.root";

    };

    // be authoritative for the localhost forward and reverse zones, and for

    // broadcast zones as per RFC 1912

    zone "localhost" {

    type master;

    file "/etc/bind/db.local";

    };

    zone "127.in-addr.arpa" {

    type master;

  • 9

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    file "/etc/bind/db.127";

    };

    zone "0.in-addr.arpa" {

    type master;

    file "/etc/bind/db.0";

    };

    zone "255.in-addr.arpa" {

    type master;

    file "/etc/bind/db.255";

    };

    include "/etc/bind/named.conf.local";

    tambahkan konfigurasi untuk domain smktelkom.sch.id dan telkom.co.id pada baris terakhir diatas

    include, seperti terlihat pada script dibawah.

    zone "smktelkom.sch.id" {

    type master;

    file "/etc/bind/db.smktelkom";

    };

    zone "telkom.co.id" {

    type master;

    file "/etc/bind/db.telkom";

    };

    zone "1.1.168.192.in-addr.arpa" {

    type master;

    file "/etc/bind/db.192";

    };

    // This is the primary configuration file for the BIND DNS server named.

    //

    // Please read /usr/share/doc/bind9/README.Debian.gz for information on the

    // structure of BIND configuration files in Debian, *BEFORE* you customize

    // this configuration file.

    //

    // If you are just adding zones, please do that in

    /etc/bind/named.conf.local

    include "/etc/bind/named.conf.options";

    // prime the server with knowledge of the root servers

    zone "." {

    type hint;

    file "/etc/bind/db.root";

    };

    // be authoritative for the localhost forward and reverse zones, and for

  • 10

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    // broadcast zones as per RFC 1912

    zone "localhost" {

    type master;

    file "/etc/bind/db.local";

    };

    zone "127.in-addr.arpa" {

    type master;

    file "/etc/bind/db.127";

    };

    zone "0.in-addr.arpa" {

    type master;

    file "/etc/bind/db.0";

    };

    zone "255.in-addr.arpa" {

    type master;

    file "/etc/bind/db.255";

    };

    zone "smktelkom.sch.id" {

    type master;

    file "/etc/bind/db.smktelkom";

    };

    zone "telkom.co.id" {

    type master;

    file "/etc/bind/db.telkom";

    };

    zone "1.1.168.192.in-addr.arpa" {

    type master;

    file "/etc/bind/db.192";

    };

    include "/etc/bind/named.conf.local";

    file db.smktelkom

    ;

    ; BIND data file for local loopback interface

    ;

    $TTL 604800

    @ IN SOA smktelkom.sch.id. root.smktelkom.sch.id. (

    2 ; Serial

    604800 ; Refresh

    86400 ; Retry

    2419200 ; Expire

    604800 ) ; Negative Cache TTL

    ;

    @ IN NS smktelkom.sch.id.

    @ IN MX 10 mail.smktelkom.sch.id.

    @ IN A 192.168.1.1

    www IN A 192.168.1.1

    mail IN A 192.168.1.1

    ftp IN A 192.168.1.1

  • 11

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    file db.telkom.co.id

    ;

    ; BIND data file for local loopback interface

    ;

    $TTL 604800

    @ IN SOA smktelkom.sch.id. root.smktelkom.sch.id. (

    2 ; Serial

    604800 ; Refresh

    86400 ; Retry

    2419200 ; Expire

    604800 ) ; Negative Cache TTL

    ;

    @ IN NS telkom.co.id.

    @ IN A 192.168.1.1

    www IN A 192.168.1.1

    file db.192

    ;

    ; BIND data file for local loopback interface

    ;

    $TTL 604800

    @ IN SOA smktelkom.sch.id. root.smktelkom.sch.id. (

    2 ; Serial

    604800 ; Refresh

    86400 ; Retry

    2419200 ; Expire

    604800 ) ; Negative Cache TTL

    ;

    @ IN NS 192.168.1.1

    IN PTR www.smktelkom.sch.id.

    IN PTR www.telkom.co.id.

    Edit file resolve.conf

    #gedit /etc/resolv.conf

    search 192.168.1.1

    nameserver smktelkom.sch.id

    Restart service bind dengan menggunakan perintah

    #/etc/init.d/bind9 restart

    Jalankan perintah nslookup dan dig untuk mengecek apakah konfigurasi DNS telah berjalan.

    #nslookup www.smktelkom.sch.id

    Server: 192.168.1.1

    Address: 192.168.1.1#53

    Name: www.smktelkom.sch.id

    Address: 192.168.1.1

  • 12

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    #dig www.smktelkom.sch.id

    ; DiG 9.5.1-P1 www.smktelkom.sch.id

    ;; global options: printcmd

    ;; Got answer:

    ;; ->>HEADER

  • 13

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    FTP SERVER

    Instalasi FTP Server

    Install terlebih dahulu paket proftpd

    #apt-get install proftpd

    Pada pilihan yang muncul pilih Stand Alone

    Konfigurasi FTP SERVER

    Masuk kedalam direktori /etc/proftpd

    #cd /etc/proftpd

    #cp proftpd.conf proftpd.conf.bak

    Edit file proftpd.conf yang di bold menjadi seperti script dibawah:

    # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.

    # To really apply changes reload proftpd after modifications.

    #

    # Includes DSO modules

    Include /etc/proftpd/modules.conf

    # Set off to disable IPv6 support which is annoying on IPv4 only boxes.

    UseIPv6 off

    # If set on you can experience a longer connection delay in many cases.

    IdentLookups off

    ServerName "smktelkom.sch.id"

    ServerType standalone

    DeferWelcome off

  • 14

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    MultilineRFC2228 on

    DefaultServer on

    ShowSymlinks on

    TimeoutNoTransfer 600

    TimeoutStalled 600

    TimeoutIdle 1200

    DisplayLogin welcome.msg

    DisplayChdir .message true

    ListOptions "-l"

    DenyFilter \*.*/

    # Use this to jail all users in their homes

    # DefaultRoot ~

    # Users require a valid shell listed in /etc/shells to login.

    # Use this directive to release that constrain.

    # RequireValidShell off

    # Port 21 is the standard FTP port.

    Port 21

    # In some cases you have to specify passive ports range to by-pass

    # firewall limitations. Ephemeral ports can be used for that, but

    # feel free to use a more narrow range.

    PassivePorts 30000 30100

    # If your host was NATted, this option is useful in order to

    # allow passive tranfers to work. You have to use your public

    # address and opening the passive ports used on your firewall as well.

    # MasqueradeAddress 1.2.3.4

    # This is useful for masquerading address with dynamic IPs:

    # refresh any configured MasqueradeAddress directives every 8 hours

    # DynMasqRefresh 28800

    # To prevent DoS attacks, set the maximum number of child processes

    # to 30. If you need to allow more than 30 concurrent connections

    # at once, simply increase this value. Note that this ONLY works

    # in standalone mode, in inetd mode you should use an inetd server

    # that allows you to limit maximum number of processes per service

    # (such as xinetd)

    MaxInstances 30

    # Set the user and group that the server normally runs at.

    User proftpd

    Group nogroup

    # Umask 022 is a good standard umask to prevent new files and dirs

    # (second parm) from being group and world writable.

    Umask 022 022

    # Normally, we want files to be overwriteable.

    AllowOverwrite on

  • 15

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    # Uncomment this if you are using NIS or LDAP via NSS to retrieve

    passwords:

    # PersistentPasswd off

    # This is required to use both PAM-based authentication and local passwords

    # AuthOrder mod_auth_pam.c* mod_auth_unix.c

    # Be warned: use of this directive impacts CPU average load!

    # Uncomment this if you like to see progress and transfer rate with ftpwho

    # in downloads. That is not needed for uploads rates.

    #

    # UseSendFile off

    TransferLog /var/log/proftpd/xferlog

    SystemLog /var/log/proftpd/proftpd.log

    QuotaEngine off

    Ratios off

    # Delay engine reduces impact of the so-called Timing Attack described in

    # http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02

    # It is on by default.

    DelayEngine on

    ControlsEngine off

    ControlsMaxClients 2

    ControlsLog /var/log/proftpd/controls.log

    ControlsInterval 5

    ControlsSocket /var/run/proftpd/proftpd.sock

    AdminControlsEngine off

    #

    # Alternative authentication frameworks

    #

    #Include /etc/proftpd/ldap.conf

    #Include /etc/proftpd/sql.conf

    #

    # This is used for FTPS connections

    #

    #Include /etc/proftpd/tls.conf

    # A basic anonymous configuration, no upload directories.

  • 16

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    User ftp

    Group nogroup

    # # We want clients to be able to login with "anonymous" as well as "ftp"

    UserAlias anonymous ftp

    # # Cosmetic changes, all files belongs to ftp user

    DirFakeUser on ftp

    DirFakeGroup on ftp

    #

    RequireValidShell off

    #

    # # Limit the maximum number of anonymous logins

    MaxClients 10

    #

    # # We want 'welcome.msg' displayed at login, and '.message' displayed

    # # in each newly chdired directory.

    DisplayLogin welcome.msg

    DisplayChdir .message

    #

    # # Limit WRITE everywhere in the anonymous chroot

    AllowAll

    #

    # # Uncomment this if you're brave.

    # #

    # # # Umask 022 is a good standard umask to prevent new files and dirs

    # # # (second parm) from being group and world writable.

    # # Umask 022 022

    # #

    # # DenyAll

    # #

    # #

    # # AllowAll

    # #

    # #

    #

    Restart service proftpd

    #/etc/init.d/proftpd restart

    Menjalankan Layanan FTP

    Untuk mencek apakah FTP sudah berjalan dengan benar, buka browser di linux kemudian ketikan

    pada url dengan ftp://smktelkom.sch.id , dan ftp://[email protected]

    Maka seharusnya yang tampil adalah seperti pada gambar.

  • 17

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Gambar tampilan dengan anonymous

    Gambar tampilan authentifikasi user dengan password

  • 18

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    MAIL SERVER

    Instalasi paket mysql-server dan php5-mysql

    #apt-get install mysql-server php5-mysql

    Silahkan isi password untuk mysql

    Ulangi dengan password yang sama

    Instalasi Postfix, courier-imap, courier-pop dan squirrelmail

  • 19

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Instal paket yang dibutuhkan untuk Mail Server

    #apt-get install postfix

  • 20

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    #apt-get install courier-imap

    #apt-get install courier-pop

    #apt-get install squirrelmail

    Buat direktori untuk mailserver dengan perintah

    #maildirmake /etc/skel/Maildir

    Kemudian buat dua (2) user baru untuk account email dengan perintah:

    #adduser user1

    Adding user `user1' ...

    Adding new group `user1' (1001) ...

    Adding new user `user1' (1001) with group `user1' ...

    Creating home directory `/home/user1' ...

    Copying files from `/etc/skel' ...

    Enter new UNIX password:

    Retype new UNIX password:

    passwd: password updated successfully

    Changing the user information for user1

    Enter the new value, or press ENTER for the default

    Full Name []: user1

    Room Number []:

    Work Phone []:

    Home Phone []:

    Other []:

    Is the information correct? [Y/n] y

  • 21

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    #adduser user2

    Adding user `user2' ...

    Adding new group `user2' (1002) ...

    Adding new user `user2' (1002) with group `user2' ...

    Creating home directory `/home/user2' ...

    Copying files from `/etc/skel' ...

    Enter new UNIX password:

    Retype new UNIX password:

    passwd: password updated successfully

    Changing the user information for user2

    Enter the new value, or press ENTER for the default

    Full Name []: user2

    Room Number []:

    Work Phone []:

    Home Phone []:

    Other []:

    Is the information correct? [Y/n] y

    Konfigurasi ulang postfix dengan perintah :

    #dpkg-reconfigure postfix

    Pilih Internet Site

    Pada System mail name isi dengan smktelkom.sch.id

  • 22

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Pada root dan postmaster mail resepient biarkan kosong seperti pada gambar

    Biarkan apa adanya seperti pada gambar di bawah

    Pada pilihan Force synchronous update on mail queue? Pilih No

  • 23

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Pada local network tambahkan IP address Server linux beserta netmask prefixnya missal nya

    dengan 192.168.1.1/24 dan hapus konfigurasi untuk IPv6

    Pade Use procmail for local delivery ? pilih No

  • 24

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Pada Mailbox size limit (bytes): biarkan apa adanya.

    Pada Local address extention character: biarkan apa adanya.

    Pada Internet protocol to use: pilih ipv4.

  • 25

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Konfigurasi main.cf

    Jangan lupa di backup terlebih dahulu.

    #gedit /etc/postfix/main.cf

    Tambahkan script berikut pada baris terakhir :

    Home_mailbox = Maildir/

    # See /usr/share/postfix/main.cf.dist for a commented, more complete

    version

    # Debian specific: Specifying a file name will cause the first

    # line of that file to be used as the name. The Debian default

    # is /etc/mailname.

    #myorigin = /etc/mailname

    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)

    biff = no

    # appending .domain is the MUA's job.

    append_dot_mydomain = no

    # Uncomment the next line to generate "delayed mail" warnings

    #delay_warning_time = 4h

    readme_directory = no

    # TLS parameters

    smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

    smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

    smtpd_use_tls=yes

    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache

    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for

    # information on enabling SSL in the smtp client.

    myhostname = smktelkom.sch.id

    alias_maps = hash:/etc/aliases

    alias_database = hash:/etc/aliases

    myorigin = /etc/mailname

    mydestination = smktelkom.sch.id, localhost.sch.id, , localhost

    relayhost =

    mynetworks = 127.0.0.0/8 192.168.1.1/24

    mailbox_command =

    mailbox_size_limit = 0

    recipient_delimiter = +

    inet_interfaces = all

    inet_protocols = ipv4

    home_mailbox = Maildir/

  • 26

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    restart ulang service postfix, courier-imap dan courier-pop

    #/etc/init.d/postfix restart

    #/etc/init.d/courier-imap restart

    #/etc/init.d/courier-pop restart

    Konfigurasi Squirrelmail

    Ketikan diterminal dengan squirrelmail-configure

    # squirrelmail-configure

    Pada command >> ketikan 2 tekan enter.

    Pada command >> ketikan 1 tekan enter

  • 27

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Kemudian isi dengan hostname yaitu smktelkm.sch.id dan tekan enter.

    Pada command >> ketikan A tekan enter

    Pada command >> ketikan A tekan enter

  • 28

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Kemudian pilih server imap yang kita gunakan yauitu courier.

    Ketikan courier dan tekan enter.

    Pada command >> ketikan S dan tekan enter untuk menyimpan semua konfigurasi

    squirrelmail.

  • 29

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    WEB SERVER

    Konfigurasi virtual hosting

    Masuk kedalam direktori

    #cd /etc/apache2/sites-available

    #cp default smktelkom

    #gedit smktelkom

    NameVirtualHost www.smktelkom.sch.id:80

    ServerAdmin [email protected]

    ServerName smktelkom.sch.id

    DocumentRoot /var/www/smktelkom

    Options FollowSymLinks

    AllowOverride None

    Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny

    allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

    AllowOverride None

    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

    Order allow,deny

    Allow from all

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,

    # alert, emerg.

    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"

    Options Indexes MultiViews FollowSymLinks

    AllowOverride None

    Order deny,allow

    Deny from all

    Allow from 127.0.0.0/255.0.0.0 ::1/128

  • 30

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    #cp default mail.smktelkom

    #gedit mail.smktelkom

    NameVirtualHost www.smktelkom.sch.id:80

    ServerAdmin [email protected]

    ServerName mail.smktelkom.sch.id

    DocumentRoot /usr/share/squirrelmail

    Options FollowSymLinks

    AllowOverride None

    Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny

    allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

    AllowOverride None

    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

    Order allow,deny

    Allow from all

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,

    # alert, emerg.

    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"

    Options Indexes MultiViews FollowSymLinks

    AllowOverride None

    Order deny,allow

    Deny from all

    Allow from 127.0.0.0/255.0.0.0 ::1/128

  • 31

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    #cp default telkom

    #gedit telkom

    NameVirtualHost www.smktelkom.sch.id:80

    ServerAdmin [email protected]

    ServerName telkom.co.id

    DocumentRoot /var/www/telkom

    Options FollowSymLinks

    AllowOverride None

    Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny

    allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

    AllowOverride None

    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

    Order allow,deny

    Allow from all

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,

    # alert, emerg.

    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"

    Options Indexes MultiViews FollowSymLinks

    AllowOverride None

    Order deny,allow

    Deny from all

    Allow from 127.0.0.0/255.0.0.0 ::1/128

    Aktifkan ketiga buah virtual hosting yang telah dibuat dengan perintah:

    #a2ensite smktelkom

    #a2ensite mail.smktelkom

    #a2ensite telkom

  • 32

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Kemudian reload dan restart konfigurasi apache dengan perintah:

    #/etc/init.d/apache2 reload

    #/etc/init.d/apache2 restart

    Buat folder untuk web www.smktelkom.sch.id dan www.telkom.co.id dengan perintah :

    #cd /var/www/

    #mkdir smktelkom

    #mkdir telkom

    Buat file index untuk web www.telkom.co.id

    #cd /var/www/telkom

    #gedit index.html

    :.www.telkom.co.id.:

    Selamat dating di web www.telkom.co.id

    Web undercontructions

    [email protected]

    Untuk web www.smktelkom.sch.id menggunakan wordpress.

    Persiapan yang harus dilakukan adalah:

    Install paket ssh yang diperlukan untuk meremote dan mengirim file dari windows

    Membuat database wordpress yang digunakan untuk database wordpress.

    Mengatur permission direktori /var/www/smktelkom .

    Upload file wordpress dengan coreFTP

  • 33

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Instalasi ssh server

    #apt-get install ssh

    Membuat database wordpress di mysql

    #mysql u root p

    Enter Password:

    Welcome to the MySQL monitor. Commands end with ; or \g.

    Your MySQL connection id is 35

    Server version: 5.0.51a-24 (Debian)

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> create database wordpress;

    Query OK, 1 row affected (0.03 sec)

    mysql>

    NB: password di isi dengan password ketika mengintall mysql-server, bukan password root

    Mengatur permission direktori

    #cd /var/www

    #chmod 777 smktelkom

    Upload data dengan coreFTP

    Jalankan program coreFTP, kemudian atur seperti berikut:

    Host / IP / URL : IP server linux

    Username : root

    Password : password user root

    Connection : SSH/SFTP

    Port : 22

  • 34

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Kemudian klik tombol Connect..

    Jika sudah terkoneksi arahkan ke direktori web yang ingin di install wordpress, selanjutnya tinggal

    mendrag dari sebelah kiri ke kanan.

  • 35

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Installasi Wordpress 3.0

    Buka web browser dan ketikan url www.smktelkom.sch.id

    Klik tombol Lets go !

    Isikan sesuai dengan konfigurasi system Anda

    Database Name : wordpress (sesuai dengan database yang dibuat sebelumnya)

  • 36

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Username : root

    Password : di isi dengan password mysql

    Database Host : localhost

    Table Prefix : wp_

    Klik tombol Submit untuk memulai proses instalasi.

    Isikan informasi yang di minta di sesuaikan dengan konfigurasi Anda.

  • 37

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Wordpress telah berhasil di install.

    Jalankan juga mail.smktelkom.sch.id, jika benar konfigurasi nya maka yang muncul adalah halaman

    squirrelmail seperti terlihat pada gambar.

  • 38

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Halaman wwb www.telkom.co.id

  • 39

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    SAMBA SERVER

    Sebelum melakukan konfigurasi samba, buat terlebih dahulu user

    Buat user untuk samba

    #adduser arafat

    #passwd arafat

    #smbpasswd a arafat

    Masukan password untuk user samba, sebaiknya passwordnya berbeda dengan password usernya.

    Konfigurasi Samba

    #cd /etc/samba

    #gedit smb.conf

    Potongan file smb.conf

    #======================= Global Settings =======================

    [global]

    ## Browsing/Identification ###

    # Change this to the workgroup/NT-domain name your Samba server will part

    of

    workgroup = WORKGROUP

    # server string is the equivalent of the NT Description field

    server string = %h linux server

    #### Debugging/Accounting ####

    # This tells Samba to use a separate log file for each machine

    # that connects

    log file = /var/log/samba/log.%m

    # Cap the size of the individual log files (in KiB).

    max log size = 1000

  • 40

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    # If you want Samba to only log through syslog then set the following

    # parameter to 'yes'.

    # syslog only = no

    # We want Samba to log a minimum amount of information to syslog.

    Everything

    # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log

    # through syslog you should set the following parameter to something

    higher.

    syslog = 0

    # Do something sensible when Samba crashes: mail the admin a backtrace

    panic action = /usr/share/samba/panic-action %d

    ####### Authentication #######

    # "security = user" is always a good idea. This will require a Unix account

    # in this server for every user accessing the server. See

    # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html

    # in the samba-doc package for details.

    security = user

    # You may wish to use password encryption. See the section on

    # 'encrypt passwords' in the smb.conf(5) manpage before enabling.

    encrypt passwords = true

    # If you are using encrypted passwords, Samba will need to know what

    # password database type you are using.

    passdb backend = tdbsam

    obey pam restrictions = yes

    # This boolean parameter controls whether Samba attempts to sync the Unix

    # password with the SMB password when the encrypted SMB password in the

    # passdb is changed.

    unix password sync = yes

    # For Unix password sync to work on a Debian GNU/Linux system, the

    following

    # parameters must be set (thanks to Ian Kahan

  • 41

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    read only = no

    guest ok = yes

    available = yes

    browsable = yes

    writable = yes

    #konfigurasi untuk mengunakan security Share

    [data2]

    path = /home/data

    comment = share untuk public

    available = yes

    browsable = yes

    public = yes

    writable = no

    locking = no

    # By default, the home directories are exported read-only. Change the

    # next parameter to 'no' if you want to be able to write to them.

    # read only = yes

    # File creation mask is set to 0700 for security reasons. If you want to

    # create files with group=rw permissions, set next parameter to 0775.

    create mask = 0700

    # Directory creation mask is set to 0700 for security reasons. If you want

    to

    # create dirs. with group=rw permissions, set next parameter to 0775.

    directory mask = 0777

    # By default, \\server\username shares can be connected to by anyone

    # with access to the samba server.

    # The following parameter makes sure that only "username" can connect

    # to \\server\username

    # This might need tweaking when using external authentication schemes

    # valid users = %S

    # Un-comment the following and create the netlogon directory for Domain

    Logons

    # (you need to configure Samba to act as a domain controller too.)

    ;[netlogon]

    ; comment = Network Logon Service

    ; path = /home/samba/netlogon

    ; guest ok = yes

    ; read only = yes

    ; share modes = no

    # Un-comment the following and create the profiles directory to store

    # users profiles (see the "logon path" option above)

    # (you need to configure Samba to act as a domain controller too.)

    # The path below should be writable by all users so that their

    # profile directory may be created the first time they log on

    ;[profiles]

    ; comment = Users profiles

    ; path = /home/samba/profiles

    ; guest ok = no

  • 42

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    ; browseable = no

    ; create mask = 0600

    ; directory mask = 0700

    [printers]

    comment = All Printers

    browseable = no

    path = /var/spool/samba

    printable = yes

    guest ok = no

    read only = yes

    create mask = 0700

    # Windows clients look for this share name as a source of downloadable

    # printer drivers

    [print$]

    comment = Printer Drivers

    path = /var/lib/samba/printers

    browseable = yes

    read only = yes

    guest ok = no

    # Uncomment to allow remote administration of Windows print drivers.

    # You may need to replace 'lpadmin' with the name of the group your

    # admin users are members of.

    # Please note that you also need to set appropriate Unix permissions

    # to the drivers directory for these users to have write rights in it

    ; write list = root, @lpadmin

    # A sample share for sharing your CD-ROM with others.

    ;[cdrom]

    ; comment = Samba server's CD-ROM

    ; read only = yes

    ; locking = no

    ; path = /cdrom

    ; guest ok = yes

    # The next two parameters show how to auto-mount a CD-ROM when the

    # cdrom share is accesed. For this to work /etc/fstab must contain

    # an entry like this:

    #

    # /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0

    #

    # The CD-ROM gets unmounted automatically after the connection to the

    #

    # If you don't want to use auto-mounting/unmounting make sure the CD

    # is mounted on /cdrom

    #

    ; preexec = /bin/mount /cdrom

    ; postexec = /bin/umount /cdrom

    Cek konfigurasi samba apakah ada kesalahan dengan mengetikan perintah:

    #testparm

    Jika tidak ada pesan error berati konfigurasi samba sudah benar.

  • 43

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Restart service samba

    #/etc/init.d/samba restart

    Buka run di windows XP kemudian ketikan \\192.168.1.1

    Jika konfigurasi benar seharusnya akan muncul seperti terlihat pada gambar

  • 44

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    PROXY SERVER

    Proxy server berfungsi untuk membuat salinan data yang dibaca dari Internet ke jaringan lokal kita

    sehingga jika di lain waktu kita mengakses data yang sama, maka data tersebut akan diambil dari

    jaringan lokal kita sehingga akan sangat menghemat bandwith kita ke Internet. Squid adalah proxy

    server yang paling stabil dan paling umum digunakan untuk sistem operasi Linux.

    Aktifkan IP Forwading nya..

    #cd /etc

    #gedit sysyctl.conf

    Buka tanda pagar pada net.ipv4.ip_forward=1

    # Uncomment the next line to enable packet forwarding for IPv4

    net.ipv4.ip_forward=1

    kemudian restart konfigurasi networknya

    #/etc/init.d/networking force-reload

    #/etc/init.d/networking restart

    INSTALLASI SQUID

    #apt-get install squid

    KONFIGURASI SQUID

    Langkah berikutnya, carilah perintah berikut :

    # ACCESS CONTROLS

    # ------------------

    Baris perintah berikut ini digunakan untuk mendefinisikan daftar hak akses dalam jaringan anda,

  • 45

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    squid menyebutnya dengan Access Control Lists (ACL). Anda dapat mendefinisikan beberapa ACL

    disini.

    Dalam bagian access controls ini, carilah baris perintah berikut :

    Carilah baris yang berisi perintah berikut :

    #Examples:

    #acl macaddress arp 09:00:2b:23:45:67

    #acl myexample dst_as 1241

    #acl password proxy_auth REQUIRED

    #acl fileupload req_mime_type -i ^multipart/form-data$

    #acl javascript rep_mime_type -i ^application/x-javascript$

    #

    #Recommended minimum configuration:

    acl all src all

    acl manager proto cache_object

    acl localhost src 127.0.0.1/32

    acl lan src 192.168.1.0/24

    acl to_localhost dst 127.0.0.0/8

    acl situs url_regex "/etc/squid/blokir.txt"

    acl terlarang url_regex -i "/etc/squid/kataterlarang.txt"

    #

    #good idea to have an "deny all" or "allow all" entry at the end

    # of your access lists to avoid potential confusion.

    #

    #Default:

    # http_access deny all

    #

    #Recommended minimum configuration:

    #

    # Only allow cachemgr access from localhost

    http_access deny situs

    http_access deny terlarang

    http_access allow lan

    http_access allow manager localhost

    http_access deny manager

    # Only allow purge requests from localhost

    http_access allow purge localhost

    http_access deny purge

    # Deny requests to unknown ports

    http_access deny !Safe_ports

    # Deny CONNECT to other than SSL ports

    http_access deny CONNECT !SSL_ports

    #

    # We strongly recommend the following be uncommented to protect

    innocent

    # web applications running on the proxy server who think the only

  • 46

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    # one who can access services on "localhost" is a local user

    #http_access deny to_localhost

    #

    # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

    # Example rule allowing access from your local networks.

    # Adapt localnet in the ACL section to list your (internal) IP

    networks

    # from where browsing should be allowed

    #http_access allow localnet

    http_access allow localhost

    # And finally deny all other access to this proxy

    http_access deny all

    tambahkan transparent di baris 1117

    # Squid normally listens to port 3128

    http_port 3128 transparent

    tambahkan visible_hostname di baris 3373

    # TAG: cache_effective_group

    # If you want Squid to run with a specific GID regardless of

    # the group memberships of the effective user then set this

    # to the group (or GID) you want Squid to run as. When set

    # all other group privileges of the effective user is ignored

    # and only this GID is effective. If Squid is not started as

    # root the user starting Squid must be member of the specified

    # group.

    #

    #Default:

    # none

    visible_hostname smktelkom.sch.id

    buat file di /etc/squid/kataterlarang.txt

    #cd /etc/squid

    #gedit kataterlarang.txt

    crack

    hack

    cracker

    buat file di /etc/squid/blokir.txt

    #cd /etc/squid

    #gedit blokir.txt

  • 47

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Facebook.com

    Hacker.org

    Cracker.org

    Sebelum squid dapat berjalan, anda harus menciptakan direktori swap. Lakukanlah dengan

    menjalankan perintah :

    #/etc/init.d/squid stop

    # squid z

    #/etc/init.d/squid start

    #squid k reconfigure

    KONFIGURASI TRANSPARENT PROXY

    Langkah terakhir adalah untuk mengkonfigurasi squid menjadi transparen proxy ketikan perintah

    berikut di terminal dengan:

    #iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p tcp --dport 80 -j REDIRECT --to-ports

    3128

    Coba buka web yang telah dibuat sebelumnya yang telah terdaftar di blokir.txt dan situsterlarang.txt

    Jika konfigurasi sudah benar maka akan muncul seperti pada gambar yang menyatakan bahwa situs

    berhasil terblokir :

  • 48

    Modul Admin Server Debian Lenny

    By Arafat, S.Kom

    Untuk melihat history apa saja web yang pernah dibuka oleh komputer klien maka ketikan perintah

    berikut:

    #tail -f /var/log/squid/access.log

    1290024442.959 11335 192.168.1.2 TCP_MISS/200 2498 GET http://www.smktelkom.sch.id/ -

    DIRECT/192.168.1.1 text/html

    1290024443.214 253 192.168.1.2 TCP_REFRESH_HIT/304 388 GET http://www.smktelkom.sch.id/wp-

    content/themes/twentyten/style.css - DIRECT/192.168.1.1 -

    1290024443.218 59 192.168.1.2 TCP_REFRESH_HIT/304 388 GET http://www.smktelkom.sch.id/wp-

    content/themes/twentyten/images/headers/path.jpg - DIRECT/192.168.1.1 -

    1290024443.306 87 192.168.1.2 TCP_REFRESH_HIT/304 387 GET http://www.smktelkom.sch.id/wp-

    content/themes/twentyten/images/wordpress.png - DIRECT/192.168.1.1 -

    1290024443.350 44 192.168.1.2 TCP_MISS/404 766 GET http://www.smktelkom.sch.id/favicon.ico

    - DIRECT/192.168.1.1 text/html

    1290024489.758 2 192.168.1.2 TCP_DENIED/403 1432 GET http://www.cracker.org/ - NONE/-

    text/html