Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 4 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
2  
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
1  
See psychocats.net/ubuntu/graphicalsudo –  Lekensteyn Jan 11 '11 at 21:01

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.