In page it says in order to solve a problem in Apache 2.4, we have to create a configuration file inside the conf-available directory. For example servername.conf.

sudo vi /etc/apache2/conf-available/servername.conf

And inside this we just need to add one line

ServerName localhost

I can do that but how do I save it ?

  • 3
    See How to exit the VIM editor? Jul 26, 2016 at 11:43
  • You can also use nano or gedit editor if you don't know how to use vi still if you want to use, just follow the answer of steeldriver's comment.
    – d a i s y
    Jul 26, 2016 at 11:52

1 Answer 1


Apparently no-one wants to answer this question, maybe trying to avoid getting into an editor war...

You might want to check out How-To-Geek's Beginner's guide to Vi

As it says here, you first have to exit insert mode by pressing esc and then type :wq

w for write and q for quit. Obvious, surely? ;)

Not the answer you're looking for? Browse other questions tagged or ask your own question.