Quote:So, I'm working on our webhost via SSH (it's a dedicated virtual server) with root credentials ...
That's kinda your mistake there, to start with.
The rest of your post suggests you're inexperienced, so it would have been safer to us a lower-privileged account to do your normal tasks then elevate yourself (via sudo or some other command) as and when needed - something referred to as the "Principle Of Least Privilege".
Essentially, your post could have just as easily read "I was playing with several guns and when I squeezed the trigger on one of them it rattled noisily for a while, causing several people around me to scream and fall in blood spurting from various locations. Now, I'm no expert in any of this, but did something go wrong?"
I know none of this is going to be of any consolation to you, but take stock of the fact that you're not the only person to have done it, and also in terms of a learning experience this is probably the only time you'll do it - you'll be much more cautious from now on.
What can help you now is some post-event analysis:
- What could you have done differently to prevent it? (policy, procedure, etc.)
- What have you had to do to recover it? If you had to recover it again, how can you make this process easier (disaster recovery plan)
Quote:so you’ll need to restore or reinstall I think.
Hybrid's suggestion there is the most truthful answer. In your position, I would get the server reinstalled then restore backups of my configs (apache files, etc) so that the server is reconfigured back into its original state, then recover my data back into the right areas. I know I'm able to do this since my backup strategy directs my recovery strategy - I have worked out what to copy off the server and how often in the event of a disaster.