Minggu, 10 Februari 2013

Debian Leny Network Setting





<<<<< IP dan ROUTER >>>>>

tkj:~# nano /etc/network/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 static
            address 100.100.100.20
            netmask 255.255.255.0
            network 100.100.100.0
            broadcast 100.100.100.255
            gateway 100.100.100.1
            # dns-* options are implemented by the resolvconf package, if     installed
            dns-nameservers 100.100.100.1
            dns-search tkj.com
     
      auto eth1
      iface eth1 inet static
            address 192.168.20.1
            netmask 255.255.255.0
            network 192.168.20.0
            broadcast 192.168.20.255

tkj:~# nano /etc/rc.local
      # By default this script does nothing.
      iptables-A POSTROUTING -t nat -o eth -j MASQUERADE

      exit 0


tkj:~# nano /etc/network/option
      ip_forward=yes
      spoofprotect=yes
      syncookies=no


tkj:~# nano /etc/sysctl.conf
      # Uncomment the next line to enable packet forwarding for IPv4
      net.ipv4.ip_forward=1               ß--hilangkan tanda #


tkj:~# /etc/init.d/networking restart
      Reconfiguring network interfaces...




<<<<<  DHCP  >>>>>

tkj:~# apt-get install dhcp3-server


tkj:~# nano /etc/dhcp3/dhcpd.conf
      # A slightly different configuration for an internal subnet.
      subnet 192.168.20.0 netmask 255.255.255.0 {
             range 192.168.20.2 192.168.20.5;
            option domain-name-servers ns.tkj.com;
            option domain-name "tkj.com";
            option routers 192.168.20.1;
            option broadcast-address 192.168.20.6;
            default-lease-time 600;
            max-lease-time 7200;   


tkj:~# nano /etc/default/dhcp3-server
      INTERFACES="eth1"


tkj:~# /etc/init.d/dhcp3-server restart
      Stopping DHCP server: dhcpd3.
      Starting DHCP server: dhcpd3.




<<<<< DNS >>>>>

tkj:~# apt-get install bind9


tkj:~# nano /etc/bind/named.conf
      zone "tkj.com" {
            type master;
             file "/etc/bind/db.tkjcom.zone";
      };

      zone "20.168.192.in-addr.arpa" {
            type master;
            file "/etc/bind/db.tkjcom.rev";
      };

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


tkj:~# cd /etc/bind

tkj:/etc/bind# cp db.local db.tkjcom.zone

tkj:/etc/bind# cp db.127 db.tkjcom.rev

tkj:/etc/bind# cd


tkj:~# nano /etc/bind/db.tkjcom.zone
      ;
      ; BIND data file for local loopback interface
      ;
      $TTL    604800
      $ORIGIN tkj.com.
      @       IN      SOA     ns.tkj.com. admin.tkj.com. (
                                    2         ; Serial
                               604800         ; Refresh
                                86400         ; Retry
                              2419200         ; Expire
                               604800 )       ; Negative Cache TTL
      ;
      @       IN      NS      ns.tkj.com.
      @       IN      MX      10 mail.tkj.com.
      ns      IN      A       192.168.20.1
      server  IN      CNAME   ns
      www     IN      CNAME   ns
      mail    IN      CNAME   ns
      ftp     IN      CNAME   ns
      proxy   IN      CNAME   ns
      secure  IN      CNAME   ns
      @       IN      AAAA    ::1




tkj:~# nano /etc/bind/db.tkjcom.rev
      ;
      ; BIND reverse data file for local loopback interface
      ;
      $TTL    604800
      @       IN      SOA     ns.tkj.com. admin.tkj.com. (
                                    1         ; Serial
                               604800         ; Refresh
                                86400         ; Retry
                              2419200         ; Expire
                               604800 )       ; Negative Cache TTL
      ;
      @       IN      NS      ns.tkj.com.
      1       IN      PTR     192.168.20.1.


tkj:~# /etc/init.d/bind9 restart
      Stopping domain name service...: bind9.
      Starting domain name service...: bind9.


tkj:~# nano /etc/resolv.conf
      domain ns.tkj.com
      nameserver 127.0.0.1
      nameserver 100.100.100.20
      nameserver 192.162.20.1


tkj:~# nslookup

> set type=any

> tkj.com

> 192.168.20.1

> exit




<<<<< HTTP / Web Server >>>>>

tkj:~# apt-get install apache2 mysql-server mysql-client php5 php5-mysql


tkj:~# /etc/init.d/mysql restart
      Stopping MySQL database server: mysqld.
      Starting MySQL database server: mysqld.
      Checking for corrupt, not cleanly closed and upgrade needing tables..


tkj:~# mysql -u root -p
      Enter password:qwerty
      ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using    password: YES)


tkj:~# nano /etc/php5/apache2/php.ini
      ;   #extension=msql.so                    ß-- tambahkan
          extension=mysql.so


tkj:~# cd /etc/apache2/sites-available
      tkj:/etc/apache2/sites-available# cp default tkjcom
      tkj:/etc/apache2/sites-available# cd


tkj:~# nano /etc/apache2/sites-available/tkjcom
      <VirtualHost *:80>
      NameVirtualHost 192.168.20.1:80           ß-- edit dan tambahkan
              ServerAdmin webmaster@tkj.com
              ServerName www.tkj.com
              DocumentRoot /var/www/tkjcom
              <Directory />


      CustomLog /var/log/apache2/access.log combined
              ServerSignature On                ß-- tambahkan


tkj:~# mkdir -p /var/www/tkjcom


tkj:~# mkdir -p /usr/lib/cgi-bin


tkj:~# a2ensite tkjcom
     Site tkjcom already enabled


tkj:~# a2dissite default
      Site default already disabled


tkj:~# /etc/init.d/apache2 restart
tkj:~# nano /var/www/tkjcom/info.php
      <? phpinfo() ?>                           ß-- tambahkan

tkj:~# nano /var/www/tkjcom/index.html
      <html>                                    ß-- tambahkkan
      <body>
              "TKJ-B Is The Best"
      </body>
      </html>





<<<<< PROXY >>>>>


tkj:~# apt-get install squid


tkj:~# nano /etc/squid/squid.conf
      (( tekan ctrl+w dan ketikkan menu ))


acl all
      #Recommended minimum configuration:
      acl all src 192.168.20.0/24                     ß-- tambahkan
      acl blog dstdomain www.facebook.com
      acl all src all
      acl manager proto cache_object
      acl localhost src 127.0.0.1/32
      acl to_localhost dst 127.0.0.0/8


insert
      #http_access allow localnet
      http_access allow localhost
      acl blokdomain dstdomain www.facebook.com       ß-- tambahkan
      #http_access allow our_network
      http_access allow localhost
      http_access deny blog
      http_access allow lan

      # And finally deny all other access to this proxy
      http_access deny all


visible
      #Default:
      # none
      visible_hostname www.smkn9solo.sch.id           ß-- edit dan tambahkan


http_port 3128
      http_port 3128 transparent                      ß-- edit dan tambahkan


cache_mgr
      cache_mgr tkjb@yahoo.com                        ß-- edit dan tambahkan


cache_mem
       cache_mem 32 MB                                ß-- edit






tkj:~# nano /etc/rc.local
      iptables -A POSTROUTING -t nat -o eth -j MASQUERADE   < routing
     
      iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j REDIRECT
      --to-ports 3128                                       < proxy


tkj:~# nano /etc/squid/squid.conf
      (( tekan ctrl+w dan ketikkan menu ))


cache_dir ufs
      #Default:
       cache_dir ufs /var/spool/squid 6000 14 256           ß-- edit


cache_log
        TAG: cache_log                                ß-- hilangkan #
      #       Cache logging file. This is where general information about
      #       your cache's behavior goes. You can increase the amount of data
      #       logged to this file with the "debug_options" tag below.
      #
      #Default:
      # cache_log /var/log/squid/cache.log

        TAG: cache_store_log                          ß-- hilangkan #
      #       Logs the activities of the storage manager.  Shows which
      #       objects are ejected from the cache, and which objects are
      #       saved and for how long.  To disable, enter "none". There are
      #       not really utilities to analyze this data, so you can safely
      #       disable it.
      #
      #Default:
      # cache_store_log /var/log/squid/store.log



tkj:~# tail -f /var/log/squid/access.log

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Powerade Coupons