How To

Apache on Ubuntu 26.04 Installation Guide for Beginners

Setting up Apache Ubuntu 26.04 is one of the fastest ways to launch a reliable web server for hosting websites and applications. Apache remains one of the most widely used open-source web servers thanks to its flexibility, stability, and extensive module support.

Ubuntu 26.04 includes Apache packages in its default repositories, making the installation process simple even for beginners. In this guide, you’ll learn how to install Apache, allow web traffic through the firewall, and configure a virtual host for hosting multiple websites.

Why Use Apache Ubuntu 26.04?

Apache is trusted by developers, businesses, and Linux administrators worldwide. It supports dynamic modules, SSL integration, URL rewriting, and virtual hosting. Because Ubuntu 26.04 offers long-term support and updated packages, it provides a stable environment for running production websites.

Apache also works well with PHP, MySQL, and other popular web technologies, making it a solid choice for both personal and enterprise deployments.

Install Apache on Ubuntu 26.04

Before installing Apache, refresh your Ubuntu package index:

sudo apt update

Next, install the Apache web server package:

sudo apt install apache2

Once the installation finishes, Ubuntu automatically starts the Apache service. You can verify its status with:

sudo systemctl status apache2

If Apache is running correctly, the service status will show as active.

Configure Firewall for Apache

Ubuntu systems commonly use UFW as the firewall manager. To allow both HTTP and HTTPS traffic, enable the Apache Full profile:

sudo ufw allow 'Apache Full'

After applying the rule, check the firewall status:

sudo ufw status

This step ensures visitors can access your server through ports 80 and 443 without connectivity issues.

Verify Apache Installation

To confirm Apache is working properly, open a browser and enter your server IP address:

http://your_server_ip

You should see the default Apache welcome page. This confirms the web server is installed and accessible from the network.

You can also test locally using:

curl http://localhost

Create an Apache Virtual Host

Virtual hosts allow Apache to host multiple websites on the same server. Start by creating a website directory:

sudo mkdir -p /var/www/example.com

Then create a sample HTML file:

sudo nano /var/www/example.com/index.html

Next, create a virtual host configuration file inside /etc/apache2/sites-available/.

A standard configuration should include:

  • ServerName
  • DocumentRoot
  • Log file locations
  • Directory permissions

After saving the configuration, enable the site:

sudo a2ensite example.com.conf

Test the Apache configuration:

sudo apachectl configtest

Finally, restart Apache:

sudo systemctl restart apache2

Final Thoughts on Apache in Ubuntu 26.04

Deploying Apache Ubuntu 26.04 is straightforward and beginner-friendly. With only a few commands, you can install a fully functional web server, secure firewall access, and configure virtual hosts for multiple domains.

Whether you are hosting a personal project, running a development environment, or deploying a production website, Apache on Ubuntu 26.04 provides a dependable and scalable solution for modern web hosting.

Cyber Defence

Recent Posts

Install Apache Cassandra on Ubuntu 18.04: NoSQL Setup Guide

Apache Cassandra is a free, open-source NoSQL database designed for high availability and linear scalability with…

1 hour ago

Install Rocket.Chat on Ubuntu 18.04 with Nginx and Let’s Encrypt

Rocket.Chat is a free, open-source team communication platform built with the Meteor framework. It is a…

2 hours ago

Install MySQL on Ubuntu 18.04: Setup, Security, and Root Access

MySQL is the most popular open-source relational database management system. It is fast, reliable, and scales…

2 hours ago

Install Apache on Ubuntu 18.04: Web Server Setup and Config

Apache is the most widely used web server in the world. It is free, open-source, and…

2 hours ago

Install NetBeans IDE on Ubuntu 18.04 with Snap and OpenJDK 8

NetBeans is a free, open-source, cross-platform IDE developed by the Apache Software Foundation. It was one…

2 hours ago

Install Pip on Ubuntu 18.04: Python 3 and Python 2 Setup Guide

Pip is the official package manager for Python and the standard way to install libraries from…

5 days ago