Most Important Frequently Asked Apache Webserver (level 2) Interview Questions
-
Question 1. How To Stop/start Apache Web Server?
Answer :
You can restart by going to Apache instance location >> bin folder and execute apachectl script.
./apachectl stop
./apachectl start
You may also use script located in /etc/init.d/. Mostly it will be named either “apache” or “httpd”
/etc/init.d/apache stop
/etc/init.d/apache start
Another procedure would be using services
httpd stop
service httpd start
-
Question 2. What Is The Default Port For Http And Https?
Answer :
The default port for HTTP is 80 and HTTPS 443. Checkout default ports for other applications listed here.
Apache Tapestry Interview Questions -
Question 3. Can You Tell Me The Important Configuration File Name?
Answer :
httpd.conf is the main configuration file used in Apache.
-
Question 4. How To Check The Version Of Running Apache Web Server?
Answer :
There is multiple ways to find this but more accurately would be;
- Login to web server
- Go to apache instance and bin folder
- Executed httpd with -v to get the version details.
[root@lab sbin]# ./httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: Jul 18 2016 15:24:00
[root@lab sbin]#
Alternatively, you can also use the rpm command to check the installed version:
[root@lab ~]# rpm -qa |grep httpd
httpd-2.2.15-54.el6.centos.x86_64
httpd-tools-2.2.15-54.el6.centos.x86_64
[root@lab ~]#
Apache Tapestry Tutorial -
Question 5. How To Know If Web Server Running?
Answer :
There are multiple ways to find this.
- Login to web server and grep for “httpd” process
ps -ef |grep httpd
- Check for any alert in your monitoring dashboard.
- Check if your apache IP:port is accessible in the browser
Ex: http://yourapacheserver.com
- Check if configured IP and port is listening on the server with netstat
netstat -anlp |grep 80
Apache Cassandra Interview Questions -
Question 6. How To Install Apache Web Server?
Answer :
There are three possible ways to get this installed.
Using source code – you can download the source and compile it.
YUM repository – if your server is connected to the Internet or have internal repository then you can use yum to install it.
yum install httpd
RPM – You can download the necessary RPM package and use rpm command.
rpm -ivh packagename.rpm
-
Question 7. How To Ensure Apache Listen On Only One Ip Address On The Server?
Answer :
This is often needed when you have multiple IPs on the server. In order to ensure Apache listen only on specified IP then you need to explicitly mention IP and port in Listen directive.
Ex:
Listen 10.10.10.10:80
Apache Cassandra Tutorial Apache Spark Interview Questions -
Question 8. How To Ensure Apache Process Run With Non-root/nobody User?
Answer :
This is doable by adding User & Group directive in httpd.conf file
- User apache
- Group apache
Above configuration example will ensure it starts with “apache” user. You must ensure user exist on the server before configuring it.
-
Question 9. How Do I Disable Directory Indexing?
Answer :
You can use “Options -Indexes” in respective directory directive.
Ex:Options -Indexes
<Directory />
Options -Indexes
</Directory> Apache Solr Interview Questions -
Question 10. Which Module Is Required To Have Redirection Possible?
Answer :
mod_rewrite is responsible for the redirection and this must be uncommented in httpd.conf file.
LoadModule rewrite_module modules/mod_rewrite.so
Apache Solr Tutorial -
Question 11. Can You Change The Listening Port From Default To Something Else?
Answer :
Yes, it’s possible by specifying the port number in Listen directive.
For ex: to make Apache listen on 9000 port to 10.10.10.10 IP address.
Listen 10.10.10.10:9000
Apache Storm Interview Questions -
Question 12. How To Secure Website Hosted On Apache Web Server?
Answer :
There are multiple ways to secure the Apache web server including the following.
- Implementing SSL
- Integrating with WAF (Web Application Firewall) like ModSecurity, etc.
- Using cloud-based security provider
Apache Tapestry Interview Questions -
Question 13. What Are The Log Files Generated By Apache?
Answer :
There are two popular log files created;
access.log – all request details with the status code.
error.log – capture all the errors within apache or connecting in backend.
Apache Storm Tutorial -
Question 14. How To Create A Csr?
Answer :
You can either use the following OpenSSL command or generate CSR online.
To create new CSR with private key
openssl req -out geekflare.csr -newkey rsa:2048 -nodes -keyout geekflare.key
Check out OpenSSL cheat sheet for more commands.
-
Question 15. What Is Virtual Hosting?
Answer :
Virtual Hosting in Apache allows you to host multiple websites on a single instance. You can either create IP based or Name based in virtual hosting.
Apache Hive Interview Questions -
Question 16. What Module Is Needed To Connect To Websphere?
Answer :
mod_was_ap22_http.so must be added in httpd.conf file to integrate with IBM WAS.
Apache Hive Tutorial -
Question 17. How To Put Log Level In Debug Mode?
Answer :
Often needed when you are troubleshooting the issue and wish to capture more details. You can change the logging level to debug by ensuring the following in httpd.conf file.
LogLevel debug
Apache Pig Interview Questions -
Question 18. Which Module Is Required To Enable Ssl?
Answer :
The mod_ssl module must be uncommented prior to SSL implementation.
LoadModule auth_basic_module modules/mod_ssl.so
Apache Cassandra Interview Questions -
Question 19. What’s The Weblogic Module Name?
Answer :
mod_wl_22.so
Apache Pig Tutorial -
Question 20. What Are The Log Level Available In Apache?
Answer :
The default configuration is set to “warn” however, the following is possible too.
- debug
- info
- warn
- notice
- crit
- alarm
- emerg
- error
Apache Flume Interview Questions -
Question 21. What Is Documentroot?
Answer :
DocumentRoot directive is the configuration where you can specify the folder location from where the static files will be served. It’s also called as Web Root.
Default DocumentRoot location is /var/www/html
-
Question 22. 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.
Apache Flume Tutorial -
Question 23. What’s Difference Between Apache Web Server And Apache Tomcat?
Answer :
Apache Web is HTTP server to serve static contents where Tomcat is servlet container to deploy JSP files.
You can always integrate Apache HTTP with Tomcat, however, based on the requirement you need to choose either one. If you need proper web server then Apache HTTP else Tomcat for JSP-Servlet Container.
Apache Kafka Interview Questions -
Question 24. How Can Apache Act A Proxy Server?
Answer :
You can use a mod_proxy module to use as a proxy server. The mod_proxy module can be used to connect to the backend server like Tomcat, WebLogic, WebSphere, etc.
Apache Spark Interview Questions -
Question 25. What Tool Do You Use For Log Analysis?
Answer :
You got to speak the truth but to given you an idea you can use GoAccess, SumoLogic or few mentioned here.
Apache Kafka Tutorial -
Question 26. 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.
- Nginx
- Microsoft IIS
- LiteSpeed
- GWS
Topic: Apache Webserver (level 2) Interview Questions
No comments:
Post a Comment