Linux apache2 start, stop, restart / systemctl status reload (Debian, Ubuntu)

4 points
Created by:

Quick solution:

sudo service apache2 restart
sudo service apache2 start
sudo service apache2 stop


Second option:

sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop


systemctl apache2

# status
sudo systemctl status apache2.service

# reload
sudo systemctl reload apache2


Other useful examples:

root@server:/etc/apache2/sites-available# a2en
a2enconf  a2enmod   a2ensite

root@server:/etc/apache2/sites-available# a2
a2disconf  a2dismod   a2dissite  a2enconf   a2enmod    a2ensite   a2query

root@server:/etc/apache2/sites-available# a2ensite
Enabling site
To activate the new configuration, you need to run:
  systemctl reload apache2


Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂