what are some questions to ask about installation and configuration of the apache server

We are very thankful to All our readers for the response nosotros are getting for our new Linux Interview section. And now nosotros have started section wise learning for Interview questions and standing with the aforementioned today's article focuses on Basic to Intermediate Apache interview Questions that will assistance you to prepare yourself.

Apache Interview Questions
Apache Chore Interview Questions

In this department, nosotros have covered some interesting 25 Apache Job Interview Questions forth with their answers so that you can hands understand some new things virtually Apache that you might never known before.

Before you lot read this article, Nosotros strongly recommend you to don't try to memorize the answers, always showtime try to understand the scenarios on a practical basis.

one. What is Apache spider web server?

Respond : Apache spider web server HTTP is a most popular, powerful and Open Source to host websites on the web server by serving web files on the networks. Information technology works on HTTP every bit 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. How to bank check Apache and it's version?

Reply : Offset, apply the rpm command to bank check whether Apache installed or not. If it's installed, then utilise httpd -five control to bank check its version.

[[email protected] ~]# rpm -qa | grep httpd  httpd-devel-2.2.15-29.el6.centos.i686 httpd-2.2.15-29.el6.centos.i686 httpd-tools-two.2.xv-29.el6.centos.i686
[[email protected] ~]# httpd -v  Server version: Apache/2.2.15 (Unix) Server congenital:   Aug thirteen 2013 17:27:xi
iii. Apache runs as which user? and location of master config file?.

Respond : Apache runs with the user "nobody" and httpd daemon. Apache main configuration file: /etc/httpd/conf/httpd.conf (CentOS/RHEL/Fedora) and /etc/apache2.conf (Ubuntu/Debian).

4. On which port Apache listens http and https both?

Answer : By default Apache runs on http port lxxx and https port 443 (for SSL document). You tin can also apply netstat command to check ports.

[[email protected] ~]# netstat -antp | grep http  tcp        0      0 :::lxxx                       :::*                        Heed      1076/httpd           tcp        0      0 :::443                      :::*                        LISTEN      1076/httpd
5. How exercise you install Apache Server on your Linux automobile?

Answer : Only, you can use whatever packet installer such equally yum on (RHEL/CentOS/Fedora) and apt-get on (Debian/Ubuntu) to install Apache server on your Linux machine.

[[email protected] ~]# yum install httpd
[[email protected] ~]# apt-get install apache2
6. Where yous can detect all configuration directories of Apache Spider web Server?

Answer : By default Apache configuration directories installed under /etc/httpd/ on (RHEL/CentOS/Fedora) and /etc/apache2 on (Debian/Ubuntu).

[[e-mail protected] ~]# cd /etc/httpd/ [[electronic mail protected] httpd]# ls -l total 8 drwxr-xr-ten. 2 root root 4096 December 24 21:44 conf drwxr-xr-x. two root root 4096 Dec 25 02:09 conf.d lrwxrwxrwx  1 root root   xix Oct thirteen 19:06 logs -> ../../var/log/httpd lrwxrwxrwx  1 root root   27 Oct thirteen nineteen:06 modules -> ../../usr/lib/httpd/modules lrwxrwxrwx  1 root root   19 Oct 13 19:06 run -> ../../var/run/httpd
[[e-mail protected] ~]# cd /etc/apache2 [[email protected] apache2]# ls -l total 84 -rw-r--r-- 1 root root  7113 Jul 24 16:15 apache2.conf drwxr-xr-x 2 root root  4096 Dec 16 xi:48 conf-available drwxr-xr-x ii root root  4096 Dec 16 11:45 conf.d drwxr-xr-ten ii root root  4096 Dec 16 11:48 conf-enabled -rw-r--r-- 1 root root  1782 Jul 21 02:fourteen envvars -rw-r--r-- 1 root root 31063 Jul 21 02:14 magic drwxr-xr-ten 2 root root 12288 Dec 16 11:48 mods-bachelor drwxr-xr-x ii root root  4096 Dec 16 11:48 mods-enabled -rw-r--r-- 1 root root   315 Jul 21 02:14 ports.conf drwxr-xr-10 two root root  4096 Dec 16 11:48 sites-available drwxr-xr-x ii root root  4096 Dec  6 00:04 sites-enabled

7. Can Apache be secured with TCP wrappers?

Reply : No, It can't be secured with the TCP wrappers since it doesn't support libwrap.a library of Linux.

8. How to modify default Apache Port and How Heed Directive works in Apache?

Answer : There is a directive "Heed" in httpd.conf file which allows u.s.a. to change the default Apache port. With the aid of Listen directive we can brand Apache listen on different port as well every bit different interfaces.

Suppose you take multiple IPs assigned to your Linux machine and want Apache to receive HTTP requests on a special Ethernet port or Interface, even that tin can be done with Listen directive.

To modify the Apache default port, please open your Apache main configuration file httpd.conf or apache2.conf file with Half-dozen editor.

[[email protected] ~]# vi /etc/httpd/conf/httpd.conf  [[email protected] ~]# half-dozen /etc/apache2/apache2.conf

Search for the word "Listen", comment the original line and write your own directive beneath that line.

# Mind 80 Heed 8080  OR  Heed 172.xvi.sixteen.one:8080

Save the file and restart the web server.

[[email protected] ~]# service httpd restart  [[email protected] ~]# service apache2 restart
9. Can we have two Apache Web servers on a unmarried machine?

Reply : Aye, we can run two different Apache servers at once on a Linux machine, merely the condition for that is they should mind on unlike ports and we tin modify the ports with Listen directive of Apache.

ten. What do yous mean by DocumentRoot of Apache?

Answer : DocumentRoot in Apache ways, 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 configuration file of domain.

11. How to host files in different folder and what is Allonym directive?

Reply : Yeah, this tin be accomplished by Alias directive in the main Apache configuration file. Allonym directive maps resources in File organisation, it takes a URL path and substitute it with a file or directory path on the organization with is gear up to redirect.

To apply Alias directive, Its the role of mod_alias module of Apache. The default syntax of Alias directive is:

Allonym /images /var/data/images/

Here in above case, /images url prefix to the /var/data/images prefix that mean clients will query for "http://www.example.com/images/sample-image.png" and Apache will pick up the "sample-epitome.png" file from /var/data/images/sample-image.png on the server. It's too known as URL Mapping.

12. What exercise you lot understand by "DirectoryIndex"?

Respond : DirectoryIndex is the name of first file which Apache looks for when a asking comes from a domain. For example: www.example.com is requested by the customer, then Apache will get the document root of that website and looks for the alphabetize file (first file to brandish).

The default setting of DirectoryIndex is .html index.html alphabetize.php, if yous have different names of your commencement file, you lot need to brand the changes in httpd.conf or apache2.conf for DirectoryIndex value to display that to your client browser.

# # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # # The index.html.var file (a type-map) is used to deliver content- # negotiated documents.  The MultiViews Pick can be used for the # aforementioned purpose, but it is much slower. # DirectoryIndex index.html index.html.var index.cgi .exe
13. How to disable Directory listing when an index file is missing?

Answer : If, the main alphabetize file is missing in the website root directory, then the Apache volition lists all the contents similar files and folder of the website on the browser instead of Main website pages.

To stop Apache directory listing, you lot can ready the following rule in the chief configuration file globally or in .htaccess file for a particular website.

<Directory /var/www/html>    Options -Indexes </Directory>
14. What are different log files of Apache Web Server?

Reply : The default log files of Apache Web Server are access log "/var/log/httpd/access_log" and error log :/var/log/httpd/error_log".

15. What do yous understand by "connectedness reset by peer" in fault logs?

Answer : When the server is serving whatsoever ongoing Apache request and cease user terminates the connection in betwixt, nosotros see "connexion reset by peer" in the Apache error logs.

xvi. What is Virtual Host in Apache?

Answer : The Virtual Host department contains the information like Website name, Document root, Directory Alphabetize, Server Admin Email, ErrorLog File location etc.

You are free to add together as many directives you crave for your domain, merely the ii minimal entries for a working website is the ServerName and DocumentRoot. We unremarkably ascertain our Virtual Host section at the lesser of httpd.conf file in Linux machines.

Sample VirtualHost
<VirtualHost *:80>    ServerAdmin [email protected]    DocumentRoot /www/docs/dummy-host.example.com    ServerName dummy-host.example.com    ErrorLog logs/dummy-host.example.com-error_log    CustomLog logs/dummy-host.example.com-access_log common </VirtualHost>
  1. ServerAdmin : Its usually the e-mail address of the website owner, where the fault or notification tin exist sent.
  2. DocumentRoot : location where the web files are located in the server(Necessary).
  3. ServerName : Its the domain proper name which yous want to access from your web browser(Necessary).
  4. ErrorLog : Its the location of the log file where all the domain related logs are being recorded.
17. What'southward the difference between <Location> and <Directory>?

Respond :

  1. <Location> is used to set element related to the URL / accost bar of the spider web server.
  2. <Directory> refers that the location of file organization object on the server
18. What is Apache Virtual Hosting?

Reply : Apache Virtual hosting is the concept of hosting multiple website on a single web server. At that place are two types of Virtual hosts can be setup with Apache are Name Based Virtual hosting and IP based virtual hosting.

For more than information, read on How to Create Name/IP based Virtual Hosts in Apache.

19. What practise you empathise by MPM in Apache?

Answer : MPM stands for Multi Processing Modules, actually Apache follows some mechanism to take and complete web server requests.

xx. What is the difference between Worker and Prefork MPM?

Answer : Both MPMs, Worker and prefork has their ain mechanism to work with Apache. It totally depends on you that in which mode y'all want to commencement your Apache.

  1. Bones difference between Worker and MPM is in their process of spawning the child process. In the Prefork MPM, a master httpd procedure is started and this master procedure starts manages all other child processes to serve client requests. Whereas, In the worker MPM i httpd process is agile, and information technology uses unlike threads to serve client requests.
  2. Prefork MPM uses multiple child processes with i thread each, where worker MPM uses multiple child processes with many threads each.
  3. Connexion treatment in the Prefork MPM, each process handles one connection at a time, whereas in the Worker mpm each thread handles i connectedness at a fourth dimension.
  4. Memory footprints Prefork MPM Big memory footprints, where Worker has smaller memory footprints.
21. What's the employ of "LimitRequestBody" and how to put limit on your uploads?

Answer : LimitRequestBody directive is used to put a limit on the upload size.

For example: I want to put limits of 100000 Bytes in the binder /var/www/html/tecmin/uploads. So, yous demand to add post-obit directive in Apache configuration file.

<Directory "/var/www/html/tecmint/uploads"> LimitRequestBody 100000 </Directory>
22. What is mod_perl and modernistic _php?

Answer :

  1. mod_perl is an Apache module which is compiled with Apache for easy integration and to increment the performance of Perl scripts.
  2. mod_php is used for easy integration of PHP scripts by the web server, it embeds the PHP interpreter inside the Apache procedure. Its forces Apache child process to use more memory and works with Apache only only still very popular.
23. What is Mod_evasive?

Reply : Its a tertiary-party module which helps united states of america to forestall your web server from the spider web attacks like DDOS because it performs only one task at a fourth dimension and performs it very well.

For more data, read the article that guides you lot how to install and configure mod_evasive in Apache.

24. What is Loglevel debug in httpd.conf file?

Answer : With the help of Loglevel Debug option, we can become/log more information in the mistake logs which helps united states of america to debug a problem.

25. What'due south the utilize of mod_ssl and how SSL works with Apache?

Respond : Mod_ssl package is an Apache module, which allows Apache to establish its connection and transfer all the data in a secure encrypted environment. With the help of SSL certificates, all the Login details and other important secret details get transferred in an encrypted manner over the Internet, which prevents our data from Eavesdropping and IP spoofing.

How SSL works with Apache

Whenever an https requests comes, these three steps Apache follows:

  1. Apache generates its private primal and converts that private primal to .CSR file (Certificate signing request).
  2. Then Apache sends the .csr file to the CA (Document Authority).
  3. CA will accept the .csr file and convert it to .crt (document) and volition send that .crt file back to Apache to secure and consummate the https connection request.

These are just most popular 25 questions being asked these days past Interviewers, delight provide some more interview questions which you have faced in your recent interview and help others via our Comment section below.

We are besides recommend you to read our previous articles on Apache.

  1. 13 Apache Web Server Security and Hardening Tips
  2. How to Sync 2 Apache Web Servers/Websites Using Rsync

Likewise, we are proud to announce that our Beta version of Question/Answer section of TecMint Ask is Already launched. If you accept questions on any Linux topics. Delight join united states and mail service your questions/queries at https://www.tecmint.com/inquire/.

I'll come upwards with some more Interview question on DNS, Mail servers, PHP etc in our future manufactures, till then stay Geeky and connected to TecMint.com.

lathamhatessuce.blogspot.com

Source: https://www.tecmint.com/apache-interview-questions/

0 Response to "what are some questions to ask about installation and configuration of the apache server"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel