Tuesday, May 17, 2011

Question from Apache


1. In which folder are Java Applications stored in Apache?
Java applications are not stored in Apache, it can be only
connected to a other Java webapp hosting webserver using the
mod_jk connector
2.Is running apache as a root is a security risk?
No.root process opens port 80, but never listens to it, so
no user will actually enter the site with root rights. If
you kill the root process, you will see the other kids
disappear as well.
3.If you specify both deny from all and allow from all, what will be the default action of Apache?
deny will be taken first.
4.What does htpasswd do?
The htpasswd protects a file with a password
5.What is mod_vhost_alias?
This module creates dynamically configured virtual hosts, by allowing the IP address and/or the Host: header of the HTTP request to be used as part of the pathname to determine what files to serve. This allows for easy use of a huge number of virtual hosts with similar configurations.
6.What is ServerType directive?
It defines whether Apache should spawn itself as a child process (standalone) or keep everything in a single process (inetd). Keeping it inetd conserves resources. This is deprecated, however.
7.How do you set up a virtual host in Apache?
ServerAdmin admin@test.com
DocumentRoot /home/apache/share/htdocs/hostedsites
ServerName www.test.com
ErrorLog /home/apache/logs/error/hostedsites/error_log
TransferLog /home/apache/logs/access/hostedsites/access_log
8.How do you check for the httpd.conf consistency and any errors in it?
apachectl configtest
9.What does apachectl graceful do?
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.
Actually it sends a SIGUSR1 for a restart. The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they’re not serving anything). The parent re-reads its configuration files and re-opens its log files. As each child dies off the parent replaces it with a child from the new generation of the configuration, which begins serving new requests immediately.
10.What is the command to stop Apache?
service httpd stop & apachectl stop
11.On a fresh install, why does Apache have three config files – srm.conf, access.conf and httpd.conf?
The first two are remnants from the NCSA times, and
generally you should be ok if you delete the first two, and
stick with httpd.conf.
12.Hi, When i’m starting startup.bat file of Tomcat server it isn’t started. DOS window appears for a Second only. What should I do?
Your set up might have been not done well. Make sure you have added tomcat root directory path in the CATALINA_HOME environment variable and added the bin path in the path variable
13.What is the difference between Tomcat 4.1 and Tomcat 5.0?
Web server (for development) that supports servlets 2.3 and JSP 1.2 (Tomcat 4) or servlets 2.4 and JSP 2.0 (Tomcat 5).
14.please let me know the configuration or architecture how
tomcat used. give me a layman example The Architecture of Tomcat
Tomcat 4 is a complete rewrite of its ancestors. At the core of this rewrite is the Catalina servlet engine, which acts as the top-level container for all Tomcat instances.
With this rewrite of Tomcat comes an entirely new architecture composed of a grouping of application containers, each with a specific role. The sum of all of these containers makes up an instance of a Catalina engine.
The following code snippet provides an XML representation of the relationships between the different Tomcat containers:
This instance can be broken down into a set of containers including a server, a service, a connector, an engine, a host, and a context. By default, each of these containers is configured using the server.xml file, which we describe
later in more detail.
The Server
The first container element referenced in this snippet is the element. It represents the entire Catalina servlet engine and is used as a top-level element for a single Tomcat instance. The element may contain one or more containers.
The Service
The next container element is the element, which holds a collection of one or more elements that share a single element. N-number of elements may be nested inside a single element.
The Connector
The next type of element is the element, which defines the class that does the actual handling requests and responses to and from a calling client application.
The Engine
The third container element is the element. Each defined can have only one element, and this single component handles all requests received by all of the defined components defined by a parent service.
The Host
The element defines the virtual hosts that are contained in each instance of a Catalina . Each can be a parent to one or more Web applications, with each being represented by a component.
The Context
The element is the most commonly used container in a Tomcat instance. Each element represents an individual Web application that is running within a defined . There is no limit to the number of contexts that can be defined within a .
15.what is tomcat?can we deploy a servelet in tomcat?
Tomcat is a webserver, Which is support 3 -tier archeticture..
Yes we can
in web.xml


16.if i delete my java class files after the compile?but it does not goes to the recycle bin.Now i want to get the java class file
Yes  you can
17.what  is different between web server and application server?
Web server supports only http protocol
Where as application server supports any type of protocols such as tcp/ip,http etc..
18.what is webserver? why it is used ?
Transaction with HTTP request and HTTP response is called webserver.
Using the internet listening the HTTP request and providing the HTTP response is also called webserver.It gives only html output.It will not process business logic .They can provide Http server.They are static.
19. Can we use Active Server Pages (ASP) with Apache?
Apache Web Server package does not include ASP support.
However, a number of projects provide ASP or ASP-like
functionality for Apache. Some of these are:
Apache::ASP
mod_mono
Chilisoft ASP
20.Why doesn’t Apache include SSL?
SSL (Secure Socket Layer) data transport requires encryption, and many governments have restrictions upon the import, export, and use of encryption technology.
If Apache included SSL in the base package, its distribution would involve all sorts of legal and bureaucratic issues, and it would no longer be freely
available.
Also, some of the technology required to talk to current clients using SSL is patented by RSA Data Security, who restricts its use without a license.
21.Does Apache come with Java support?
The base Apache Web server package does not include support for Java
22.This is very strange.
I am running apache 2.2 (compiled with gcc and all default params) on
AIX 5.2.0.6 – 64 bit kernel.
I edit the httpd.conf file to listen on two different
ports –
Listen 8000
Listen 8001
The server will not start no errors or anything it just accepts the
command but nothing starts.
I can comment out on of the entires and everything starts up just fine
minus the commented out port.
Listen 8000
#Listen 8001
So, my problem is that I cannot get apache to listen on two ports, any
ideas? Has someone else seen this before?
Thanks,
try setting environment flag:
ac_cv_o_nonblock_inherited=no
just before running configure…
and also
apache is a server.we can run each server in unique listen port so we are unable to run same server in two different ports.but u can run on different unique ports. in apache webserver u change that  in httpd.conf listen
port to 8080 (default is 80).that listen port belongs to http port for reciving requests and send responces.so please try to understand that which port belongs to which one.
23.Does Apache include any sort of database integration?
Apache is a Web (HTTP) server, not an application server. The base package does not include any such functionality. See the PHP project and the mod_perl project
for examples of modules that allow you to work with databases from within the Apache environment.
24.What is Apache?
Apache is a freely available Web server that is distributed under an “open source” license. Version 2.0 runs on most Unix-based operating systems (such as Linux, Solaris,Digital UNIX, and AIX), on other UNIX/POSIX-derived systems(such as Rhapsody, BeOS, and BS2000/OSD), on AmigaOS, and on Windows 2000. According to the Netcraft (www.netcraft.com)
Web server survey in February, 2001, 60% of all Web sites on the Internet are using Apache (62% including Apache derivatives), making Apache more widely used than all other Web servers combined.
25.Does  Apache act as a Proxy server?
Yes, It acts as proxy also by using the mod_proxy module

Red Hat Interview Questions


1.In which File is Static IP address given so that it becomes Permanent?
/etc/sysconfig/network-scripts/ifcfg-eth0
2.To Check Which Service is running at Present in System what is the Command?
service –status-all
ps –ef
3.How to trace any process background processing?
ps -aux
4.How to build new filesystem ? and what is irig file system?
mke2fs /dev/hda(sda)
mkfs
mk
5.Which command is used to see all the system configuration?
like hardware, HDD, memory etc.
lspci -vv
6.What is the difference between Telnet and SSH?
ssh is a secured shell, where telnet is not a secured
one.when you ssh to trasnfer data between a system, the data
will be send in the encrypted form, where the hacker cannot
encode or decode it. While you telnet,the data send between
the system is alphabetical format(ASCII), where every one
can understand. More over as per network security, telnet
and ftp are prohibited. Always, trust SSL based data transfer.
7.What is the difference between unix and linux…
graphics is the main difference
extra more command are in linux
userfriendly then unix
8.what is mean by raid and what are all raids available even in software and hardware?
Raid Stands for Redundant Array of Independent Disks.It is
a set of Technology standards for Teamingup DiskDrives to
improve Performence and FaultTolerance. Totally there are 6
levels in Raid
0 – stripping
1 – Mirroring
2 – Stripping and Mirroring
3 – Onfficially Not Defined
4 – Striping with Differential Parity
5 – Striping with Distributional Parity
9.why the kernel panic error was appering?
kernel panic acured when linux kernel can not communicat with any hardware or any OS related file
10.What are the main differences between RHEL4 & RHEL5?
Of course RHEL5 security is the main advantage than RHEL4
in RHEL5 it has the updates like XEN, Yum and many
additional packages which supports all the third party softwares
11. How To Hide the FTP Version?
Stop httpd service.
12.what is difference between inetd and xinetd ?
The major difference between inetd and the newer xinetd is that inetd uses a single configuration file, with one line per service, while xinetd uses a configuration directory, with one file per service
13.What is LILO?
LILO stands for Linux boot loader. It will load the MBR, master boot record, into the memory, which tell the system which partition and hard drive to boot.
14.why accounting Software does not support on linux?
Bcoz the accounting software is have .exe file. And linux doesn’t support .exe file. so accounting software does not support on linux.
15.How to give 2 different gateway IP addresses for 2 different interfaces in same system ?
route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.0.2 dev eth0
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.3 dev eth1
16.How does the boot process[init levels] work on Linux?
1. The system BIOS checks the system and launches the first
stage boot loader on the MBR of the primary hard disk.
2. The Frist stage boot loader loads itself into memory and
launches the second stage boot loader from the /boot/
partition.
3. The second stage boot loader loads the kernel into
memory, which in turn loads any necessary modules and
mounts the root
partition read-only.
4. The kernel transfers control of the boot process to the /
sbin/init program.
5. The /sbin/init program loads all services and user-space
tools, and mounts all partitions
listed in /etc/fstab.
6. The user is presented with a login screen for the
freshly booted Linux system.
17.What is the difference between an argument and an option/switch?
option specifies the command how to run
arguement specifies the command on what to run
18.How to send automated email to a set of people at fixed time ?
Just create a alias of people and create a command file and create a crond entry.
19.What is the minimum number of partitions you need to install Linux?
/
/boot
/swap
20.There are 4 network Interfaces, how can we find which one is Primary ?
When you type the command netstat -nr in your shell, youwill find a line starting with 0.0.0.0. Something like
0.0.0.0  192.168.0.4  0.0.0.0  UG  0  0  0  eth0
This line indicates if the system tries to contact a network outside its local network. It will first contact the router 192.168.0.4 and it does it with the primary interface. Hence in this case its eth0. So you can check this line for the primary interface
21.What is the difference between home directory and working directory?
Home directory is one over which user have complete control and it is its default working directory when its logs in. while the working directory is the users current directory which may or may not be his home directory.
22.How can you see all mounted drives?
we can see all mounted drives
#mount
#df -Th
23.How to check all open ports on linux machine and block unsed ports?
open ports – nmap localhost
block unsed ports -
#nmap -v localhost for tcp
#nmap -sU localhost for udp
24.What are RPM?s, what do they offer?
The full form of RPM is Redhat Package Manager. rpm is a powerful Package Manager, which can be used to build,install, query, verify, update, and erase individual software packages. A package consists of an archive of files and meta-data used to install and erase the archive files.
25.You want to create a compressed backup of the users’ home directories. What utility should you use?
tar -cvzf user.tar.gz /home/user
26.What utility can you use to automate rotation of logs?
logrotate
27.How u use the iptable firewall to restrict ssh,telnet,ftp ?
iptables -A INPUT -s -p tcp –dport -j REJECT/DROP/DENY
28.What file should you examine to determine the defined runlevels for your system?
/etc/inittab
29.What is the name and path of the main system log?
var/log/messages  -  system log messages can be seen here
/var/log/dmesg  -  Kernel boot log messages can view

100 Windows XPkeyboard shortcuts

CTRL+C (Copy)
CTRL+X (Cut)
CTRL+V (Paste)
CTRL+Z (Undo)
DELETE (Delete)
SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
CTRL while dragging an item (Copy the selected item)
CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
F2 key (Rename the selected item)
CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
CTRL+SHIFT with any of the arrow keys (Highlight a block of text)
SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
CTRL+A (Select all)
F3 key (Search for a file or a folder)
ALT+ENTER (View the properties for the selected item)
ALT+F4 (Close the active item, or quit the active program)
ALT+ENTER (Display the properties of the selected object)
ALT+SPACEBAR (Open the shortcut menu for the active window)
CTRL+F4 (Close the active document in programs that enable you to have multiple documents open simultaneously)
ALT+TAB (Switch between the open items)
ALT+ESC (Cycle through items in the order that they had been opened)
F6 key (Cycle through the screen elements in a window or on the desktop)
F4 key (Display the Address bar list in My Computer or Windows Explorer)
SHIFT+F10 (Display the shortcut menu for the selected item)
ALT+SPACEBAR (Display the System menu for the active window)
CTRL+ESC (Display the Start menu)
ALT+Underlined letter in a menu name (Display the corresponding menu)

Underlined letter in a command name on an open menu (Perform the corresponding command)
F10 key (Activate the menu bar in the active program)
RIGHT ARROW (Open the next menu to the right, or open a submenu)
LEFT ARROW (Open the next menu to the left, or close a submenu)
F5 key (Update the active window)
BACKSPACE (View the folder one level up in My Computer or Windows Explorer)
ESC (Cancel the current task)
SHIFT when you insert a CD-ROM into the CD-ROM drive (Prevent the CD-ROM from automatically playing)

Dialog Box Keyboard Shortcuts
CTRL+TAB (Move forward through the tabs)
CTRL+SHIFT+TAB (Move backward through the tabs)
TAB (Move forward through the options)
SHIFT+TAB (Move backward through the options)
ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
ENTER (Perform the command for the active option or button)
SPACEBAR (Select or clear the check box if the active option is a check box)
Arrow keys (Select a button if the active option is a group of option buttons)
F1 key (Display Help)
F4 key (Display the items in the active list)
BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)

Micro$oft Natural Keyboard Shortcuts
Windows Logo (Display or hide the Start menu)
Windows Logo+BREAK (Display the System Properties dialog box)
Windows Logo+D (Display the desktop)
Windows Logo+M (Minimize all of the windows)
Windows Logo+SHIFT+M (Restore the minimized windows)
Windows Logo+E (Open My Computer)
Windows Logo+F (Search for a file or a folder)
CTRL+Windows Logo+F (Search for computers)
Windows Logo+F1 (Display Windows Help)
Windows Logo+ L (Lock the keyboard)
Windows Logo+R (Open the Run dialog box)
Windows Logo+U (Open Utility Manager)

Accessibility Keyboard Shortcuts

Right SHIFT for eight seconds (Switch FilterKeys either on or off)
Left ALT+left SHIFT+PRINT SCREEN (Switch High Contrast either on or off)
Left ALT+left SHIFT+NUM LOCK (Switch the MouseKeys either on or off)
SHIFT five times (Switch the StickyKeys either on or off)
NUM LOCK for five seconds (Switch the ToggleKeys either on or off)
Windows Logo +U (Open Utility Manager)

Windows Explorer Keyboard Shortcuts
END (Display the bottom of the active window)
HOME (Display the top of the active window)
NUM LOCK+Asterisk sign (*) (Display all of the subfolders that are under the selected folder)
NUM LOCK+Plus sign (+) (Display the contents of the selected folder)
NUM LOCK+Minus sign (-) (Collapse the selected folder)
LEFT ARROW (Collapse the current selection if it is expanded, or select the parent folder)
RIGHT ARROW (Display the current selection if it is collapsed, or select the first subfolder)

Shortcut Keys for Character Map

After you double-click a character on the grid of characters, you can move through the grid by using the keyboard shortcuts:
RIGHT ARROW (Move to the right or to the beginning of the next line)
LEFT ARROW (Move to the left or to the end of the previous line)
UP ARROW (Move up one row)
DOWN ARROW (Move down one row)
PAGE UP (Move up one screen at a time)
PAGE DOWN (Move down one screen at a time)
HOME (Move to the beginning of the line)
END (Move to the end of the line)
CTRL+HOME (Move to the first character)
CTRL+END (Move to the last character)
SPACEBAR (Switch between Enlarged and Normal mode when a character is selected)

Micro$oft Management Console (MMC) Main Window Keyboard Shortcuts
CTRL+O (Open a saved console)
CTRL+N (Open a new console)
CTRL+S (Save the open console)
CTRL+M (Add or remove a console item)
CTRL+W (Open a new window)
F5 key (Update the content of all console windows)
ALT+SPACEBAR (Display the MMC window menu)
ALT+F4 (Close the console)
ALT+A (Display the Action menu)
ALT+V (Display the View menu)
ALT+F (Display the File menu)
ALT+O (Display the Favorites menu)

MMC Console Window Keyboard Shortcuts
CTRL+P (Print the current page or active pane)
ALT+Minus sign (-) (Display the window menu for the active console window)
SHIFT+F10 (Display the Action shortcut menu for the selected item)
F1 key (Open the Help topic, if any, for the selected item)
F5 key (Update the content of all console windows)
CTRL+F10 (Maximize the active console window)
CTRL+F5 (Restore the active console window)
ALT+ENTER (Display the Properties dialog box, if any, for the selected item)
F2 key (Rename the selected item)
CTRL+F4 (Close the active console window. When a console has only one console window, this shortcut closes the console)


Remote Desktop Connection Navigation

CTRL+ALT+END (Open the m*cro$oft Windows NT Security dialog box)
ALT+PAGE UP (Switch between programs from left to right)
ALT+PAGE DOWN (Switch between programs from right to left)
ALT+INSERT (Cycle through the programs in most recently used order)
ALT+HOME (Display the Start menu)
CTRL+ALT+BREAK (Switch the client computer between a window and a full screen)
ALT+DELETE (Display the Windows menu)
CTRL+ALT+Minus sign (-) (Place a snapshot of the active window in the client on the Terminal server clipboard and provide the same functionality as pressing PRINT SCREEN on a local computer.)
CTRL+ALT+Plus sign (+) (Place a snapshot of the entire client window area on the Terminal server clipboard and provide the same functionality as pressing ALT+PRINT SCREEN on a local computer.)

Micro$oft Internet Explorer Navigation
CTRL+B (Open the Organize Favorites dialog box)
CTRL+E (Open the Search bar)
CTRL+F (Start the Find utility)
CTRL+H (Open the History bar)
CTRL+I (Open the Favorites bar)
CTRL+L (Open the Open dialog box)
CTRL+N (Start another instance of the browser with the same Web address)
CTRL+O (Open the Open dialog box, the same as CTRL+L)
CTRL+P (Open the Print dialog box)
CTRL+R (Update the current Web page)
CTRL+W (Close the current window