4

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
2
  • probably a permissions issue. and i dont want to suggest chmod 777. it probably works, but is not advisable.
    – Mahesh
    May 18, 2012 at 18:45
  • as i said, its not advisable. i'll find better info and will answer shortly.
    – Mahesh
    May 18, 2012 at 18:56

1 Answer 1

6

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .