Wednesday 6 February 2013

Apache Interview Questions


Q: – What is location of log files for Apache server ?
Ans- /var/log/httpd
Q: – What are the types of virtual hosts ?
Ans-
a. name-based
b. IP-based.

Name-based virtual host means that multiple names are running on each IP address.
IP-based virtual host means that a different IP address exists for each website served. Most configurations are named-based because it only requires one IP address.
Q: – Command to restart/start Apache web server ?
Ans- service httpd restart/start
Q: – Comamnd to check the version of Apache server ?
Ans- rpm -qa |grep httpd
Q: – What is meaning of “Listen” in httpd.conf file ?
Ans- Port number on which to listen for nonsecure (http) transfers.
Q: – What is Document Root ?
Ans- It is a location of files which are accessible by clients. By default, the Apache HTTP server in RedHat Enterprise Linux is configured to serve files from the /var/www/html/ directory.
Q: – Apache server works on which ports ?
Ans-
http – port 80
https – port 443
Q: – Tell me name of main configuration file of Apache server ?
Ans- httpd.conf
Q: – On which version of apache you have worked ?
Ans- httpd-2.2.3
Q: – What do you mean by a valid ServerName directive?
Ans- The DNS system is used to associate IP addresses with domain names. The value of ServerName is returned when the server generates a URL. If you are using a certain domain name, you must make sure that it is included in your DNS system and will be available to clients visiting your site.
Q: – What is the main difference between and sections?
Ans- Directory sections refer to file system objects; Location sections refer to elements in the address bar of the Web Page.
Q: – What is the difference between a restart and a graceful restart of a web server ?
Ans- During a normal restart, the server is stopped and then started, causing some requests to be lost. A graceful restart allows Apache children to continue to serve their current requests until they can be replaced with children running the new configuration.

-->
apachectl -k restart – for graceful restart
Q: – What is the use of mod_perl module ?
Ans- mod_perl scripting module to allow better Perl script performance and easy integration with the web server.
Q: – If you have added “loglevel Debug” in httpd.conf file, than what will happen ?
Ans- It will give you more information in the error log in order to debug a problem.
Q: – Is it possible to record the MAC (hardware) address of clients that access your server ?
Ans- No