0

I'm trying to fix an apache2 error (see... Why is my Apache not working after upgrading to Ubuntu 14.04? to understand the error) but to do that I have to use gedit, now after installing gedit and using the command (shown in the link) sudo gedit /etc/apache2/sites-available/000-default.conf and I get this error... Gtk-WARNING **: cannot open display: Even if I try gksudo gedit /etc/apache2/sites-available/000-default.conf and sudo nano /etc/apache2/sites-available/000-default.conf it gives me the same message (including when I type in gksudo nano). What's the problem with this?

1 Answer 1

1

You do not have to use gedit. Since you are on a server system, likely with only a terminal console available, you will need to either use X11 forwarding with ssh, or a terminal based editor.

To edit the file under sudo, just use sudo nano rather than gksudo. If you wish to forward your display, you can use ssh -X and then gksudo and gedit will work, but be somewhat slow, depending on your connection to the server.

2
  • it still gives me the same error message
    – RyanP
    Jun 24, 2015 at 20:58
  • another problem is that with the "edit" command it says that I can't get access ot the file
    – RyanP
    Jun 24, 2015 at 21:01

You must log in to answer this question.

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