joelerr
By:
joelerr

What deleted my WordPress app directory?My WordPress app directory disappeared;I didn't mess with it. honest. Root gives no such directory.

December 13, 2017 257 views
WordPress Ubuntu 16.04

Setup: Ubuntu 16.06, digital ocean droplet. Single WordPress app on a micro droplet.

Customizations:

  • used certbot for SSL install
  • turned off firewall, configured my own firewall rules using UFW
  • added cloudflare free plan, 3 basic wordpress brute force rules.

All this was working (honest) and the site was up and accessible up to midday yesterday. I wasn't even working on it remotely - working locally most of the day. Then I checked it at the end of the day and boom! app directory gone. Everything else appears normal - I can access it via ssh and console and all the users I added are there,etc.

Any ideas how I can tell what stupid thing I did to find out if I deleted it? Any way to tell if Server Pilot did something that might have deleted it?

ServerPilot still shows WordPress as connected to the app.

getfacl on the app directories show everything normal with root having read access to everything.

1 comment
  • also I did a history | grep rm , and nothing out of the ordinary. doesn't look like I deleted it.

1 Answer

ahh..

I'm sure it had to do with me trying to create a wordpress user that was jailed to the wordpress directory, and then deciding to delete the user later when I realized I needed a home directory for keys.

I can't recreate the exact sequence of events since its spread across users, but I think it went something like this :

sudo adduser --home /srv/users/serverpilot/apps/wordpress wpsys
mkhomedir_helper wpsys
#that didn't seem to work, so I did this:
usermod -m -d /home/wpsys wpsys
#and then later decided I didn't need the user
userdel -r wpsys

my suspicion is that I screwed up the sequence and deleted the original home directory which was the wordpress directory when I deleted the user. It shouldn't have done that since I thought I moved the user's home directory to /home/wpsys but apparently it either deleted both the original directory and the last one, or I deleted the user before the new home directory was assigned.

good thing I had a recent digital ocean backup. also, not really a big deal since I can just download and install wordpress separately, but I wanted to make sure it wasn't something serverpilot did when it didn't like some of the customizations I did.


Also - the server's just being used for staging at the moment ...

Have another answer? Share your knowledge.