Apache HTTP Server also known simply as Apache is a powerful and widely used open-source web server software. Its reliability, scalability, and extensive module support have made it a preferred choice for hosting websites and web applications. Apache is primarily designed to serve static content such as HTML pages, images, and files over the HTTP protocol.
It’s highly configurable and supports various modules for extending its functionality, making it suitable for hosting websites and web applications built with technologies like HTML, CSS, JavaScript, and PHP. Apache HTTP Server is often used in conjunction with other components like MySQL or MariaDB and PHP, forming the LAMP stack for hosting dynamic web applications.
To install Apache HTTP Server on Linux follow these general steps.
Update Package Lists
First, update the package lists to ensure you’re getting the latest versions of the software.
sudo apt update
Install Apache
Apache is the web server you’ll use to serve your PHP files.
sudo apt install apache2
Verify installation
Check the Apache Version.
apache2 -v
Check if Apache is running.
sudo service apache2 status
Apache HTTP Server should now be installed and running on your Linux system. You can now start configuring Apache to serve your web applications or websites.
Manage server
The following commands serve to manage the Apache HTTP server on a Linux system, allowing easy control and monitoring of the server’s status and operation.
sudo service apache2 restart
sudo service apache2 status
sudo service apache2 start
sudo service apache2 stop
These commands are useful for managing the Apache service, such as starting, stopping, restarting, and checking its status.
Test localhost
Show Apache Default Page. Open your web browser and enter the following text into the address bar.
http://localhost/