We earn commission when you buy through affiliate links.
This does not influence our reviews or recommendations.Learn more.
Apache HTTP is an open-source Web Server for Windows & UNIX.
The following questions are often asked in an interview from beginner to expert level.
Most of the organization will have Web Server managed by Middleware/System administrator along with program Server and other components.
Lets get started withreal-time interview questions & answers…
1.
How to stop/start Apache Web Server?
You may also use a script located in /etc/init.d/.
Mostly it will be named either apache or httpd
Another procedure would be using services
2.
What is the default port for HTTP and HTTPS?
The default port for HTTP is 80 and HTTPS 443.
Checkout default ports for other applicationslisted here.
Can you tell me the important configuration file name?
httpd.conf is the main configuration file used in Apache.
How to check the version of running Apache Web Server?
How to know if a web server is running?
There are multiple ways to find this.
Ex: http://yourapacheserver.com
6.
How to install Apache HTTP?
There are three possible ways to get this installed.
Usingsource code it’s possible for you to download the source and compile it.
RPM you might download the necessary RPM package and use the rpm command.
How to ensure Apache listens to only one IP address on the server?
This is often needed when you have multiple IPs on the server.
Ex:
8.
How to ensure the Apache run with non-root/nobody user?
You must ensure users exist on the server before configuring it.
How do I disable directory indexing?
you could use Options -Indexes in the respective directory directive.
Which module is required to have redirection possible?
mod_rewriteis responsible for the redirection, and this must be uncommented in httpd.conf file.
Can you change the listening port from default to something else?
Yes, its possible by specifying the port number in theListendirective.
Ex: to make Apache listen on 9000 port to 10.10.10.10 IP address.
How to secure a Website hosted on Apache Web Server?
There are multiple ways tosecure the Apache webserverincluding the following.
What are the log files generated by Apache?
There are two popular log files created;
14.
How to create a CSR?
you could either use the following OpenSSL command orgenerate CSR online.
To create new CSR with a private key
Check out theOpenSSL cheat sheetfor more commands.
What is Virtual Hosting?
Virtual Hosting in Apache allows you to host multiple websites on a single instance.
you might either createIP basedorName basedon virtual hosting.
What module is needed to connect to WebSphere?
mod_was_ap22_http.somust be added inhttpd.conffile to integrate with IBM WAS.
How to put Log level in Debug mode?
Often needed when you are troubleshooting the issue and wish to capture more details.
it’s possible for you to change the logging level to debug by ensuring the following in httpd.conf file.
Which module is required to enable SSL?
The mod_ssl module must be uncommented before SSL implementation.
Whats the WebLogic module name?
mod_wl_22.so
20.
What is the log level available in Apache?
The default configuration is set to warn however, the following is possible too.
Its also called as WebRoot.
How to deploy war or JAVA applications in Apache?
I am afraid, Apache is a Web Server, and Java-based utility deployment is not possible with it.
Whats a difference between Apache Web Server and Apache Tomcat?
If you need a proper web server, then Apache HTTP else Tomcat for JSP-Servlet Container.
How can Apache act as a Proxy Server?
you might use a mod_proxy module to use as a proxy server.
How to configure Apache log, so it captures the time taken to serve a request?
It will show time in microseconds.
Restart the Apache web server, and you’re free to see the results.
What tool do you use for log analysis?
What are the Web Servers youve worked on along with Apache?
How to verify httpd.conf file to ensure no configuration syntax error?
httpd t will help you to check the syntax.
Alternatively, you may use the apachectl command as well.
How to perform Apache performance benchmark?
Another option to perform stresstest onlineto see the overall how web system performs under load.
How to get support for Apache Web Server if something wrong?
Apache is an Open Source web server, so there is no enterprise-level support.
However, it’s possible for you to raise abug reportor ask a question on Stack Overflow.
How to ensure the webserver is getting started after a server reboot?
32. what is a difference between Apache and Nginx web server?
Both are categorized as a Web Server and here are some of the main differences.
How would you kill the Apache if graceful-stop doesnt work?
If running on Linux, then can use kill command.
How to find httpd.conf file if you dont know the installation location?
In Linux, you’re able to usefind command.
What are the different flavors of Apache webserver you know?
Where is the Apache located in the data center location?
But again this will differ based on system/organization.
How to hide server version details in the HTTP response header?
What does 200, 403 & 503 HTTP error codes mean?
How to disable trace HTTP requests?
Add the following in httpd.conf file and restart the instance
40.
How to troubleshoot port conflict issue?
netstatwould be useful to troubleshoot the port conflict issue.
How to plant the third-party module?
you’ve got the option to make use ofApache Toolbox.
Once downloaded, extract it using thetarutility.
Navigate to the folderApachetoolbox-1.5.72using thecdcommand and execute the command below to select modules for your Apache server.
It provides modules such asmod_ip_forwarding,mod_auth_mysqlandmod_auth_sambato compile with the Apache webserver.
Although you’re able to include these modules manually, it is easier with Apache Toolbox.
How to assign multiple names to virtual hosts?
it’s possible for you to make use of theServerAliasdirective as shown below.
How to limit upload size?
How do I limit file upload by users?
you could make use of theLimitRequestBodydirective to limit upload file size.
The value assigned to theLimitRequestBodyallows Apache to accept and store file uploads of 9000 bytes by users.
you might adjust the value based on the requirement.
How to restrict access by IPs?
You may want some of the context root to be accessible by allowed IPs.
To do so, you might make use ofmod_authz_coreormod_authz_hostmodules to restrict access using theRequiredirective.
By doing above, Apache will serve requests only if requests are made from the listed IPs.
I hope the above questions and answer help you to prepare for a web server administratorinterview.