Skip to main content

How to Install Apache HTTP Server on Manjaro

The Apache HTTP Server, commonly referred to as Apache, is a free and open-source web server software. It is highly popular and widely used due to its stability, flexibility, and security. In this tutorial, we will walk you through the step-by-step process of installing Apache HTTP Server on Manjaro, a user-friendly Linux distribution.

Prerequisites

Before we begin, ensure that you have the following:

  • A Manjaro installation up and running
  • Access to a terminal or command line interface

Step 1: Update System Packages

It's always a good practice to start by updating your system packages to the latest versions. Open a terminal and execute the following commands:

sudo pacman -Syu

This will update all the packages on your Manjaro system.

Step 2: Install Apache HTTP Server

Manjaro provides the Apache HTTP Server package in its official repositories. To install Apache, run the following command in the terminal:

sudo pacman -S apache

You will be prompted to enter your password. Provide it and press Enter to continue. Manjaro will then download and install Apache HTTP Server along with its dependencies.

Step 3: Start and Enable Apache Service

Once the installation is complete, you need to start the Apache service and enable it to automatically start at system boot. Run the following commands:

sudo systemctl start httpd
sudo systemctl enable httpd

The first command starts the Apache service, and the second command enables it. If there are no errors, Apache should now be up and running on your Manjaro system.

Step 4: Verify Apache Installation

To verify that Apache is installed and running correctly, open a web browser and enter http://localhost in the address bar. If Apache is working properly, you will see the default Apache page, which confirms a successful installation.

Step 5: Configure Firewall

By default, Manjaro comes with the ufw firewall tool. If you have it enabled, you need to allow incoming connections on port 80 (HTTP) to access your Apache server. Run the following command to enable HTTP traffic:

sudo ufw allow http

If you are using a different firewall tool, consult its documentation on how to allow incoming HTTP connections.

Step 6: Customize Apache Configuration (Optional)

To customize Apache's behavior, you can modify its configuration files. The main configuration file is located at /etc/httpd/conf/httpd.conf. Before making any changes, it's recommended to create a backup of the original file:

sudo cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.backup

You can then open the file in a text editor and make the necessary modifications. Common changes include adjusting the server's document root, enabling virtual hosts, or setting up SSL/TLS encryption.

Conclusion

Congratulations! You have successfully installed Apache HTTP Server on your Manjaro system. You can now host websites, web applications, or serve static content using this powerful web server. Remember to keep Apache and your system up to date with security patches to ensure a safe and reliable hosting environment.

Further Reading