How to restart apache2 when I get a pid conflict?

Thanks to @douggro who found the answer.

Find the processus id of Apache2 with :

pidof apache2 

Kill the process(es) :

sudo kill -9 <pid>

Then you can start Apache2 as usually :

sudo service apache2 start

UPDATE

If sudo kill -9 <pid> doesn't work, just try sudo kill <pid> !


After trying various one liners that did not work I found this

kill -9 $(pidof apache2)

that seems to work just fine