Pages

Showing posts with label Debian server. Show all posts
Showing posts with label Debian server. Show all posts

Tuesday, January 11, 2011

Transparent Proxy server

1. Install squid if it is not:
    # apt-get install squid

2. Create a Transparent Proxy squid so (meaning the client does not need to enterproxy settings
    in the Browser / automatic)
    # mcedit /etc/squid/squid.conf

    rules that allow ip Networks 192.168.10.0/29
    acl src 192.168.10.0/29 http_access allow local local

    in mcedit press F7 to search. Search for "http_port 3128"
    http_port 3128
    plus / replaced by:
    3128 http_port transparent

3. Restart the Squid service
     #/etc/init.d/squid restart


4. Forced redirect all Web requests (port 80) to keep it through the port Squid
     (port 3128)
     # iptables-A PREROUTING-p tcp --dport 80-j REDIRECT - to-port 3128-- t nat
      But iptables setting is only temporary, will be lost upon reboot
 
      How to Permanently:
     a. Redirect port 80 to 3128
          # iptables-A PREROUTING-p tcp --dport 80-j REDIRECT - to-port-3128-t nat

      b. Save the file anywhere, eg: / etc / iptables.rules
          # iptables-save> / etc / iptables.rules

        c. Edit / Add on the bottom row / etc / network / interfaces:
            pre-up iptables-restore </etc/iptables.rules post-down iptables-save> /etc/iptables.rules

5. Restart the Squid service
     #/etc/init.d/squid restart

Webserver Configurations

Apache and PHP support is installed
1. Setting domain name and Web Server in order to qualify FQDN (Fully Qualified Domain  
     Name). Edit the Apache2 configuration file
     # mcedit /etc/apache2.httpd.conf

     Fill with:
     servername www.lks10.sch.id

2. Restart the Apache2 service
     # /etc/init.d/apache2 restart
 
3. Edit Homepage, document root in / var / www
     To prove that the PHP path, discard and use index.php index.html
     # cp /var/www/index.html /var/www/index.php
     # rm /var/html/index.html


4. Create / Edit PHP script / var / www / index.php
     # mcedit /var/www/index.php

     <html> <head> </ head> <body>Welcome <h1> LKS10 Server </ h1>
     <hr>
      <h3>This server supports PHP
      <? echo phpinfo ();?>
       </ h3>
       </ body> </ html>

Build DHCP Server with dnsmasq

Dnsmasq DHCP server again
1. Edit / etc / dnsmasq.conf:
   # mcedit /etc/dnsmasq.conf

    Add on the bottom row:
    domain = lks.sch.id
    dhcp-range = 192.168.10.2,192.168.10.5,12h  h range and the lease time 12h
    dhcp-option = 1,255.255.255.248  1 means netmask
    dhcp-option = 3,192.168.10.1  3 meaning gateway / default route
    dhcp-option = 6,192.168.10.1  6 mean DNS server
    dhcp-option = 28,192.168.10.7  28 means broadcast address

2. Restart service
    # /etc/init.d/dnsmasq restart