• Hi There
    I have just installed Apache, PHP, MySQL and WordPress on my Raspberry Pi and setup a web server with these instructions: “http://www.raspberrypi.org/learning/web-server-wordpress/worksheet.md”
    I was working on the website and changed the site url from my Pi’s IP address to my site URL(http://www.mypi.site.nz).
    Now when I try to load the page from the Pi’s IP I get this error: “Error establishing a database connection”.
    Or from the URL: The server at http://www.mypi.site.nz can’t be found, because the DNS lookup failed. DNS is the network service that translates a website’s name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.

    Any help greatly appreciated!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Incase anyone browsing the forums is unclear as to what is happening here, this guy is installing WordPress and a web server on a computer card which costs $40 or $50, and is the size of a pack of cigarettes. It has 512Mb RAM, the ‘disk’ storage is an SD camera card. Add USB keyboard and mouse and HDMI monitor, or run it over ssh or telnet.
    The operating system is various flavours of Linux.
    All the software is FREE as in “FREE BEER”, even packages such as mathematica

    ANSWER:
    So you have successfully completed the instructions at:
    http://www.raspberrypi.org/learning/web-server-wordpress/worksheet.md”

    Then you got creative and want to access your site by a name, as if it were using the DNS ?
    BUT the problmes are:
    – your rapi is on the local network, not the internet, I am not going into port forwarding and so on.
    – your name is not registered with the DNS, so will not resolve.

    Instead you can short circuit the DNS and provide your own mapping using the “hosts” file.

    So you have to do an extra step:
    – Add your IP address as the resolution of your name
    at command prompt:

    sudo nano /etc/hosts
    add a lines:
    <your ip address> mypi.site.nz
    <your ip address> www.mypi.site.nz

    save and exit

    So now your /etc/hosts file will have some extra lines like:

    192.168.1.5 mypi.site.nz
    192.168.1.5 www.mypi.site.nz

    – Now you should be able to access and login to your WordPress site from your browser at the expected address:
    http://www.mypi.site.nz/

    – You can add the SAME lines to the hosts file on any computer on your LAN, then that computer will also be able to access your webserver. The location and name of the hosts file varies with operating system, the details are here:
    http://en.wikipedia.org/wiki/Hosts_%28file%29

    Please let me know how this works.
    I have a raspberrypi website here:
    http://raspberrypi.education/
    You can get my email address from my primary website referenced there.

    You will also have to do some apache configuration:
    in /etc/apache2/sites-enabled
    edit the 001* file, clone a virtual block similar to:

    <VirtualHost *:80>
    DocumentRoot /var/www/public_html/wp
    ServerName mypi.site.nz
    </VirtualHost>

    where “/var/www/public_html/wp” is the path from the root of your WordPress install

    then restart apache2 handler:
    sudo /etc/init.d/apache2 graceful

    As an added bonus, very useful for localhost installs:

    I was able to find a way to bypass the need for FTP credentials
    by adding the code below to my wp-config.php file
    	define('FS_METHOD', 'direct');

    Please help me getting error message:

    The server at site.realvirginhumanhair.com can’t be found, because the DNS lookup failed. DNS is the network service that translates a website’s name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.

    I had gotten a contractor to set it up for me and now its down it was directed from realvirginhumanhair.com I cancel from yahoo now I can’t pull it back up please help.

    site.realvirginhumanhair.store

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cannot access server "Error establishing a database connection"’ is closed to new replies.