Linux/ Debian / Ubuntu: Restart Apache 2 web server
Use
# /etc/init.d/apache2 restart
OR
$ sudo /etc/init.d/apache2 restart
OR
$ sudo service apache2 restart
OR
simply create an alias for the command that works for you.
alias rsws='/etc/init.d/apache2 restart'
Using my alias ‘rswd’
$ rsws
[ ok ] Restarting apache2 (via systemctl): apache2.service.