loader image
View Categories

Basic Understanding & Installation: Apache Web Server

Apache, officially known as Apache HTTP Server, is one of the world’s most widely used and reliable web servers. Developed and maintained by the Apache Software Foundation, it is an open-source software that allows you to serve web pages and applications over the internet or an intranet. It is highly configurable, secure, and designed to work efficiently on Linux and other operating systems.

Key Features of Apache:

  1. Open Source: Freely available and highly customizable.
  2. Cross-Platform: Runs on Linux, Windows, macOS, and other operating systems.
  3. Modularity: Supports modules (e.g., mod_rewrite, mod_ssl) to extend functionality.
  4. Configuration: Configured primarily using text files like httpd.conf and .htaccess.
  5. Performance: Supports concurrent connections and load balancing.
    Flexibility: Handles static content (e.g., HTML) and dynamic content (via PHP, Python, etc.).
  6. Security: Features like SSL/TLS encryption, authentication mechanisms, and robust logging.
  7. Community Support: Backed by a large community and extensive documentation.

Common Uses of Apache in Linux:

  • Hosting websites and web applications.
  • Serving static and dynamic content.
  • Acting as a reverse proxy or load balancer.
  • Setting up a local development environment.
  • Running content management systems (e.g., WordPress, Drupal).
Code Box with Copy Button

Installation #

For Debian/Ubuntu Based OS #

sudo apt-get install apache2
Code Copied

For Centos/RPM Based OS #

sudo dnf install httpd
Code Copied

OR #

sudo yum install httpd
Code Copied

Code Box with Copy Button

Enabling & Starting Services #

For Debian/Ubuntu Based OS #

systemctl enable apache2
Code Copied
systemctl start apache2
Code Copied

For Centos/RPM Based OS #

systemctl enable httpd
Code Copied
systemctl start httpd
Code Copied

Code Box with Copy Button

Location of Apache Main Configuration File #

For Debian/Ubuntu Based OS #

/etc/apache2/apache2.conf
Code Copied

For Centos/RPM Based OS #

/etc/httpd/conf/httpd.conf
Code Copied

Code Box with Copy Button

Location of Apache Server Additional Configuration Files #

For Debian/Ubuntu Based OS #

/etc/apache2/sites-available/
Code Copied

For Centos/RPM Based OS #

/etc/httpd/conf.d/
Code Copied

You cannot copy content of this page