top of page

HTTPD

Writer's picture: easSylinuxeasSylinux

Updated: Dec 30, 2017

1) What does Apache server mean?


Ans:- Apache Web Server is designed to create Web servers that have the ability to host one or more HTTP-based websites. It is also widely used by Web hosting companies for the purpose of providing shared / virtual hosting.


2) What is the main configuration file for Apache web server?


Ans:- httpd.conf


3) How to check the version of apache web server?


Ans:- rpm –qa |grep httpd or httpd –v


4) What is the location of log files for apache web server?


Ans:- /var/log/httpd


5) What is the default document root for apache web server?


Ans:- /var/www/html                              


6) What are the types of virtual host?


Ans:- name-based :-> name-based virtual host means that multiple names are running on       each ip address.

ip-based :-> ip-based virtual host means that a different ip address exist for each website served.


7) On which port Apache web server work?


Ans:- By default Apache runs on http port 80 and https port 443 (for SSL certificate).


8) Apache runs as which user and which group?


Ans:- User  “apache” and group  “apache” 


9) Command to start Apache web server?


Ans:- service httpd start (RHEL-6)

         systemctl start httpd.service (RHEL-7)


10) In httpd.conf file what is the meaning of “listen” parameter?


Ans:- Port no on which to listen for non secure transfer.


11) What is Document Root?


Ans:- it is the location of file which is used by clients. We can put here our html sides.


12) What is the main difference between <Location> and <Directory> sections?


Ans:- Directory sections refer to file system objects , Location sections refer to elements in

the address bar of the Web page


13) What is the difference between a restart and a graceful restart of a web server?


Ans:- 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.


14) What is the SElinux Context for Document Root in Apache web server?


Ans:- httpd_sys_content_t


15) What is the SElinux Context for Port in Apache web server?


Ans:- http_port_t


16) What is HTTPS?


Ans:- HTTPS is HyperText Transfer Protocol Secure works On Port no 443 . In HTTPS we use SSL/TLS certificates for security.


17) Some Times we see pad lock in URL What’s That?


Ans:- Sir ,Its represent our website is secure , i mean it’s based on SSL/TLS Certificates.


18) SSL ?


Ans:- SSL stands for Secure Socket Layer.


19) TLS?


Ans:- TLS(Transport Layer Security) is a method for encrypting network communications. TLS allows a client to verify the identity of the server and optionally, allows the server to verify the identity of the client. TLS is based around the concepts of certificates. A certificate has multiple parts a Public key , server identity , and a signature from certificate authority.    


20) What is ServerRoot in apache web server?


Ans- The top of the directory tree under which the servers configuration error and

         log files  are kept.


ServerRoot “/etc/httpd”


21) Please Explain Directives in Apache Web Server with their explanation.


Ans:-


Timeout – the number of seconds before receives and sends time out.


For example:- Timeout 60


MaxKeepAliveRequests – The maximum number of requests to allow during a persistent connection set to 0 to allow an unlimited amount.


For example:- MaxKeepAliveRequests 100


MaxKeepAliveTimeout – number of seconds to wait for the next request from the same client on the same connection.


For eg:- MaxKeepAliveTimeout 1S


Listen – Allows you to bind apache to specific IP-Addresses or ports.


For example:- Listen 172.25.254.250:80

Listen 80


LimitRequestBody – put a limit on upload size


For example:- LimitRequestBody 10000


ServerAdmin – your address, where problems with the server should be e-maild.


For example:- ServerAdmin root@localhost


ServerName – servername  gives the name and port that the server uses identify itself.


For example:- www.eaSylinux.com


DocumentRoot – the directory out of which you will serve your documents.


For example:- DocumentRoot /var/www/html


Allowoverride – controls what directives may be placed in  .htaccess files


DirectoryIndex – sets the file that Apache will serve if a directory is requested.


For example:- DirectoryIndex index.html


ErrorLog – the location of error log file . if you do not specify an ErrorLog directive within

<VirtualHost> container, error message relating to that virtual host will be logged here


Errorlog logs/error_log


VirtualHost – if you want to maintain multiple domains or hostnames on your machine you can setup virtualhost containers for them.


Require all granted – allow access to this directory. Setting this on a directory outside of the normal content tree can have security implications.


Require all denied – httpd will refuse to serve content out of this directory.


22) HTTPS?


Ans:- HTTPS is combination of HTTP and SSL/TLS . the communication is purely encrypted which means no one know what you are looking for.


23) To configure a Virtual Host with TLS what we need?


Ans:- first - obtain a signed certificate ,  

         second –Install Apache modules to support TLS .

         (for example mod_ssl)                                                                          

         third- configure a virtual host to use TLS. 


24) I want to change default Apache Port HOW can i?


Ans:- There is a directive Listen in httpd.conf  (Apache configuration file) file which allows us to change the default Apache port .


25) Can we have two Apache Web servers on a single mahine?


Ans:- yes we can run two different Apache servers at one time on a linux machine ,but the condition for that is they should listen on different ports, and we can change the ports with Listen directive of Apahe web server with the help of httpd.conf file.


26) What is VirtualHost in Apache?


Ans:- The virtualhost section contains the information like website name, document root , directory index, server admin , error log files and many more.


27) What is mod_perl?


Ans:- mod_per is Apache module which is used to increase the performance of perl script


28) What is mod_ssl?


Ans:- mod_ssl is Apache module which is used to protect website with TLS.


29) Tell me about allow directive  in Apache?


Ans:- Allow directive controls which hosts can access an area of the server. Access can be controlled by hostname, ip-address ,ip address range.


For example:-


Allow from grras.org

Allow from thanks.com 

(Host whose names match , or end in , this string are allowed access.)

Allow from 172.25.200.201

Allow from 172.25.1.11  172.25.1.30

(An ip address of host allowed access)


30) Tell me about deny directive in Apache?


Ans:- Deny directive Controls which hosts can denied  an area of the server. This directive allows access to the server to be restricted based on hostname, ip-address ,ip address range.


For example:-


Deny from grras.org

Deny from thanks.com .net

(Host whose names match , or end in , this string are denied )                                            

Deny from 172.25.200.201

Deny from 172.25.1.11  172.25.1.30

(An ip address of host that not allowed for access)


31) If I set order allow,deny then what will happen?


Ans:- First, all Allow directives are evaluated; at least one must match, or the request is rejected. Next, all Deny directives are evaluated. If any matches, the request is rejected. Last, any requests which do not match an Allow or a Deny directive are denied by default.


32) If I set order deny,allow then what will  happen?


Ans:- First, all Deny directives are evaluated; if any match, the request is denied unless it also matches an Allow directive. Any requests which do not match anyAllow or Deny directives are permitted.


33) Explain -

                    Order Deny,Allow

                    Deny from all

                    Allow from eassylinux.com


Ans:-In the following example, all hosts in the eassylinux.com domain are allowed access, all other hosts are denied access.


34) Explain –

                    <Directory  /var/www/html>

                            Order Allow,Deny

                    </Directory>


Ans:- will Deny all access to the var/www/html directory because the default access state is set to Deny.


35) Explain –

                   <Directory  /var/www/secret>

                            Require  valid-user

                    </Directory>


Ans:- In the above example, authentication will be required for the /var/www/secret directory.


36) I want to access WEB via the Terminal How can i?


Ans:- by using elinks command you can access WEB via terminal .

          for example :- # elinks https://eassylinux.wixsite.com/root


GOOD LUCK !

103 views0 comments

Recent Posts

See All

YUM

1) How to check the installed software (rpm’s) on Redhat Linux ? Ans:- rpm -qa package_name (or) rpm -qa | grep package_name* For...

NFS

1) Why we use NFS server? Ans :- we used NFS (Network File Sharing) server to share a file or a directory over the network but we can...

FTP

1) Why we use FTP server? Ans :- The File Transfer Protocol (FTP) is used to downloads and upload the files over a network. 2) On which...

Комментарии


Never Miss a Post. Subscribe Now!

connect with us and stay in loop with easSylinux

© easSylinux
bottom of page