Apache Interview Questions

Share It!

In this section, I have chosen Basic and Important Apache interview questions and answers for all levels of candidates(Fresher level, experienced level).Last couple of months I have been attempting to choose best question and answer set for Apache interview questions.


1) How to check the version of Apache server ?

Ans: # httpd -v

2) What is meaning of “Listen” in httpd.conf file ?

Ans: Port number on which to listen for nonsecure (http) transfers.

3) If you specify both deny from all and allow from all, what will be the default action of Apache?

Ans: Deny always takes precedence over allow.

4) What is DocumentRoot ?

Ans: The document root is a directory that is designated for holding web pages. By default, the Apache HTTP server is configured to serve files from the /var/www/html/ directory.

5) Tell me name of main configuration file of Apache server ?

Ans: /etc/httpd/conf/httpd.conf

6)Does Apache act as Proxy server?

Ans:Yes,using mod_proxy module.

7) What do you mean by a 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.

8) 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

9) 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 server their current requests until they can be replaced with children running the new configuration.

10) What is the difference between ServerName directive and ServerAlias?

Ans: ServerName directive is hostname and port that the server uses to identify itself and ServerAlias is alternate names for a host used when matching requests to name-virtual hosts.

11) How t to enable PHP scripts on your server?

Ans: If you have mod_php installed, use AddHandler.
AddHandler application/x-httpd-php .phtml .php 

12) How to enable htaccess on Apache?

Open httpd.conf and remove the comment on line from

;LoadModule rewrite_module modules/mod_rewrite.so

Find the following
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

Replace it
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all

13) What is ServerType directive?

Ans: 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.

14) What is mod_vhost_alias?

Ans: It allows hosting multiple sites on the same server via simpler configurations.

15) Which tool you have used for Apache benchmarking?

Ans: ab (Apache bench) ab -n 1000 -c 10 http://www.techoism.com/launch-an-amazon-ec2-instance/

16) How you will put a limit on uploads on your web server?

Ans: This can be achieved be LimitRequestBody directive.
<Directory "/usr/local/apache2/htdoc/wp-content/uploads">
LimitRequestBody 100000
Here I have put limit of 100000 Bytes

17) I want to stop people using my site by Proxy server. Is it possible>

<Directory "proxy:http://www.techoism.com/content">
Order Allow,Deny
Satisfy All

18) What we can do to find out how people are reaching your site?

Ans: Add the following effector to your activity log format.%{Referer}

19) If you have added “loglevel debug” in htpd.conf file, than what will happen?

Ans: It will give you more information in the error log in order to debug a problem.

20) How to check for the httpd.conf consistency and any errors in it?

Ans: httpd -t

Leave a Reply

Your email address will not be published.