Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Not sure what I've done here or maybe it was someone else but when I try and start apache I get the following error:

Syntax error on line 1 of /etc/apache2/apache2.conf: Invalid command 'VimCrypt~01!J\xc7\xcc$Q\xbe'\xee\x04\x8dIfv\x8dk\x8e:\x92&\x80j\x8a\xf8\xcc\xa5\xd8]\x8e....etc', perhaps misspelled or defined by a module not included in the server configuration

When I try to open the apache2.conf file in gedit I get the error:

Could not open the file /etc/apache2/apache2.conf

And when I try in vim to open it it asks for an encyption key.

Does anyone know what's happened here? Very confused!

Thanks a lot

share|improve this question

migrated from stackoverflow.com Nov 17 '11 at 16:48

This question came from our site for professional and enthusiast programmers.

1  
It looks like someone ran vim crypt on your apache2.conf file. Is that possible? This might be useful: stackoverflow.com/questions/575817/… –  Noah Clark Nov 16 '11 at 21:26
    
Yeah seems so, so how can I solve this issue? How would I create a new apache config file? –  ostegg548 Nov 16 '11 at 21:43
    
You should have a backup laying around. So, from a backup? –  Noah Clark Nov 16 '11 at 21:52
    
can't find a backup anywhere, is there a standard place these are kept? –  ostegg548 Nov 16 '11 at 21:59
1  
You might have something laying around named apache2.conf~ left over from vim or something. Other than that, I'm not aware of any backup. Depending on how vital the server is you might be better off just rebuilding the .conf file from scratch. You should also install a backup system like backuppc (or even dropbox) as soon as you get this resolved for all your servers. –  Noah Clark Nov 16 '11 at 22:16

4 Answers 4

Someone edited it in vim and saved it encrypted.

share|improve this answer
    
Well the problem came about when we rebooted, I don't think anybody has encypted it –  ostegg548 Nov 16 '11 at 21:26
    
If the file is encrypted, containing a header that says it's an encrypted Vim file, it's pretty safe to say somebody encrypted it. –  jgoldschrafe Nov 17 '11 at 16:58

there you should be a backup of your conf file around, usually apache2-default.conf. try copying that with your changes to overwrite the last conf. again, copy it and don't move it or you could do this - http://ubuntuforums.org/showthread.php?t=662889 to get orignal copies of your conf files.

i hope this helps

share|improve this answer

Or you can hope that you have a version of vim prior to 7.3 on your system

Vim encryption: how to break it?

share|improve this answer
  1. Restore the file from backup. If you don't have backups create backups as soon as you solve this problem using backuppc or even something as simple as dropbox. You NEED backups!

  2. If you are editing this with a file editing tool that then you should try to find the file on your system that is called apache2.conf~ that maybe left over.

  3. If this fails look through Vim encryption: how to break it? to figure out if you can crack the encryption.

  4. Failing cracking it you'll need to recreate the system using any notes you may have or trial and error. It is possible that you have a system default laying around called `apache2-default.conf' that you should try to restore. You can copy an apache config file from else where but each system may have a different directory such as /srv or /opt where these files are kept and you'll need to customize them for your own purposes.

  5. If you can recreate part of the file exactly, it may help you to search for known strings in the config file and this may find any last ditch efforts to help you reconfig your system.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.