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 XAMPP installed, and need to edit my httpd.conf file to add a virtual host block. If I right-click on the file in Nautilus and open with gedit, I can see all the content, but it's read-only.

If I try to open it via terminal, like this:

esther@estherLinuxSony:~$ sudo gedit opt/lampp/etc/extra/httpd-vhosts.conf

It opens the root version of gedit, but there's no content in the file.

How can I edit this file?

share|improve this question
up vote 5 down vote accepted

You are missing the slash before 'opt', the following should work:

gksudo gedit /opt/lampp/etc/extra/httpd-vhosts.conf
share|improve this answer
Thank you! Could you clarify what the difference is between sudo and gksudo? It seems to work either way. – EmmyS Jan 11 '11 at 18:59
gksudo will open a graphical dialog to prompt you for your password, while sudo will do it in the terminal. – Novelocrat Jan 11 '11 at 19:16
See – Lekensteyn Jan 11 '11 at 21:01

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.