Saturday, June 23, 2012

Install webmin on Ubuntu 10.10

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl

Download libmd5-perl and install it by dpkg -i

Download webmin_1.510-2_all.deb and install by dpkg -i

If you got errors while installing webmin, type this command:



sudo apt-get -f install

 Now  restart  webmin

sudo /etc/init.d/webmin  restart 

 To access webmin, open your browser and type :

https://localhost:10000  or https://your-ip:10000

source: http://www.unixmen.com/install-webmin-in-ubuntu-1010-maverick-meerkat/

Install and configure DHCP Server on Ubuntu 10.10 desktop

On the Ubuntu 10.10 machine

apt-get install dhcp3-server

nano /etc/default/dhcp3-server

INTERFACES="eth0"

Alt + F2

gksudo gedit

go to /etc/dhcp3/dhcpd.conf

option domain-name "sourav.com";
option domain-name-servers souravubuntu.sourav.com;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option routers 192.168.10.201;


default-lease-time 600;
max-lease-time 7200;

subnet 192.168.10.0
netmask 255.255.255.0
{
 range 192.168.10.190 192.168.10.195;

}

/etc/init.d/dhcp3-server restart


On the linux Client machine

nano /etc/network/interfaces

auto lo

iface lo inet loopback

save the file

go to terminal

 sudo dhclient

(you will see the full DORA process)



Friday, June 22, 2012

Caching only dns server using Ubuntu Desktop 10.10

Here are the steps.

apt-get remove NetworkManager

nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address   192.168.10.10
netmask   255.255.255.0
network   192.168.10.0
broadcast 192.168.10.255
gateway   192.168.10.201

/etc/init.d/networking restart

apt-get install bind9 dnsutils bind9-doc

nano /etc/bind/named.conf.local

forwarders{
                8.8.8.8;
                4.2.2.2;
                8.8.4.4;
         };

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

nano /etc/bind/named.conf.local

#Forward Lookup Zone
zone "sourav.com" {
type master;
file "/etc/bind/db.sourav.com";

};
#Reverse Lookup Zone

zone "10.168.192.in-addr.arpa"

{
type master;
notify no;
file "/etc/bind/db.192";

};

nano /etc/bind/db.sourav.com

;
; BIND data file for local loopback interface
;
$TTL    604800
@    IN    SOA    souravubuntu.sourav.com. sourav.localhost. (
                  2        ; Serial
             604800        ; Refresh
              86400        ; Retry
            2419200        ; Expire
             604800 )    ; Negative Cache TTL
;
@    IN    NS    souravubuntu.sourav.com.
@    IN    A    127.0.0.1
@    IN    AAAA    ::1
;Below are A Record Addresses

itguru       IN      A        192.168.10.201
souravubuntu IN      A        192.168.10.10
client       IN      A        192.168.10.101

;  


server1      IN      CNAME     souravubuntu.sourav.com.
gw           IN      CNAME     itguru.sourav.com.

   

nano /etc/bind/db.192

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@    IN    SOA    souravubuntu.sourav.com. sourav.localhost. (
                  1        ; Serial
             604800        ; Refresh
              86400        ; Retry
            2419200        ; Expire
             604800 )    ; Negative Cache TTL
;
@    IN    NS    souravubuntu.sourav.com.
10      IN      PTR     souravubuntu.sourav.com.
201     IN      PTR     itguru.sourav.com.
101      IN      PTR     client.sourav.com.
  
nano /etc/resolv.conf

nameserver 192.168.10.10
domain sourav.com
search sourav.com

nano /etc/hosts


127.0.0.1    souravubuntu   localhost.localdomain    localhost
127.0.1.1    souravubuntu

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

/etc/init.d/bind9 restart

Help:http://mixeduperic.com/ubuntu/seven-easy-steps-to-setting-up-an-interal-dns-server-on-ubuntu.html


Monday, June 11, 2012

Simple apache configuration

nano /etc/httpd/conf/httpd.conf

NameVirtualHost 192.168.240.142
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
[VirtualHost 192.168.240.142]

    ServerAdmin root@www.sourav.com
    DocumentRoot /var/www/virtual/www.sourav.com/html
    ServerName www.sourav.com
    ErrorLog logs/www.sourav.com-error_log
    CustomLog logs/www.sourav.com-access_log common

[/VirtualHost]