Being driven to distraction trying to setup multiple environments with Craft. I have Craft running (and working) locally without issue. I have created a staging server with Digital Ocean and setup the appropriate database. I'm using DeployBot to push changes from Github.
However upon trying to access the remote server, I get the following errors:
Service Unavailable
Our site is temporarily unavailable. Please try again later.
and
Craft can’t connect to the database with the credentials in craft/config/db.php.
I'm sure there is an obvious solution to why this isn't working, but I'm yet to find it.
Here are my db.php and general.php files with sensitive data redacted:
db.php
return array(
'*' => array(
'database' => '******',
'tablePrefix' => 'craft',
),
'localhost' => array(
'server' => 'localhost',
'user' => 'root',
'password' => 'root',
),
// Use IP of your droplet and MySQL credentials of a user you created
'000.000.000.000' => array(
'server' => '000.000.000.000',
'user' => 'root',
'password' => '***********',
)
);
config.php
<?php
return array(
'*' => array(
'omitScriptNameInUrls' => true,
'devMode' => true,
'loginPath' => 'users/login',
'postLoginRedirect' => 'commerce/customer',
'setPasswordPath' => 'users/setpassword',
'enableCsrfProtection' => true,
),
'000.000.000.000' => array(
'siteUrl' => 'http://000.000.000.000/',
'environmentVariables' => array(
'basePath' => '/var/www/html/',
'baseUrl' => 'http://000.000.000.000/',
)
),
);
Also index.php file for good measure
<?php
// Path to your craft/ folder
$craftPath = '../craft';
// Do not edit below this line
$path = rtrim($craftPath, '/').'/app/index.php';
if (!is_file($path))
{
if (function_exists('http_response_code'))
{
http_response_code(503);
}
exit('Could not find your craft/ folder. Please ensure that <strong><code>$craftPath</code></strong> is set correctly in '.__FILE__);
}
require_once $path;
Help needed and much appreciated!