Having problem while starting apache server

I had the same problem running on a virtual server. Turns out that /var/lock is a symbolic link to /run/lock, which didn't exist. I solved it like this:

sudo mkdir /run/lock

Then restart Apache:

sudo service apache2 restart

Hope it works for you.


To start Apache, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo /etc/init.d/apache2 start 

You can also try

sudo /etc/init.d/apache2 restart
or
sudo service apache2 restart