Skip to main content

How To Start, Stop And Restart Apache Server on Ubuntu Linux



INTRODUCTION

Apache is part of the popular LAMP (Linux, Apache, MySQL, PHP) stack of software. It is included by default in Ubuntu 18.04.
This guide will show you how to start, stop and restart Apache server in Ubuntu Linux using the terminal or command line.
PREREQUISITES
  • A user account with sudo or root privileges
  • An installed and configured Apache installation
  • The apt package manager which is included by default
  • Terminal window or command line
Commands for Ubuntu 18.04, 16.04 and Debian 9.x commands
Start Apache Web Server
Use the following command to start the Apache server   
 sudo systemctl start apache2  

Check status to see whether Apache is enabled using the 
following command
 sudo systemctl status apache2  

If it is running,it should display the message active (running) as in the image below
Stop Apache Web Server
Use the following commands to stop the Apache Server
 sudo systemctl stop apache2  
Check status to see whether Apache has been disable by typing the following command
 sudo systemctl status apache2  
If it has stopped running, it should display the message inactive(dead) as in the image below
Restart Apache Web Server
Use the following command to restart Apache web server
 sudo systemctl restart apache2  
If Apache was previously disabled, a status check will show it's up and running again. Use the following command to check if it is running again
 sudo systemctl status apache2  



UBUNTU 14.10 OR OLDER DEBIAN
Start Apache Web Server
For Debian and Ubuntu users with an older version, use the following commands in the terminal to start Apache server
 sudo service apache2 start  
or
 sudo /etc/init.d/apache2 start  
It should display the message active(running)
Stop Apache Web Server
To stop Apache use the following command
 sudo service apache2 stop  
or
 sudo /etc/init.d/apache2 stop  
Check status to see if Apache is disabled using the following command
 sudo /etc/init.d/apache2 status  
It should display the message inactive (dead) as shown below

Restart Apache Web Server
  To restart Apache use the following command
 sudo service apache2 restart  
or
 sudo /etc/init.d/apache2 restart  
The restart command can take several minutes to complete which is absolutely normal and depends on the complexity of your server configuration.
While doing this process please be careful to note that it can cause disruptions to users relying on the server if you are running complex or large server configurations.
Please leave a comment below if you encounter any problems using this guide or if you were successful

Comments

  1. What about us?
    Not everybody uses Linux๐Ÿ˜‚๐Ÿ˜‚

    ReplyDelete
    Replies
    1. True that, what would you like me to post about what you use

      Delete
  2. This is helpful

    ReplyDelete

Post a Comment

Your input is valued. Please type something....

Popular posts from this blog

Fun Terminal Commands Every Linux User Should Try

Accessing Maps from the terminal with MapSCII Requirements Telnet installed Internet Connection Firewall is disabled You can do this on Linux, Unix, Mac OS X or Windows with an app like PuTTY or the Windows 10 Linux bash shell or any Os that supports telnet. Open terminal and write the command below. telnet mapscii.me Hit enter and you're ready to browse and enjoy MapSCII. Navigate using the keyboard or mouse. Use the following keys on your keyboard Arrow keys: up, down, right, left A to zoom in Z to zoom out C toggles ASCII mode on/off You can also click and drag and hold on the map with your cursor. If your connection dropped without a reason, reconnect with telnet -E mapscii.me and use only cursors, A and Z to navigate. The Mapscii project is open source and you can install it locally if you'd like. Check out their project here on GitHub . The Dancing ASCII Party Parrot Requirements Curl installed Internet

SQL for Data Analysis - Udacity

  Entity Relationship Diagrams An  entity relationship diagram  (ERD) is a common way to view data in a database. Below is the ERD for the database we will use from Parch & Posey. These diagrams help you visualize the data you are analyzing including: The names of the tables. The columns in each table. The way the tables work together. You can think of each of the boxes below as a spreadsheet. What to Notice In the Parch & Posey database there are five tables (essentially 5 spreadsheets): web_events accounts orders sales_reps region You can think of each of these tables as an individual spreadsheet. Then the columns in each spreadsheet are listed below the table name. For example, the  region  table has two columns:  id  and  name . Alternatively the  web_events  table has four columns. The "crow's foot" that connects the tables together shows us how the columns in one table relate to the columns in another table. In this first lesson, you will be learning the bas

Impressive - Check if Your Email Address Has Been Hacked - Free,Easy Tutorial

haveibeenpwned.com Data breaches are rampant and many people don't appreciate the scale or frequency with which they occur. A "breach" is an incident where data is inadvertently exposed in a vulnerable system, usually due to insufficient access controls or security weaknesses in the software. How is the legitimacy of a data breach established? Attackers often give "breach" announcements, which are later revealed to be hoaxes. There is a delicate balance to be struck between making data searchable as soon as possible and conducting proper due diligence to confirm the breach's validity. In order to verify the authenticity of a violation, the following steps are normally taken: Has the affected provider made a public statement about the security breach? Does the information stolen in the breach show up in a Google search (i.e., it was simply copied from another source)? Is the structure of the data consistent with what you'd expect to see in a breach? Have