vlad's picture

I have a VM on ESXi on my local network with Wordpress installed. IP address is 192.168.0.130. When it was single-site, everything worked just fine both from local network (my workstation is 192.168.0.65) and from outside (I have a laptop with mobile 4G Internet on it). No problems at all.

But when I configured multi-site, the situation changed the very strange way. Wordpress is working fine from my LAN (all the sites can be accessed), but I am timing out when I am trying to connect from outside. Error message is “192.168.0.130 connection time out” (vven though I used IP address of my router, NOT this internal address).

I am sure this is NOT a router issue: it is working fine when I power on my backup copy of virtual machine (all the configuration is the same, but the backup copy has a single-site wordpress on it, this is the only difference between them).

Also even in multi-site environment I can connect to other pages like http://<address of my router>/wp-content/uploads/2013/04/1434351426.jpg – only http://<address of my router> is not accessible.

Checked and double-checked everything (multi-site configuration, DB configuration, many similar incidents on Internet, and so on). Nothing found.

May be this can help somehow: during troubleshooting I changed define('DB_HOST', 'localhost');

to define('DB_HOST', '192.168.0.130'); in wp-config.php file (because I supposed that DB location is different in multisite environment). Got a message:

Error establishing a database connection WordPress Appliance - Powered by TurnKey Linux

But when I click a link in that message – everything start working! I can use the “Back” button and browse my site (I was not able to do that before).

So with this change everything is working, but with an error message at the very beginning.

So for me it looks like DB_HOST for single-user and multi-user are somehow different? Any help will be appreciated.

Thanks,

Vlad.

Forum: 
Jeremy Davis's picture

Or 127.0.0.1 (which is localhost expressed as IP)

The only reason to use a specific IP would be if you are using a remote DB server.

Having said that I haven't worked much with WordPress and very, very little with multisite...

Also if I were you I would make sure that you have both your internal and remote DNS configured correctly. The internal DNS should point to the local IP (i.e. 192.168.0.130) whereas your external should point towards your external IP (which is then internally redirected to your VM).

IMO you should ensure that there are no references to your VM's IP (other than within DNS config). All other references should be to localhost (for internal stuff e.g. DB config) or the FQDN (with the DNS setup correctly).

I would also suggest entering the FQDN(s) into the VMs hosts file (/etc/hosts). I.e. if you are using folders for the multisite just the FQDN; for subdomains I would add both FQDNs.

Add new comment