Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed apache2 in my ubuntu 12.4 using sudo apt-get install apache2, now i am not able to start the server, when i use service apache2 start, following things were displayed.

    bharathkumar@hkbharath:~$ service apache2 start
    * Starting web server apache2                                                     
    /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
    mktemp: failed to create directory via template `/var/lock/apache2.XXXXXXXXXX': No such file or directory
    chmod: missing operand after `755'
    Try `chmod --help' for more information.

i tried uninstalling and reinstalling apache2, but still getting the same thing, please help me to start my apache2 server.


share|improve this question
up vote 5 down vote accepted

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.

share|improve this answer
yeah i did the same thing and added the output file of mktemp to that folder. – hkbharath Jun 17 '13 at 17:56

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
sudo service apache2 restart
share|improve this answer
I am getting the same thing as i shown in the question.?? can you give me some more suggestions – hkbharath Jun 9 '13 at 19:25
Are you using sudo? – Leo Jun 9 '13 at 19:26
Try what I added in the answer. – Mitch Jun 9 '13 at 19:31
Getting same messages.. – hkbharath Jun 9 '13 at 19:34
Try mktemp, and use the output /tmp/tmp.xxxxxxxxxx to store your output. – Mitch Jun 9 '13 at 19:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.