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:
- Open Source: Freely available and highly customizable.
- Cross-Platform: Runs on Linux, Windows, macOS, and other operating systems.
- Modularity: Supports modules (e.g., mod_rewrite, mod_ssl) to extend functionality.
- Configuration: Configured primarily using text files like httpd.conf and .htaccess.
- Performance: Supports concurrent connections and load balancing.
Flexibility: Handles static content (e.g., HTML) and dynamic content (via PHP, Python, etc.). - Security: Features like SSL/TLS encryption, authentication mechanisms, and robust logging.
- 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).
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
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
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
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