Apache HTTP server is one of the most popular web servers in the world. It is an open-source and cross-platform HTTP server that powers a large percentage of the Internet’s websites. Apache provides many powerful features that can be extended through additional modules.
In this tutorial, we will explain how to install Apache Web server on Raspberry Pi. We’re assuming that you have Raspbian installed on your Raspberry Pi.
Apache is available in the default Raspbian repositories and the installation is pretty straightforward.
First, update the package index and afterward install the apache2
package by running the following commands:
sudo apt update
sudo apt install apache2
That’s it,at this point you have Apache web server installed on your Raspberry Pi.
To verify that everything works as expected, open your browser, type your Raspberry Pi IP address http://PI_IP
and you will see the default Apache welcome page as shown on the image below:
The page includes some basic information about Apache configuration files, helper scripts, and directory locations.
This default Apache web page is named index.html
and it is stored in the /var/www/html
directory. If you want to modify this page you need to edit the file as a sudo user. You can also remove the file and add your own HTML files.
Apache log files access.log
and error.log
are located in the /var/log/apache
directory. If you experience any issue the log files should tell you what went wrong.
#apache