Apache WebServer Interview Questions And Answers

1. What is the Apache webserver?
Answer: Apache webserver HTTP is a most popular, powerful and Open Source to host websites on the web server by serving web files on the networks. It works on HTTP as in Hypertext Transfer Protocol, which provides a standard for servers and client-side web browsers to communicate. It supports SSL, CGI files, Virtual hosting, and many other features.

2. What Is Apache Tomcat?
Answer: Apache Tomcat is an open-source web server and Servlet/JSP container developed by the Apache Software Foundation. Tomcat implements several Java EE specifications including Java Servlet, Java Server Pages (JSP), Java EL, and WebSocket, and provides a “pure Java” HTTP web server environment for Java code to run in.

3. Explain Directory Structure Of Tomcat?

The directory structure of Tomcat are:
bin: contain startup, shutdown, and other scripts (*.sh for UNIX and *.bat for Windows systems) and some jar files also there.
conf: Server configuration files (including server.xml) and related DTDs. The most important file here is server.xml. It is the main configuration file for the container.
lib: contains JARs that are used by container and Servlet and JSP application programming interfaces (APIs).
logs: Log and output files.
web apps: deployed web applications reside in it.
work: Temporary working directories for web applications and mostly used during in JSP compilation where JSP is converted to a Java servlet.
temp: Directory used by the JVM for temporary files.

4. Explain The Concepts Of Tomcat Servlet Container.?
Answer: Tomcat Servlet Container is a servlet container. The servlets run in a servlet container.
The implementation of Java Servlet and the Java Server Pages is performed by this container.
Provides HTTP web server environment in order to run Java code.
Reduces garbage collection
Native Windows and Unix wrappers for platform integration

5. What do you mean by a valid ServerName directive?
Answer: 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.

6. What is Virtual Hosting?
Answer: Virtual hosting is a method for hosting multiple domain names on a server using a single IP address. Virtual hosting allows one server to share its resources, such as memory and processor cycles, in order to use its resources more efficiently.

7. What is the difference between a restart and a graceful restart of a web server?
Answer: 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.

8. How Do You Install the Apache Web Server?
Answer: There are three ways of installing the Apache webserver. The first method is to download the source code and then to compile it. The YUM repository is the second avenue to follow when installing the server. If your server has an internet connection or an internal repository, use YUM to install it. Lastly, download the RPM command on to your server and use the rpm command to install the Apache server.

9. What are the Web Servers you’ve worked on along with Apache?
Answer: Again, you better tell the truth but to make you aware, there are many web servers in the market including the following.
Microsoft IIS

10. What is the Possible Reason for a ‘Connection Reset by Peer’ Error?
Answer: This error usually occurs when the end-user of the website ended a connection when the server response was still in the formation or transfer process.

11. What’s the Major Difference between a Restart and a Graceful Restart of a Web Server such as Apache?
Answer: In a normal restart, the server that was running is stopped and then started once more. In the process, requests that had not been executed are lost. On the other hand, a graceful restart allows Apache children to continue serving the current requests until they can be substituted with children meant to run the new configuration upon restart

12. How Do You Create Multiple Virtual Hosts?
Answer: If you want tomcat to accept requests for different hosts e.g. then you must
Create ${catalina.home}/www/appBase , ${catalina.home}/www/deploy, and ${catalina.home}/conf/Catalina/www.myhostname.com
Add a host entry in the server.xml file
Create the following file under conf/Catalina/www.myhostname.com/ROOT.xml
Add any parameters specific to this hosts web app to this context file
Put your war file in ${catalina.home}/www/deploy
When Tomcat starts, it finds the host entry, then looks for any context files and will start any apps with a context.

13. How to get help for Apache Web Server if one thing fallacious?
Answer: Apache is an Open Source net server so there isn’t any enterprise degree help nevertheless, you’ll be able to increase a bug report or ask a query on Stack Overflow.

14. What Is Tomcat?
Answer: Tomcat is a Java Servlet container and web server from the Jakarta project of Apache software foundation. A web server sends web pages as a response to the requests sent by the browser client. In addition to the static web pages, dynamic web pages are also sent to the web browsers by the webserver. Tomcat is sophisticated in this respect, as it provides both Servlet and JSP technologies. Tomcat provides a good choice as a web server for many web applications and also a free Servlet and JSP engine. Tomcat can be used standalone as well as behind other web servers such as Apache httpd.

15. What Is Different Between Webserver And Application Server?
Answer: The basic difference between a web server and an application server is Web server can execute only web applications I,e servlets and JSPs and has only a single container known as Web container which is used to interpret/execute web applications. The application server can execute Enterprise application, i,e (servlets, jsps, and EJBs)
it is having two containers:
Web Container(for interpreting/executing servlets and jsps)
EJB container(for executing EJBs).
it can perform operations like load balancing, transaction demarcation, etc.

16. What are the Various Types of Virtual Hosts in Apache?
Answer: There are two types of virtual hosts in Apache, namely name-based and IP-based. In the name-based host, multiple names are prompted to run on each IP address. IP-based, on the contrary, has different IP addresses existing for each website that is hosted. The name-based is usually preferred for most configurations because of its need for only one IP address.

17. What’s the Difference between the Apache Web Server and Apache Tomcat?
Answer: While Apache Web is an HTTP server that serves static contents, the Tomcat is a servlet container which sets up JSP files. It is possible to integrate the two; however, you may be forced to choose one based on the requirements of the server clients.
Interested in more interview rundowns that will help you during your IT interview? These Apache interview questions and answers might make more sense after also checking out our collection of SQL interview questions and our data structures interview questions and answers!. (company)

18. How to put in Apache net server?
Answer: There are three attainable methods to get this put in.
Using supply code: you’ll be able to obtain the supply and compile it.
YUM repository: in case your server is linked to the Internet or have inner repository then you should utilize yum to put in it.
yum set up httpd.
RPM: You can obtain the mandatory RPM bundle and use rpm command.
rpm: ivh package-name.rpm

19. How to make sure Apache pay attention to just one IP deal with on the server?
Answer: This is usually wanted when you could have a number of IPs on the server. In order to make sure Apache pay attention solely on specified IP then you have to explicitly point out IP and port in Listen directive.

20. How to carry out Apache efficiency benchmark?
Answer: You can use an instrument like ApacheBench, SIEGE to carry out the load take a look at on net servers together with Apache. Another choice to carry out stress take a look at on-line to see the general how net utility performs beneath a load.

21. Explain What Is Jasper?
Answer: Jasper is a Tomcat JSP engine
It parses JSP files to compile them into JAVA code as servlets
At runtime, Jasper allows to automatically detect JSP file changes and recompile them

22. Explain How Servlet Life Cycles?
Answer: The life-cycle of a typical servlet running on Tomcat
Tomcat receives a request from a client through one of its connectors
For processing, this request Tomcat maps this request to appropriate
Once the request has been directed to the appropriate servlet, Tomcat verifies that servlet class has been loaded. If it is not
than Tomcat wraps the servlet into Java Bytecode, that is executable by the JVM and forms an instance of the servlet
Tomcat initiates the servlet by calling its init The servlet contains code that is able to screen Tomcat configuration files and
act accordingly, as well as declare any resources it might require
Once the servlet has been started, Tomcat can call the servlet’s service method to proceed the request
Tomcat and the servlet can co-ordinate or communicate through the use of listener classes during the servlet’s lifecycle,
which tracks the servlet for a variety of state changes.
To remove the servlet, Tomcat calls the servlets to destroy method.

23. How Would You Describe the Apache Web Server in Brief?
Answer: The Apache web server is the most powerful, secure, and widely used web server software as well as an open source HTTP server. It is, therefore, applicable in hosting a variety of websites ranging from personal websites to company domains.

24. How Do You Check the Version of the Running Apache Web Server?
Answer: You can go about this in two different ways. In the first option follow these steps
Log in to the Apache webserver
Locate the Apache instance and bin folder
Execute the httpd with –v command to obtain the details of your Apache version.
The second procedure is rather simple as it involves the use of the rpm command to check the running Apache version on your domain.

25. What is Meant by a Valid Server Name Directive?
Answer: The IP addresses are associated with their respective domain names with the help of the DNS system. Therefore the server Name is returned if the server generates a URL when using a given domain name. It is important to include it in your DNS system such that it becomes available for the clients visiting your website.

26. what’s a distinction between Apache and Nginx net server?
Answer: Both are categorized as a Web Server and listed below are among the fundamental variations.
Nginx is event-based net server the place Apache is the course of primarily based
Nginx is thought for higher efficiency than Apache
Apache helps a wide selection of OS the place Nginx doesn’t help OpenVMS and IBMi
Apache has a massive variety of modules integration with backend utility server the place Nginx continues to be catching up
Nginx is light-weight and capturing the market share quickly. If you might be new to Nginx then you could have the interest to take a look at my articles on Nginx.

27. How to deploy war or JAVA applications in Apache?
Answer: I am afraid, Apache is a Web Server, and Java-based application deployment is not possible with it. However, you can integrate Java application server like WebLogic, WebSphere, JBoss where you can deploy war, ear files.

28. What tool do you use for log analysis?
Answer: You got to speak the truth but to give you an idea you can use GoAccess, SumoLogic or few mentioned here.

29. What is mod_evasive module?
Answer: mod_evasive is a third-party module that performs one simple task, and performs it very well. It detects when your site is receiving a Denial of Service (DoS) attack, and it prevents that attack from doing as much damage. mod_evasive detects when a single client is making multiple requests in a short period of time and denies further requests from that client. The period for which the ban is in place can be very short because it just gets renewed the next time a request is detected from that same host.

30. What do you mean by a ServerName directive?
Answer: 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.

Note: Browse Latest  Apache interview questions and Tomcat tutorial. Here you can check Tomcat Training details and apache training videos for self learning. Contact +91 988 502 2027 for more information.

31. What is the difference between the ServerName directive and ServerAlias?
Answer: Server Name 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.

32. Explain Java Management Extensions (JMX)?
Answer: JMX framework can improve the manageability of your application by
Monitoring your application for performance problems, critical events, error condition statistics, etc. For example, you can be notified if there is a sudden increase in traffic or a sudden drop in the performance of your website.
Making your application more controllable and configurable at runtime by directly exposing application API and parameters. For example, you could switch your database connection to an alternate server. You can also change the level of debugging and logging within the application without stopping the server. You could write a poller, which polls your database at a regular interval as a JMX service so that you can alter the polling interval, stop and start the poller through your server console without having to stop the server.
By interfacing JMX to your hardware, database server and application server, health checks can be performed of your infrastructure.

33. What Type of IP is Needed for Apache Web Servers to Host a Website?
Answer: The Apache web server can be used to host a website with a DSL connection as well as a static IP.

34. What is Document Root?
Answer: 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.

35. Mention What Are The Connectors Used In Tomcat?
In Tomcat, two types of connectors are used:
HTTP Connectors: It has many attributes that can be changed to determine exactly how it works and access functions such as redirects and proxy forwarding.
AJP Connectors: It works in the same manner as HTTP connectors, but they practice the AJP protocol in place of HTTP.
AJP connectors are commonly implemented in Tomcat through the plug-in technology mod_jk.

36. Explain How Running Tomcat As A Windows Service Provides Benefits?
Answer: Running Tomcat as a windows service provides benefits like:
Automatic startup: It is crucial for the environment where you may want to remotely re-start a system after maintenance
Server startup without active user login: Tomcat is run oftenly on blade servers that may not even have an active monitor attached to them. Windows services can be started without an active use

Security: Tomcat under window service enables you to run it under a special system account, which is protected from the rest of the user accounts

37. How Web Server Handles Multiple Requests For Same Action Class(struts) Concurrently?
Answer: Struts or any web server makes a new thread for each new request. so multiple requests are served with the new request object.

38. Mention With How Many Valves Does Tomcat Configured?
Answer: Four types of valves Tomcat is configured with:

  • Access Log
  • Remote Address Filter
  • Remote Host Filter
  • Request Dumper

39. What’s the mod_perl Module?
Answer: It is an optional scripting method that allows better Perl script performance as well as a simple combination with the web server itself. It enables developers to accelerate dynamic content, create custom modules, and customize all the phases of the request cycle, just to name a few.

40. Briefly explain Apache Web Server?
Answer: Apache Web Server is one of the most secure, powerful and popular open source HTTP Servers. It can be used to host anything from personal web sites to corporate domains.

41. Apache Web Server Security and Hardening Tips How to Sync Two Apache Web Servers/Websites Using Rsync?
Answer: Also, we are proud to announce that our Beta version of Question/Answer section of TecMint Ask is Already launched. If you have questions on any Linux topics. Please join us and post your questions/queries at
I’ll come up with some more Interview question on DNS, Mail servers, PHP etc in our future articles, till then stay Geeky and connected to TecMint.com.

42. What do you mean by DocumentRoot of Apache?
Answer: DocumentRoot in Apache means, it’s the location of web files are stored in the server, the default DocumentRoot of Apache is /var/www/Html or /var/www. This can be changed to anything, by setting up “DocumentRoot” in a virtual host of the configuration file of the domain.

43. You see “connection reset by peer” in error log. What could be the reason for this?
Answer: If the end-user terminates the connection when the server response was being formed or was being transferred, we see “connection reset by peer” in the error log.

44. What is the ServerType directive?
Answer: 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.

45. If you have to more than one URL map to the same directory but you don’t have multiple Alias directives. What you will do?
Answer: In this case, I will use “AliasMatch” directives.
The AliasMatch directive allows you to use regular expressions to match arbitrary patterns in URLs and map anything matching the pattern to the desired URL.

Leave a Comment

Scroll to Top