A friend was struggling with this on their installation. They’d forgotten (and not written down) their install directory for WordPress.

Here are two simple ways to find your WordPress directory and to find its wp-config.php file:

ls /var/www

That will show all of the WordPress sites installed for Apache, if your server is using the default www tree.

Or, you can look at your Apache configuration:

cd /etc/apache2/sites-available
ls -alst *.conf

For example:
0000-tweets.conf 0006-wholesomevegan.conf 001-medium.conf publishingwithwordpress.conf

sudo more 001-medium.conf

It will look something like this:

ServerName publishingwithwordpress.com
ServerAlias *.publishingwithwordpress.com
ServerAlias *wpnow.io
ServerAlias *pubwp.com
ServerAlias localhost
DocumentRoot /var/www/pwp
DirectoryIndex index.php

AllowOverride All
Order Deny,Allow
Allow from all

The answer is here:

In this case, you can find the wp-config.php file in that directory:
ls -alst /var/www/pwp

4 -rw-r--r-- 1 www-data www-data 3485 Jul 15 2014 wp-config.php

I also suggest you go back to your production server installation notes which should document which directory you installed wordpress in.

Hope this helps!

About The Author