js

Monday, December 16, 2024

How to check apache installed in ubuntu

 

To check whether Apache is installed on an Ubuntu system, you can use the following methods:


1. Check Apache Service Status

Run the following command to check if the Apache service exists and its status:

sudo systemctl status apache2
  • If Apache is installed, you will see details like its status (active or inactive).
  • If Apache is not installed, you will see an error message stating that the service does not exist.

2. Check for Apache Package

Use the dpkg or apt command to check if Apache is installed as a package:

dpkg -l | grep apache2

OR

apt list --installed | grep apache2
  • If Apache is installed, the output will show the Apache package (e.g., apache2).

3. Check Apache Executable

You can check if Apache's binary exists in the system path:

which apache2
  • If Apache is installed, this command will show the path to the apache2 binary (e.g., /usr/sbin/apache2).

4. Check HTTP Port 80

If Apache is running, it will typically listen on port 80. Check this with:

sudo lsof -i :80
  • If Apache is running, you will see an entry like apache2 listening on port 80.

5. Check Apache Version

If Apache is installed, you can check its version directly:

apache2 -v
  • If Apache is installed, it will display the version information.

6. Check for Apache Default Page

If Apache is running, test it by accessing the default web page:

  1. Open a web browser.

  2. Enter your server's IP address or localhost:

    http://localhost
    

    OR

    http://<server-ip-address>
    
  3. If Apache is running, you will see the Apache2 Ubuntu Default Page.


Summary

If Apache is not installed, install it with:

sudo apt update
sudo apt install apache2 -y

Let me know if you need help installing or configuring Apache! 🚀

No comments:

Post a Comment

Importent softwares to install for Developers after installing UBUNTU

PHP sudo apt install php libapache2-mod-php MYSQL sudo apt install mysql-server Install . deb file in ubuntu sudo dpkg -i package-name.deb