5

I've got an ubuntu VM inside Virtualbox running on my desktop. I'm trying to hit it from my netbook. From within the virtual machine, I can go to

http://localhost/wordpress

and it loads great. This machine is running bridged on 192.168.2.119. If I try hitting that IP from my netbook, I get this error:

/etc/wordpress/config-192.168.2.119.php could not be found. The file is either not readable by this process or does not exist. Please check if /etc/wordpress/config-192.168.2.119.php exists and contains the right password/username.

I set up wordpress by doing the following:

sudo apt-get install wordpress
sudo ln -s /usr/share/wordpress /var/www/wordpress
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost
sudo /etc/init.d/apache2 restart

I'm not sure how to fix this or what other information to provide you. Any ideas?

4 Answers 4

5

You have to set the url of your site during installation, and since it works from localhost, I would guess that's what you set it to. There are two possible fixes...

  1. You could just change the site url to the ip address. To be able to access the site by its ip address (on both machines), you will need to do two things:

    • Log in as admin on the localhost and change the url in the wordpress configuration options menu to your IP address.
    • Run the following command to make a symbolic link to the config file:

      sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-192.168.2.119.php
      
  2. The slightly better solution is slightly more involved to set up, since it requires changes to the wp-content folder (which must be made manually), but well worth the payoff IMHO. To use this option, you will install Wordpress Multiuser Domain Mapping. Once you have completed the installation instructions, you can add multiple domains that should map to a wordpress site using the "Tools" menu. Thus, you can leave the site as "localhost" and also get there remotely by IP by adding

4

Same problem here, but with the following command any client in any network has it solved:

sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-default.php

(this is because at last wp-config.php looks for config-default.php)

2
/etc/wordpress/config-192.168.2.119.php could not be found.

I'm not a Wordpress expert, but this says a lot. It sounds like the flavor of Wordpress that you're using allows you to have a development configuration file that's read when it's accessed from localhost and other, "production" configuration files when accessed from different IP addresses.

To remedy the problem quickly you could always copy config-localhost.php to config-192.168.2.119.php - just be aware that when it goes on a public server you'll need another configuration file for it's public facing IP as well.

On closer inspection, it may be that the setup-mysql script is responsible for creating those configuration files, it will be worth looking at what that script does. Either way, it won't hurt you to have a read through wp-config.php to see how it's operating.

0

I had same problem as you.

I set in /var/ww/wordpress/wp-config.php

and add in line 35.

define('WP_SITEURL', 'http://YOUR_LOCAL_IP/wordpress');
define('WP_HOME', 'http://YOUR_LOCAL_IP');

In My Computer set IP: 10.237.58.2.

Save after this and you can access in browser http://10.237.58.2/wordpress.

You must log in to answer this question.