Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers 3

up vote 2 down vote accepted

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

share|improve this answer
add comment
/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.

share|improve this answer
add comment

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)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.