A colleague has just overwritten a live httpd.conf file on a server with a blank version - Apache is still running and hasn't yet been reloaded. Is there any way of recovering the configuration it's currently using to run?

server-info is not running, so I can't recover with /server-info?config, and 'apachectl -S' is mentioned in a few similar threads, although this only displays 'VirtualHost configuration: Syntax OK'

Does anyone know another way of recovering this?

  • Do you have mod_info enabled? – Lenniey Mar 7 '17 at 16:18
  • @Lenniey - Sorry, that's what I meant by server-info not running, hasty typing on my end - No, unfortunately it's not running. – Dabien Mar 7 '17 at 16:25
  • 2
    Ah sorry, I obviously didn't read your question completely. As far as I know there is no other way than backup. (I hope you got some...) – Lenniey Mar 7 '17 at 16:27
  • Find the Apache master (father) process, and inspect /proc/$PID/fd you may find symlinks to deleted files but you can get their content (a simple cat is enough). As a last resouce you could dump the whole Apache running memory and hope to find in it strings containing your configuration. Also, depending on how the overwrite did happen, the underlying filesystem may give you some help. Also look for automated backup files that some editors do, like httpd.conf~ or similar. – Patrick Mevzek Mar 7 '17 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.