Top 34 Apache Webserver (level 2) Interview Questions
Q1. Can You Change The Listening Port From Default To Something Else?
Yes, it’s viable by way of specifying the port variety in Listen directive.
For ex: to make Apache concentrate on 9000 port to ten.10.10.10 IP deal with.
Listen 10.10.10.10:9000
Q2. How Do I Disable Directory Indexing?
You can use “Options -Indexes” in respective directory directive.
Ex:
Options -Indexes
<Directory />
Options -Indexes
</Directory>
Q3. How To Put Log Level In Debug Mode?
Often needed while you are troubleshooting the issue and want to seize extra details. You can change the logging stage to debug via making sure the following in httpd.Conf document.
LogLevel debug
Q4. What Is Documentroot?
DocumentRoot directive is the configuration wherein you could specify the folder area from wherein the static documents might be served. It’s additionally known as as Web Root.
Default DocumentRoot location is /var/www/html
Q5. What Tool Do You Use For Log Analysis?
You got to speak the reality however to given you an idea you could use GoAccess, SumoLogic or few stated here.
Q6. How To Ensure Apache Process Run With Non-root/no person User?
This is achievable by including User & Group directive in httpd.Conf record
User apache
Group apache
Above configuration example will make sure it starts with “apache” user. You ought to make sure consumer exist on the server earlier than configuring it.
Q7. How To Perform Apache Performance Benchmark?
You can use a tool like ApacheBench, SIEGE to carry out the weight check on internet servers inclusive of Apache. Another option to carry out stress test online to look the overall how net utility performs underneath load.
Q8. What Are The Log Files Generated By Apache?
There are two popular log documents created;
get entry to.Log – all request details with the reputation code.
Error.Log – capture all of the errors within apache or connecting in backend.
Q9. How Can Apache Act A Proxy Server?
You can use a mod_proxy module to use as a proxy server. The mod_proxy module can be used to connect with the backend server like Tomcat, WebLogic, WebSphere, and many others.
Q10. How To Install Apache Web Server?
There are 3 possible ways to get this installed.
Using source code – you could download the supply and bring together it.
YUM repository – if your server is hooked up to the Internet or have internal repository then you can use yum to install it.
Yum install httpd
RPM – You can download the important RPM package and use rpm command.
Rpm -ivh packagename.Rpm
Q11. Where Is Apache Web Server Located In Data Center Location?
You can provide an explanation for primarily based in your enjoy, but, usually for Internet-dealing with applications it might be in Internet DMZ community and for intranet, core community.
But once more this can range primarily based on application/corporation.
Q12. How To Hide Server Version Details In Http Response Header?
Add the subsequent in httpd.Conf file and restart the net server
ServerTokens Prod
ServerSignature Off
This will disguise the version and display Server as “Apache” Only.
Q13. How To Disable Trace Http Request?
Add the following in httpd.Conf record and restart the example
TraceEnable off
Q14. How To Ensure Web Server Is Getting Started After Server Reboot?
If walking Linux, then you could positioned a script in /and many others/init.D/ and permit to start on boot using chkconfig command
Let’s say you create a record referred to as apache and placed beneath /and so forth/init.D
chkconfig --upload apache
chkconfig apache on
if on Windows, then make certain startup type is chosen “Automatic”
Q15. What Is A Difference Between Apache And Nginx Web Server?
Both are categorised as a Web Server and here are a number of the principle differences.
Nginx is occasion-based net server where Apache is process based totally
Nginx is thought for better performance than Apache
Apache supports extensive variety of OS where Nginx doesn’t aid OpenVMS and IBMi
Apache has big quantity of modules integration with backend software server in which Nginx is still catching up
Nginx is lightweight and capturing the marketplace percentage unexpectedly. If you are new to Nginx then you'll be interested to check out my articles on Nginx.
Q16. How To Verify Httpd.Conf File To Ensure No Configuration Syntax Error?
Httpd –t will help you to verify the syntax.
[root@lab httpd]# /usr/sbin/httpd -t
Syntax OK
[root@lab httpd]#
Alternatively, you could use apachectl command as well.
[root@lab ~]# /usr/sbin/apachectl configtest
Syntax OK
[root@lab ~]#
Q17. How To Check The Version Of Running Apache Web Server?
There is a couple of methods to discover this but more as it should be could be;
Login to internet server
Go to apache example and bin folder
Executed httpd with -v to get the model information.
[root@lab sbin]# ./httpd -v
Server model: Apache/2.2.15 (Unix)
Server built: Jul 18 2016 15:24:00
[root@lab sbin]#
Alternatively, you could also use the rpm command to test the hooked up version:
[root@lab ~]# rpm -qa fifty four.El6.Centos.X86_64
httpd-equipment-2.2.15-54.El6.Centos.X86_64
[root@lab ~]#
Q18. What Does 200, 403 & 503 Http Error Code Mean?
200 – content material located and served OK
403 – tried to get right of entry to constrained record/folder
503 – server is just too busy to serve the request and in every other phrase – service unavailable.
Q19. What Are The Different Flavor Of Apache Web Server You Know?
IBM HTTP Server – referred to as IHS and frequently used with IBM WebSphere Application Server
Oracle HTTP Server- referred to as OHS frequently used with Oracle Weblogic server
Q20. Can You Tell Me The Important Configuration File Name?
Httpd.Conf is the main configuration report utilized in Apache.
Q21. What Is The Default Port For Http And Https?
The default port for HTTP is 80 and HTTPS forty four@Checkout default ports for different programs indexed here.
Q22. How To Stop/start Apache Web Server?
You can restart by using going to Apache example region >> bin folder and execute apachectl script.
./apachectl stop
./apachectl begin
You may also use script located in /and many others/init.D/. Mostly it'll be named either “apache” or “httpd”
/etc/init.D/apache forestall
/and so forth/init.D/apache start
Another system might be the usage of services
httpd prevent
service httpd begin
Q23. Which Module Is Required To Have Redirection Possible?
Mod_rewrite is chargeable for the redirection and this need to be uncommented in httpd.Conf record.
LoadModule rewrite_module modules/mod_rewrite.So
Q24. How To Deploy War Or Java Applications In Apache?
I am afraid, Apache is a Web Server and Java based totally application deployment isn't possible with it. However, you may integrate Java software server like WebLogic, WebSphere, JBoss wherein you could installation war, ear documents.
Q25. What Are The Log Level Available In Apache?
The default configuration is ready to “warn” however, the subsequent is viable too.
Debug
info
warn
be aware
crit
alarm
emerg
errors
Q26. What Is Virtual Hosting?
Virtual Hosting in Apache allows you to host a couple of websites on a single example. You can both create IP based totally or Name primarily based in virtual website hosting.
Q27. How To Create A Csr?
You can either use the subsequent OpenSSL command or generate CSR on line.
To create new CSR with non-public key
openssl req -out geekflare.Csr -newkey rsa:2048 -nodes -keyout geekflare.Key
Check out OpenSSL cheat sheet for more commands.
Q28. How To Know If Web Server Running?
There are a couple of methods to discover this.
Login to internet server and grep for “httpd” process
playstation grep httpd
Check for any alert to your tracking dashboard.
Check in case your apache IP:port is offered inside the browser
Ex: http://yourapacheserver.Com
Check if configured IP and port is listening at thegrep eighty
Q29. Which Module Is Required To Enable Ssl?
The mod_ssl module should be uncommented previous to SSL implementation.
LoadModule auth_basic_module modules/mod_ssl.So
Q30. How To Ensure Apache Listen On Only One Ip Address On The Server?
This is frequently wished when you have multiple IPs at the server. In order to make sure Apache concentrate only on specific IP you then need to explicitly mention IP and port in Listen directive.
Ex:
Listen 10.10.10.10:80
Q31. How To Secure Website Hosted On Apache Web Server?
There are a couple of approaches to at ease the Apache net server consisting of the subsequent.
Implementing SSL
Integrating with WAF (Web Application Firewall) like ModSecurity, and so on.
Using cloud-based totally security company
Q32. How To Troubleshoot Port Conflict Issue?
Netstat might be beneficial to troubleshoot the port warfare difficulty. If jogging more than one times on a single server then it might be endorsed to have absolute IP:Port configured in Listen directive.
Q33. How To Get Support For Apache Web Server If Something Wrong?
Apache is an Open Source internet server so there's no business enterprise level help however, you can increase a trojan horse record or ask a question on Stack Overflow.
Q34. What Module Is Needed To Connect To Websphere?
Mod_was_ap22_http.So ought to be introduced in httpd.Conf file to combine with IBM WAS.
