Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Ubuntu 12.04 installed.

I have Eclipse Indigo installed.

I have LAMP installed, with the localhost being /var/www.

However, my Eclipse workspace location is /workspace.

How can I change it to /var/www same as localhost for the reasons of when I set up a project, the folder automatically is viewable via localhost on the browser.

I have tried just setting up a second workspace to /var/www. But it gives me the error:

The folder /var/www/.metadata is read-only
share|improve this question
    
probably a permissions issue. and i dont want to suggest chmod 777. it probably works, but is not advisable. –  Mahesh May 18 '12 at 18:45
    
please write as answer so i can accept –  RSM May 18 '12 at 18:52
    
as i said, its not advisable. i'll find better info and will answer shortly. –  Mahesh May 18 '12 at 18:56

1 Answer 1

up vote 5 down vote accepted

This is a permissions issue. There are several workarounds for that.

  1. sudo chmod 777 /var/www : Works definitely if its a permissions issue, but to be used with caution. It is not advisable, since that would be compromising security.
  2. ls -l /var |grep www , look at the group, and add yourself to that group, and then sudo chmod g+rwx /var/www. you may also create a new group and add yourself to it, then sudo chgrp <newGrp> /var/www and then sudo chmod g+rwx /var/www
  3. sudo chown <yourUserName> /var/www : Better than 777'ing, but not so elegant.

If you have a choice, I recommend the second one. Its the most elegant way.

share|improve this answer

Your Answer

 
discard

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.