Welcome to the Linux Foundation Forum!

Lab 3.1. Apache Web Server Status

Hello, everyone! This is yc, I am new here and am using Linux Mint.

I understand that Lab 3.1 will let me practise using systemctl to monitor and control the state of the Apache Web Server (apache2 or httpd, depending on my distribution). I do not know what to do with the following results from my Terminal:

yc@W530:~$ sudo systemctl status httpd
[sudo] password for yc:
Unit httpd.service could not be found.
yc@W530:~$ sudo systemctl status apache2
Unit apache2.service could not be found.
yc@W530:~$

Would anyone guide me how to take it further from here please?

Answers

  • Flavia
    Flavia Posts: 2,665

    Hi,

    It looks like this post is in the incorrect forum. Can you please advise what course is this about?

    Thank you,
    Flavia

  • Flavia
    Flavia Posts: 2,665

    Since Linux Mint is a Debian-based distribution, it uses apache2. However, based on your output, it looks like the Apache Web Server isn't installed on the system yet. You will need to first install it and them attempt the lab again.

  • Dear Flavia

    Thank you for responding to me. My replies:

    1. "Can you please advise what course is this about?" - it is from the "Introduction to Linux (LSF101)", see the attached screenshot.
    2. How to install the apache2? Could you guide me please.
  • fazlur.khan
    fazlur.khan Posts: 77
    edited July 27

    Dear @Yin Chen LEE

    Apache just isn't installed yet on the system. Please follow below commands to install and practice the commands further.

    • sudo apt update
    • sudo apt install apache2
    • systemctl status apache2
    • curl -I localhost
    • sudo systemctl stop apache2
    • sudo systemctl start apache2
    • sudo systemctl restart apache2
    • sudo systemctl reload apache2 # re-read config, no dropped connections
    • sudo systemctl disable apache2 # don't start at boot
    • sudo systemctl enable apache2 # start at boot
    • systemctl is-active apache2
    • systemctl is-enabled apache2
  • zleap2026
    zleap2026 Posts: 5

    I have a Raspberry pi 4, set up with ssh so I can remote login and experiment with the command line etc, I tried to complete this lab and also found apache2 was not installed so after installing it, I was still having issues.

    I posted the output from

    sudo systemctl status apache2

    To my local linux user group, and was told from the output that something else was also running on port 80, so I did some research and the 'ss' command

    sudo ss -tlnp sport = :80

    will tell you what else is running on port 80 (or the specified port), it seems on the pi, nginx is already installed and running. So have completed the lab using that.

    This may be useful to other people studying the course, I am not too sure if it is essential to use apache2 for this course, both are web servers, However finding out if anything else is running on a port will probably be useful anyway.

    Hope this helps

    Paul

Categories

Upcoming Training