Tuesday, January 27, 2009

What is Split DNS?

Split DNS refers to using separate internal and external DNS views of your domain's network using internal and external name servers. To set up, configure your internal name servers to forward queries they can't resolve to the external name server. Under Berkeley Internet Name Domain (BIND) 4, use the "forwarders" directive. In BIND 8 systems, use the "forwarders" substatement to configure forwarding. Your external DNS records are configured to contain only a small zone file for your domain, listing things such as Web and FTP server addresses and any translated server addresses you want to publish to the world. Your internal servers hold only the DNS records for your internal networks. When internal users look up host names, the query is answered by internal DNS servers, even if the request is forwarded to an external DNS server for resolution. Internet users who look up host names in your domain are answered by external DNS servers that only know about the publicly accessible resources.
------------------------------------------------

To know more on this topic, please check the below link.
http://www.isaserver.org/tutorials/You_Need_to_Create_a_Split_DNS.html

Saturday, January 24, 2009

ssh script

Before executing this script, you need to know some details,

What Is Expect?

Expect is a UNIX automation and testing tool, written by Don Libes as an extension to the Tcl scripting language, for interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, ssh, and others. It uses UNIX pseudo terminals to wrap up sub-processes transparently, allowing the automation of arbitrary applications that are accessed over a terminal. With Tk, interactive applications can be wrapped in X11 GUIs. Expect has regular expression pattern matching and general program capabilities, allowing simple scripts to intelligently control programs such as telnet, ftp, and ssh, all of which lack a programming language, macros, or any other program mechanism. The result is that Expect scripts provide old tools with significant new power and flexibility.

The Script
**********
When a server keeps prompting for password at SSH attempts in spite of setting up RSA/DSA keys, this script can be used to overcome that issue. Make sure that the script has 700 permission as it will contain your password in plain text.
-------------------------------------------------------------------------
#! /usr/bin/expect


# Edit the following line - $USER@$SERVER
spawn ssh your-useid@your-server-name

# First time connection will print out some text for
# which one needs to type 'yes' to continue
# Comment these two lines after the first attempt
expect "*Are you sure you want to continue connecting*"
send "yes\r"

# Put the password here
expect "*assword*"
send "YOUR-PASSWORD\r"

# Start interacting
interact
--------------------------------------------------------------------------------------

The three commands send, expect, and spawn are the building power of Expect. The send command sends strings to a process, the expect command waits for strings from a process, and the spawn command starts a process.

The spawn Command

The spawn command starts another program. The first argument of the spawn command is the name of a program to start. The remaining arguments are passed to the program.


Thanks and Regards,
Sylesh H

Friday, January 23, 2009

Killing perl processes running.....

ps auxww | grep perl | awk '{print $2}' | xargs kill -9

Checking bad blocks in Linux

First find the hard disk type installed by running the command
fdisk -l

Run the following command to check the bad blocks in Hdd.
badblocks -v /dev/hda

It will display if there is any errors while checking the bad blocks..

Hope this Helps you.

Importanf files and its descriptions.

* /boot/vmlinuz - the typical location and name of the Linux kernel. In the Slackware distribution, the kernel is located at /vmlinuz.

* /dev/fd0 - first floppy disk drive

* /dev/fd0H1440 - driver for the first floppy drive in high density mode. Generally, this is invoked when formatting a floppy drive for a particular density. Slackware comes with drivers that allow for formatting a 3.5" diskette with up to 1.7MB of space. Red Hat and Mandrake do not contain these device driver files by default.

* /dev/fd1 - second floppy disk drive

* /dev/hda - first IDE hard drive

* /dev/hdc - on many machines, the IDE cdrom drive. Most often, there is a symbolic link called /dev/cdrom which is just a link to the true cdrom driver file.

* /dev/null - used when you want to send output into oblivion

* /etc/aliases - file containing aliases used by sendmail and other MTAs (mail transport agents). After updating this file, it is necessary to run the newaliases utility for the changes to be passed to sendmail.

* /etc/bashrc - system-wide default functions and aliases for the bash shell

* /etc/conf.modules - aliases and options for configurable modules

* /etc/crontab - shell script to run different commands periodically (hourly, daily, weekly, monthly, etc.)

* /etc/DIR_COLORS - used to store colors for different file types when using ls command. The dircolors command uses this file when there is not a .dir_colors file in the user's home directory. Used in conjunction with the eval command (see below).

* /etc/exports - specifies hosts to which file systems can be exported using NFS. Man exports contains information on how to set up this file for remote users.

* /etc/fstab - contains information on partitions and file systems used by system to mount different partitions and devices on the directory tree

* /etc/HOSTNAME - stores the name of the host computer

* /etc/hosts - contains a list of host names and absolute IP addresses.

* /etc/hosts.allow - hosts allowed (by the tcpd daemon) to access Internet services

* /etc/hosts.deny - hosts forbidden (by the tcpd daemon) to access Internet services

* /etc/group - similar to /etc/passwd but for groups

* /etc/inetd.conf - configures the inetd daemon to tell it what TCP/IP services to provide (which daemons to load at boot time). A good start to securing a Linux box is to turn off these services unless they are necessary.

* /etc/inittab - runs different programs and processes on startup. This is typically the program which is responsible for, among other things, setting the default runlevel, running the rc.sysinit script contained in /etc/rc.d, setting up virtual login terminals, bringing down the system in an orderly fashion in response to [Ctrl][Alt][Del], running the rc script in /etc/rc.d, and running xdm for a graphical login prompt (only if the default runlevel is set for a graphical login).

* /etc/issue - pre-login message. This is often overwitten by the /etc/rc.d/rc.S script (in Slackware) or by the /etc/rc.d/rc.local script (in Mandrake and Red Hat, and perhaps other rpm-based distributions). The relevant lines should be commented out (or changed) in these scripts if a custom pre-login message is desired.

* /etc/lilo.conf - configuration file for lilo boot loader

* /etc/motd - message of the day file, printed immediately after login. This is often overwritten by /etc/rc.d/rc.S (Slackware) or /etc/rc.d/rc.local (Mandrake/Red Hat) on startup. See the remarks in connection with /etc/issue.

* /etc/mtab - shows currently mounted devices and partitions and their status

* /etc/passwd - contains passwords and other information concerning users who are registered to use the system. For obvious security reasons, this is readable only by root. It can be modified by root directly, but it is preferable to use a configuration utility such as passwd to make the changes. A corrupt /etc/passwd file can easily render a Linux box unusable.

* /etc/printcap - shows the setup of printers

* /etc/profile - sets system-wide defaults for bash shell. It is this file in Slackware that sets up the DIR_COLORS environment variable for the color ls command. Also sets up other system-wide environment variables.

* /etc/resolv.conf - contains a list of domain name servers used by the local machine

* /etc/securetty - contains a list of terminals on which root can login. For security reasons, this should not include dialup terminals.

* /etc/termcap - ASCII database defining the capabilities and characteristics of different consoles, terminals, and printers

* /etc/X11/XF86Config - X configuration file. The location in Slackware is /etc/XF86Config.

* /proc/cpuinfo - cpu information

* /proc/filesystems - prints filesystems currently in use

* /proc/interrupts - prints interrupts currently in use

* /proc/ioports - contains a list of the i/o addresses used by various devices connected to the computer

* /proc/kcore - The command ls -l /proc/kcore will give the amount of RAM on the computer. It's also possible to use the free command to get the same information (and more).

* /proc/version - prints Linux version and other info

* /var/log/messages - used by syslog daemon to store kernel boot-time messages

* /var/log/lastlog - used by system to store information about last boot

* /var/log/wtmp - contains binary data indicating login times and duration for each user on system.

Tuesday, January 20, 2009

How To Install CPANEL on your VPS

Ok. Few Steps to setup your VPS-CPANEL:

1 - Login to your VZMC and get inside your server
2 - Create a new VPS with the Sample Ve Config call vps.cpanel
3 - Select the ips you want to use in that VPS and the dns servers.
4 - Select RedHat Enterprise Template (not minimal)
5 - Dont select any addon.You dont need it for cpanel.
6 - Select the Space / Memory / CPU . All the normal stuff of your normal VPS. Put Start on boot and the rest of the normal stuff. Rememeber to use unlimited VPs.
7 - Go to your Ev1 Member section, open a ticket with your IP / and root password and request ev1 to get your VPS register in up2date. CHECK IT IF IT IS WELL CONFIGURE!! JUST IN CASE.
8 - Go in ssh and do the following steps:
mkdir /home/cpins
cd /home/cpins
wget http://layer1.cpanel.net/latest
sh latest
This should install cpanel without asking you any questions.

If you have any problems you should check: http://www.cpanel.net/install.html

9 - Login to : https://xxx.xxx.xxx.xxx:2087 and setup your server.
If you never setup a cpanel server, you can find some usefull information here: http://www.cpanel.net/docs.htm or search ev1 forum or ask me. I will be happy to help.

Well. Hopefully for some of you was usefull and will give you something else to try/offer in your VPS server.

Btw, it needs atleast 128 MB for cpanel to work.

If you have any problems with the guide let me know.

carlos

ps: i talk to some sw-soft people and they recomend to enable second-level quota (QUOTAUGIDLIMIT), i didnt try it myself. But i will let everyone when i try it.

Filesystem attributes.

As a Linux administrator, you may be called upon to set up a control system for file access. You probably already know how to set read, write, and execute permissions on files, and you will need to make extensive use of that knowledge. But, sometimes, you'll need more than just these permissions settings to get the job done. That's where filesystem attributes will come in handy. You can set different attributes on files in order to gain more control over how they are accessed.

There are two slight catches, though. You can only set file attributes on machines with hard drives that are formatted with either the ext2 or ext3 filesystems. That's not a problem for machines that are running a Red Hat-type operating system, since ext3 is your only choice with them. But, if you're setting up a machine with, say, Ubuntu Server, you'll have other filesystems to choose from. Just be sure to choose ext3 if you want to set file attributes.

Also, if you're accessing files on another computer via NFS, the attributes will still be in effect, but you won't be able to view or change the attributes.

To view file attributes, you'd use the lsattr command. Entering just the command by itself will show a list of all files in the current directory.

[sylesh@centos5 ~]$ lsattr
------------- ./mytext.txt
------------- ./Duron_backup
------------- ./iptables-L.txt
------------- ./New_error.txt
------------- ./Desktop
------------- ./moodle-2007-8-25
------------- ./test_dir
------------- ./BOINC
------------- ./ts2_client_rc2_2032.tar.bz2
------------- ./OOo_2.3.0_LinuxIntel_install_wJRE_en-US.tar.gz
------------- ./ifconfig_output.txt
------------- ./dmesg
------------- ./BOINC.tar.bz2
------------- ./ts2_client_rc2_2032
------------- ./tls_handshake_error.txt
[sylesh@centos5 ~]$ lsattr mytext.txt
------------- mytext.txt
[sylesh@centos5 ~]$
[sylesh@centos5 ~]$ chattr +A mytext.txt
[sylesh@centos5 ~]$ lsattr mytext.txt
s-S----A----- mytext.txt
[sylesh@centos5 ~]$

Of course, you'll seldom want to use the "A" attribute. If you need to turn off atime updates, you're better off mounting the filesystem with the "noatime" parameter, instead.

So far, we've performed all attribute changes with only normal user privileges, and on the user's own files. There are still two other attributes that can only be set with root privileges. Even if the file belongs to you, you'll receive an error if you try to change them with only your normal user privileges.

[sylesh@centos5 ~]$ chattr +a mytext.txt
chattr: Operation not permitted while setting flags on mytext.txt
[sylesh@centos5 ~]$

The "a" attribute will allow a file to be opened only in append mode. This will allow you to add more text or data to a file, but will not allow you to overwrite it.

[sylesh@centos5 ~]$ sudo chattr +a mytext.txt
Password:
[sylesh@centos5 ~]$ lsattr mytext.txt
s-S--a-A----- mytext.txt
[sylesh@centos5 ~]$ echo "This is a test of the a attribute." > mytext.txt
bash: mytext.txt: Operation not permitted
[sylesh@centos5 ~]$ echo "This is a test of the a attribute." >> mytext.txt
[sylesh@centos5 ~]$

The final attribute we'll cover, which also requires root privileges, is the "i" attribute. This make a file immutable. In other words, it can't be changed, renamed, or deleted. And, no links can be created to it.

[sylesh@centos5 ~]$ sudo chattr +i mytext.txt
[sylesh@centos5 ~]$ lsattr mytext.txt
s-S-ia-A----- mytext.txt
[sylesh@centos5 ~]$ rm mytext.txt
rm: remove write-protected regular file `mytext.txt'? y
rm: cannot remove `mytext.txt': Operation not permitted
[sylesh@centos5 ~]$

Finally, if you need to add or delete more than one attribute, you can combine the operations into one single command.

[sylesh@centos5 ~]$ sudo chattr -AaisS mytext.txt
[sylesh@centos5 ~]$ lsattr mytext.txt
------------- mytext.txt
[sylesh@centos5 ~]$

There are a few other attributes that we haven't covered. But they either have operational bugs, or they're attributes that are set by the system, and not by the user.

For more information, enter "man chattr" at the command-line.


Sylesh

Monday, January 19, 2009

What is a name server ?

A Name Server keeps information for the translation of computer names to IP addresses (even for reverse translations). The name server takes care of a certain part from the space of names of all computers. This part is called the zone (at minimum it takes care of zone 0.0.127.in-addr.arpa). A domain or its part creates the zone. The name server can with the help of an NS type record (in its configuration) delegate administration of a subdomain to a subordinate name server. The name server is a program that performs the translation at the request of a resolver or another name server. In UNIX, the name server is materialized by the named program. Also the name BIND (Berkeley Internet Name Domain) is used for this name server.

Types of name servers differ according to the way in which they save data:

> Primary name server/primary master is the main data source for the zone. It is the authoritative server for the zone. This server acquires data about its zone from databases saved on a local disk. Names of these types of servers depend on the version of BIND they use. While only the primary name server was used for version 4.x, a primary name master is used for version 8. The administrator manually creates databases for this server. The primary server must be published as an authoritative name server for the domain in the SOA resource record, while the primary master server does not need to be published. There is only one of this type of server for each zone.

> Master name server is an authoritative server for the zone. The master server is always published as an authoritative server for the domain in NS records. The master sever is a source of data of a zone for the subordinate servers (slave/secondary servers). There can be several master servers. This type of server is used for Bind version 8 and later.

> Secondary name server/slave name server acquires data about the zone by copying the data from the primary name server (respectively from the master server) at regular time intervals. It makes no sense to edit these databases on the secondary name servers, although they are saved on the local server disk because they will be rewritten during further copying. This type of name server is also an authority for its zones, i.e., its data for the particular zone is considered irrevocable (authoritative). The name of this type of server depends again on the version of BIND it uses. For version 4, only the secondary name was used, the term slave server was used for a completely different type of server. In version 8 you can come across both names.

> Caching-only name server is neither a primary nor secondary name server (it is not an authority) for any zone. However, it uses the general characteristics of name servers, i.e., it saves data that comes through its cache. This data is called nonauthoritative. Each server is a caching server, but by the words caching, we understand that it is neither a primary nor secondary name server for any zone. (Of course, even a caching-only server is a primary name server for zone 0.0.127.in-addr.arpa, but that does not count).

> Root name server is an authoritative name server for the root domain (for the dot). Each root name server is a primary server, which differentiates it from other name servers.

> Slave name server (in BIND version 4 terminology) transmits questions for a translation to other name servers; it does not perform any iteration itself.

> Stealth name server is a secret server. This type of name server is not published anywhere. It is only known to the servers that have its IP address statically listed in their configuration. It is an authoritative server. It acquires the data for the zone with the help of a zone transfer. It can be the main server for the zone. Stealth servers can be used as a local backup if the local servers are unavailable.

Thursday, January 15, 2009

Nagios in control.


Nagios.


Nagios is a popular open source computer system and network monitoring application software. It watches hosts and services, alerting users when things go wrong and again when they get better.

Adding a new server.

Nagios Administration


This will help you in adding a new server to Nagios


1. Introduction

2. Adding Contacts

3. Adding Hosts

4. Adding Host Groups

5. Adding Services

6. Scheduling Host/Service Downtime

7. Acknowledging a host/services

8. Authentication Setup


In NAGIOS SERVER




contacts.cfg

Defines who gets notifications about problems with hosts and services.


define contact{
contact_name sylesh
alias syslogs
service_notification_period none ; Notification period
host_notification_period 24x7 ; Notification period
service_notification_options c,r ; Notification Options
host_notification_options d,r ; Notification Options
service_notification_commands notify-by-email ; Notification cmd
service_notification_options n ; Notification cmd
host_notification_commands host-notify-by-email
email syleshh@gmail.com
}





contactgroups.cfg


Add the user to the appropriate department/server group he/she needs to be a member of


define contactgroup{
contactgroup_name testgroup ; Group Name
alias mycutelife ; Alias for group
members testuser ; List of members. This user has the privilege to view the status of the
servers which is listed in the group
}





hostgroups.cfg


This allows you to create groups to organise the hosts

define hostgroup{
hostgroup_name testhostgroup
alias syslogs
contact_groups testgroup
members server1.hostname.com,server2.hostname.com,server3.hostname.com,server4.hostname.com
}





hosts.cfg

This contains all the devices you want nagios to check

#############First Server#############
define host{
use generic-host ; Name of host template to use
host_name server1.hostname.com
alias server1
address 192.168.1.1
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}
#############Second Server#############
define host{
use generic-host ; Name of host template to use
host_name server2.hostname.com
alias server2
address 192.168.1.2
check_command check-host-alive
max_check_attempts 10
notification_interval 120
notification_period 24x7
notification_options d,u,r
}





services.cfg

If we give host_name (host_name test.test.com) in place of hostgroup_name, we have to add each service entries to be monitored for each server. But if we give hostgroup_name and all hosts or servers are defined in the file hostgroups.cfg, we need only one entry for each service for all servers.

#########We can define the services to monitor#############
#########Apache#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description Apache status
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_http
}
#########MTA#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description MTA status
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_smtp
}
#########QMAIL Queue#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description QMAIL-Q
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_qmailq
}
#########Exim Queue#########
define service{

use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description EXIM_QUEUE
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_eximmailqueue
}


#########FTP#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description FTP status
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
contact_groups testgroup
retry_check_interval 1
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_ftp
}
#########Server Load#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description SYS-LOAD
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_load
}
#########MYSQL#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description MYSQL
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_mysqlrc
}
#########DNS#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description DNS
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_dns
}
#########SSH#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description SSH
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_ssh
}


#########POP#########
# Service definition
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description POP3
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_pop
}
#########DISK_USAGE_SLASH#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description DISK_USAGE_SLASH
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_diskslash
}
#########DISK_USAGE_BOOT#########
define service{
use generic-service ; Name of service template to use
hostgroup_name testhostgroup
service_description DISK_USAGE_BOOT
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_diskboot
}
#########DISK_USAGE_BACKUP#########
define service{
hostgroup_name testhostgroup
service_description DISK_USAGE_BACKUP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_diskbackup
}
#########DISK_USAGE_HOME#########
define service{
hostgroup_name testhostgroup
service_description DISK_USAGE_HOME
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_diskhome
}
#########DISK_USAGE_TMP#########
define service{
hostgroup_name testhostgroup
service_description DISK_USAGE_TMP
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_disktmp
}
#########DISK_USAGE_USR#########
define service{
hostgroup_name testhostgroup
service_description DISK_USAGE_USR
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_diskusr
}
#########DISK_USAGE_VAR#########
define service{
hostgroup_name testhostgroup
service_description DISK_USAGE_VAR
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups testgroup
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_diskvar
}



--------------------------------------------------------------------------
Sylesh

Sunday, January 11, 2009

apachectl - Apache HTTP Server Control Interface

apachectl - Apache HTTP Server Control Interface


apachectl is a front end to the Apache HyperText Transfer Protocol (HTTP) server. It is designed to help the administrator control the functioning of the Apache httpd daemon.

The apachectl script can operate in two modes. First, it can act as a simple front-end to the httpd command that simply sets any necessary environment variables and then invokes httpd, passing through any command line arguments. Second, apachectl can act as a SysV init script, taking simple one-word arguments like start, restart, and stop, and translating them into appropriate signals to httpd.

If your Apache installation uses non-standard paths, you will need to edit the apachectl script to set the appropriate paths to the httpd binary. You can also specify any necessary httpd command line arguments. See the comments in the script for details.

The apachectl script returns a 0 exit value on success, and >0 if an error occurs. For more details, view the comments in the script.

Synopsis

When acting in pass-through mode, apachectl can take all the arguments available for the httpd binary.

apachectl [ httpd-argument ]

When acting in SysV init mode, apachectl takes simple, one-word commands, defined below.

apachectl command


Options

Only the SysV init-style options are defined here. Other arguments are defined on the httpd manual page.

start
Start the Apache httpd daemon. Gives an error if it is already running. This is equivalent to apachectl -k start.
stop
Stops the Apache httpd daemon. This is equivalent to apachectl -k stop.
restart
Restarts the Apache httpd daemon. If the daemon is not running, it is started. This command automatically checks the configuration files as in configtest before initiating the restart to make sure the daemon doesn't die. This is equivalent to apachectl -k restart.
fullstatus
Displays a full status report from mod_status. For this to work, you need to have mod_status enabled on your server and a text-based browser such as lynx available on your system. The URL used to access the status report can be set by editing the STATUSURL variable in the script.
status
Displays a brief status report. Similar to the fullstatus option, except that the list of requests currently being served is omitted.
graceful
Gracefully restarts the Apache httpd daemon. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted. A side effect is that old log files will not be closed immediately. This means that if used in a log rotation script, a substantial delay may be necessary to ensure that the old log files are closed before processing them. This command automatically checks the configuration files as in configtest before initiating the restart to make sure Apache doesn't die. This is equivalent to apachectl -k graceful.
configtest
Run a configuration file syntax test. It parses the configuration files and either reports Syntax Ok or detailed information about the particular syntax error. This is equivalent to apachectl -t.

The following additional option is available, but deprecated.

startssl
This is equivalent to apachectl -k start -DSSL. We recommend that you use that command explicitly, or you adjust your httpd.conf to remove the section so that SSL will always be available.
Sylesh

Friday, January 9, 2009

#Difference between ext2 and ext3??

#Difference between ext2 and ext3??

Ext3 is a tiny bit slower than ext2 is, but it holds tremendous advantages.
There is really only one difference between ext2 and ext3, and that is that ext3 uses a journal to prevent filesystem corruption in the case of an unclean shutdown (ie. before the filesystem is synced to disk). That makes ext3 a bit slower than ext2 since all metadata changes are written to the journal, and then flushed to disk, but on the other hand you don't risk having the entire filesystem destroyed at power failure or if an unwitted person turns the computer off uncleanly. You don't have to check the filesystem after an unclean shutdown either.
Ext3 has three levels of journalling. Metadata (ie. internal filesystem structures) are always journalled, so that the filesystem itself is never corrupted. How ordinary data is written to the file system is controllable, though. The default option is the "ordered" mode, which causes file contents to be written to the filesystem before metadata is even committed to the journal. The highest reliable mode is called the "journal" mode, which causes file data to be committed to the journal before it is flushed to its final place, like the metadata. The least reliable mode, but rumoured to be the fastest, is called the "writeback" mode, which makes no promises at all regarding the consistency of file data. Only metadata is output reliably in writeback mode.

So as for anything else, it's mainly a matter of priority. If you don't want ultimate speed, go with ext3. If you need the highest speed that is theoratically aquirable though, then go with ext2. For that to be effective you'll probably need a really advanced hard drive controller, though.

It's very easy to convert an ext2 filesystem to ext3. Just run tune2fs -j on the device and then remount it as ext3.

------------------------------------------------------------------------------

#.what is the difference between a soft link and a hard link?

#.what is the difference between a soft link and a hard link?

Unix files consist of two parts: the data part and the filename part.

The data part is associated with something called an 'inode'. The inode carries the map of where the data is, the file permissions, etc. for the data.

The filename part carries a name and an associated inode number.

More than one filename can reference the same inode number; these files are said to be 'hard linked' together.

On the other hand, there's a special file type whose data part carries a path to another file. Since it is a special file, the OS recognizes the data as a path, and redirects opens, reads, and writes so that, instead of accessing the data within the special file, they access the data in the file named by the data in the special file. This special file is called a 'soft link' or a 'symbolic link' (aka a 'symlink').
more..

Hard Links :

1. All Links have same inode number.

2.ls -l command shows all the links with the link column(Second) shows No. of links.

3. Links have actual file contents

4.Removing any link ,just reduces the link count , but doesn’t affect other links.

Soft Links(Symbolic Links) :

1.Links have different inode numbers.

2. ls -l command shows all links with second column value 1 and the link points to original file.

3. Link has the path for original file and not the contents.

4.Removing soft link doesn’t affect anything but removing original file ,the link becomes “dangling” link which points to nonexistant file.