
Complete Guide to Apache Web Server Setup - Installation and Configuration Tutorial
- AuthorBen H.
- Date
- Time15 minutes
What is Apache?
Apache is the world's most popular web server software, powering approximately 40% of all websites. It's known for its reliability, security and extensive feature set.
Prerequisites
- A Linux server (Ubuntu, Debian, CentOS)
- Root or sudo access
- Basic command line knowledge
- Domain name (optional)
Installation
Update your package list and install Apache:
sudo apt update
sudo apt install apache2Basic Configuration
Enable required Apache modules:
sudo a2enmod rewrite
sudo a2enmod ssl
sudo systemctl restart apache2Virtual Hosts
Create a new virtual host configuration file in the sites-available directory:
sudo nano /etc/apache2/sites-available/example.confSSL Configuration
Install Certbot and obtain SSL certificate:
sudo apt install certbot python3-certbot
sudo certbot --apache -d example.comPHP and MariaDB
Install PHP and MariaDB:
sudo apt install php libapache2-mod-php php-mysql
sudo apt install mariadb-server
sudo mysql_secure_installation"Apache's versatility and robust ecosystem make it the perfect foundation for your web hosting needs. With proper configuration and security measures, you can build a reliable and high-performance web server that scales with your applications."



