Restart Apache UbuntuIntroductionApache can be defined as a part of the famous LAMP (short for Linux, Apache, MySQL, PHP) software stack. By default, it is contained with the current release of the Ubuntu 18.04 version. This article will show us how we can start, restart, and stop Apache service using the terminal on Ubuntu. Primarily, Apache is used for serving both dynamic web pages and static content on the WWW (World Wide Web). Various applications of the web are created expecting the features and environment that Apache facilitates. We can use one of the below techniques for restarting, starting, or stopping our httpd (Apache) server on Ubuntu:
Prerequisites
Installing Apache2 on UbuntuWe can download or install Apache2 service on our Ubuntu computer by using the following command. First, we need to update our system by using the below command: After updating the system, we need to run the following command: Commands to Start, Restart, or Stop Apache Web Server for New Ubuntu ReleasesStart Apache ServerWe can use a command for Ubuntu users using 18.04 and 16.04 versions and other Debian-based users. The command will be used in the command line window for starting Apache. The command is mentioned below: We can also see the status of whether Apache has been enabled using the command: The above command will show the active (running) message if it's running. Stop Apache ServerWe can use a command to stop the Apache server. The command is mentioned below: We can also see the status of whether Apache has been disabled using the command: The above command will show the inactive (dead) message if it's stopped running or disabled. Restart Apache ServerWe can use a command in our terminal window for restarting the Apache server. The command is mentioned below: The above command will display that it's up and again running if Apache was disabled previously. Commands to Start, Restart, or Stop Apache Web Server for Older Ubuntu ReleasesStart Apache ServerWe can use a command in our terminal window for starting Apache server for Debian and Ubuntu users using an older release. The command is mentioned below: or, We can also see the status of whether Apache has been enabled using the command: or, The above command should show the active (running) message if it's running. Stop Apache ServerWe can use a command to stop the Apache server. The command is mentioned below: or, We can also see the status of whether Apache has been disabled using the command: The above command should show the inactive (dead) message if it's stopped running or disabled. Restart Apache ServerWe can use a command in our terminal window for restarting the Apache server. The command is mentioned below: or, Important: The command, i.e., restart can take many moments to complete. It is depending on our server configuration's complexity. It can lead to disruptions for various users who depend on the server if we are running a complex or large server configuration. Next TopicUbuntu 20.04 LTS |