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 am completely new to ubuntu... THough I installed htdocs and give it permission using command

chmod -R 777 /opt/lampp/htdocs.

It works fine. But I wish to avoid it doing again and again. Their after I followed tutorial on but it doesn't work for me... as I tried ls -ld /opt/lampp/htdocs it gives me following.

drwxrwsr-x 8 nobody shadaab 4096 current-date-n-time /opt/lampp/htdocs .. As I continued with group shadaab. But it doesn't work. Again every time I have to use command chmod -R 777 /opt/lampp/htdocs if I copy something to my folder. please help.

If I run 'localhost' it works fine. but if I use 'localhost/project' it gives 'access forbidden error.'

share|improve this question
You should not give your web root 777 permissions at all. If you tell us what you are trying to achieve with this, we may be able to tell you much better and safer ways of accomplishing it. (Or that question might answer this for you.) – Eliah Kagan Aug 1 '13 at 21:46
actually, i just answered very similar question here: (…). – Dee Aug 2 '13 at 6:55

You can try this:

`sudo -s` 

sudo chmod 755 -R /opt/lampp/htdocs

You can also this:

sudo chown -R www-data:www-data  /opt/lampp/htdocs
share|improve this answer
Giving a web root 777 permissions is a very bad idea. See Why should /var/www not have chmod 777 for why. (Also, it's not necessary to issue sudo twice; if you prepend sudo to the beginning of a command, that command does not generally need to be run in a root shell. So the first sudo -s is unneccessary. But this is minor, compared to the problems associated with chmoding web-facing data directories to 777.) Although the question is asking about how to do this, any answer should mention why not to. – Eliah Kagan Aug 1 '13 at 21:45

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.