Posts tagged Ubuntu

How to start and stop Apache 2 in Ubuntu Linux

How to start Apache 2:

sudo service apache2 start

How to stop Apache 2:

sudo service apache2 stop

How to restart Apache 2:

sudo service apache2 restart

How to reload Apache 2:

sudo service apache2 reload

Reloading is useful if you change a virtualhost file, since it will not actually stop Apache. Therefore, your websites will not go offline (even for a few seconds).

How to get the Ubuntu version from the commandline

lsb_release -a

Look for the line that starts with Release:. The following number is your version number. As of this writing, mine says Release: 12.04, which means I am running Ubuntu version 12.04.