Saturday, October 30, 2010

LINUX apache directives..

#Section 1. Global configuration options
ServerRoot /etc/apache2
Listen 80
Timeout 120
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
User apache
Group apache
HostnameLookups On
LoadModule load_module1
LoadModule load_module2
LoadModule load_module3
ErrorLog /var/log/apache2/error.log
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/httpd.conf
Include /etc/apache2/ports.conf
Include /etc/apache2/conf.d/



#Section 2. Main server configuration options
ServerAdmin rahul300chaudhary400@gmail.com
ServerName example.com 80
DocumentRoot /var/www/html
DirectoryIndex index.html index.php index.txt
ErrorDocument 404 /errors/404.html
Options Indexes MultiViews


#Section 3. Directory Section
# Defaults for all directories
<Directory />
    Options FollowSymLinks
</Directory>
# Settings for DocumentRoot
<Directory “/var/www/html”>
    Options Indexes MultiViews
</Directory>
# Settings for /legal/
<Directory “/var/www/html/legal”>
    DirectoryIndex index.html
    ErrorDocument 404 /errors/legal/404.html
</Directory>



 Enable name-based virtual hosting
NameVirtualHost *.80
<VirtualHost *:80>
    ServerName www.example.org
    DocumentRoot /var/www/example.org
    #add other directives here
</VirtualHost>




Q3. Configuring DHCP

ddns-update-style interim;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
   #global parameters for the subnet
   option routers                  192.168.0.1;
   option subnet-mask              255.255.255.0;
   option domain-name              “example.com”;
   option domain-name-servers      192.168.1.1;
   range dynamic-bootp 192.168.0.128 192.168.0.254;
   default-lease-time 21600;
   max-lease-time 43200;
   # fixed address example
   host jadefox {
      next-server ns.example.com;
      hardware ethernet 12:34:56:78:AB:CD;
      fixed-address 192.168.0.4;
   }
}
shared-network third-floor {
   #global parameters for the shared network
   option routers                  192.168.0.1;
   option subnet-mask              255.255.255.0;
   option nis-domain               “example.com”;
   option domain-name              “example.com”;
   option domain-name-servers      192.168.1.1;
   default-lease-time 21600;
   max-lease-time 43200;
   subnet 192.168.10.0 netmask 255.255.255.0 {
      range dynamic-bootp 192.168.10.1 192.168.10.254;
   }
   subnet 192.168.20.0 netmask 255.255.255.0 {
      range dynamic-bootp 192.168.20.1 192.168.20.254;
   }
}
group {
   #common parameters for both host declarations
   option routers                  192.168.10.254;
   option subnet-mask              255.255.255.0;
   option domain-name              “example.com”;
   option domain-name-servers       192.168.10.24;
   default-lease-time 21600;
   max-lease-time 43200;
   host printer {
      option host-name “printer.example.com”;
      hardware ethernet 01:BE:BB:5E:1A:CC;
      fixed-address 192.168.10.7;
                                                   14
   }
   host payroll {
                                                   option host-name “payroll.example.com”;
                                                   hardware ethernet 02:B4:7C:43:DD:FF;
                                                   fixed-address 192.168.10.10;
   }
}

No comments:

Post a Comment