Top 20 Tips on Apache Web Servers, key information from a web servers

Knowing key information from a web server can be fun and useful, but not everyone may have enough time to study related documents. 

While it takes hours to compile and write this article, it will take only 2 to 5 minutes to read.

The tips mentioned in this article may also be needed in job interviews. Earlier posts on the Apache server were introduced and how to install it. In this article we have compiled some interesting tips about this web server that are recommended for your loved ones. Before reading this article, it is recommended that you refrain from memorizing them until you understand the implications.

What is Apache Web Server?

Apache is one of the most famous and powerful web servers in the world that is open source for hosting files and web pages across the Internet and network. This web server is based on the HTTP protocol, or Hyper Text Transfer, which is a communication standard between the server and the client. This web server supports SSL, CGI files and other features.

How to understand Apache version?

First check with the package management command whether this web server is installed, then use the following commands to check the web server version in the Command-Line environment.

Installation Instructions:

rpm -qa | grep httpd

Check the web server version:

httpd -v

What Apache is running under it? Where is the main Apache configuration file located?

Apache runs under the “nobody” or “apache” username. The address of the main Apache configuration file is in the CentOS and RHEL explanations at: etc / httpd / conf / httpd.conf / and in the Ubunto and Debian explanations at / etc / apache2.con.

Which port does Apache use for the http and https protocols?

By default, Apache uses port 2 for the http protocol and port 2 for the https protocol. You can change the settings of the listed ports if needed by changing the original file. You can view the port in use using the netstat command.

netstat -antp | grep http

How to install Apache on a Linux system?

It’s so easy to do! This tool can be easily installed on the Linux server using the Package manager. Note that when using Package Manager for installation, the latest Stable version will be installed for the Linux version used. If you want to use the latest version of this web server you can download the installation file then install it through the source.

Installation on RHEL and CentOS:

yum install httpd

Installing on Ubuntu and Debian:

apt-get install apache2

3. What is the directory of the Apache configuration directory?

By default, all Apache configuration directories are located in the descriptions of RHEL, CentOS and Fedora at / etc / httpd / and in Debian and Ubuntu at / etc / apache2.

Explanations of RHEL, CentOS and Fedora:

Debian and Ubuntu Explanations:

3. Can Apache be secured using TCP Wrapper?

Because of lack of support for libwrap.a library, Linux cannot be secured using this library.

How to change Apache default port?

In the Apache configuration file there is a variable called Listen which can change the default port of http and https.

4. Can one Apache server use up to 4 Apache web servers?

Yes, on one server you can use up to 3 Apache web servers at the same time, but the default port is that one of the web servers for the http protocol is on the other port in Listen mode.

What is DocumentRoot?

In Apache, DocumentRoot means a directory or directory on the server that stores webpage files. By default DocumentRoot is located at / var / www / html / or / var / www /. You can have a different DocumentRoot for each host. To change the master address you need to enter the settings file and change the DocumentRoot created in the Virtual Host.

What is DirectoryIndex?

DirectoryIndex is the name of the first file to look for when sending a request to the domain. For example, when the request is sent to the domain name www.wikiconfig.ir, Apache searches for the index.php file and then compiles it to find the index using php, and then sends the generated html page to the user. In fact DirectoryIndex is the name of the first file to display. To change this, open the main Apache configuration file, then make the changes by editing the DirectoryIndex variable.

3. How to disable directory listing or directory listing when there is no Index file?

When there is no index file, all the files and directories on the website will be displayed. This may be problematic for you in many ways.

To fix this, just paste the following code into the main configuration file or htaccess file.

<Directory / var / www / html>
-Indexes Options
</Directory>

What is the Apache Log File Name and where is it located?

The default Apache log for accessing and connecting users is access_log, located at var / log / httpd / access_log / and the Apache Error log named error_log at var / log.httpd / error_log.

2. What is the reason for the “Connection reset by peer” error in Apache Error Log?

This error will be written to the log when Apache is serving or responding to a user request and the user interrupts the connection between these operations.

What is a Virtual Host?

Virtual Host is part of the main configuration file that is created for each domain or subdomain. In the Virtual Host, information such as admin email, logs for the specified domain, DocumentRoot address, etc. will be located, which may vary for each domain address depending on your needs.

A Virtual Host Block:

<VirtualHost *: 80>
ServerAdmin info@wikiconfig.ir
DocumentRoot / home / wikiconfi /
ServerName wikiconfig.ir
ErrorLog logs / wikiconfig.ir-error_log
CustomLog logs / wikiconfig.ir-access_log common
</VirtualHost>

What is the difference between Location and Directory?

<Location> Items related to URLs.
<Directory> Related to the address of files and folders on the server.

What is the concept of Apache Virtual Hosting?

Apache Virtual Hosting is basically the concept and rules for servicing multiple sites on a server. There are two types of Virtual Hosts on the server. The first is domain based ( Name Based Virtual Hosting ) and the second is IP based ( IP based virtual hosting ).

What does MPM in Apache mean?

MPM or Multi Processing Modules provide specific mechanisms to respond to user requests. There is a variety of working modes available for Apache.

What is the difference between Worker MPM and Prefork MPM?

Worker and Prefork both have their own mechanisms for working in Apache. When one or more requests are sent to Apache in the Worker MPM mode, an Apache Process is activated and responds to the user request using different threads, while in the Prefork MPM mode a Master Process is created and generated and managed Child Process handles the request.

What is LimitRequestBody?

LimitRequestBody is a variable in the main configuration file used to apply volume restrictions when downloading.

3. What is the Mod_evasive Mazeol Performance?

With this module, you can counter attacks such as DDOS and prevent it. This module is third party and by default does not exist in Apache and you must install it for use.

You can search the Internet for more information on the submissions. We hope this article is helpful to you dear ones.

Leave a Reply

Your email address will not be published. Required fields are marked *