Task 3: Broken Owncloud - KeegMitch/Operations-Engineering-group-c GitHub Wiki

Manual backup command

sudo rsync -avz /var/www/owncloud/ group-c@backup-c:/home/group-c/ownclould_backup/

At 10:37 and 11:19 reseived critical messages on slack for the http check. Discovered that the owncloud was down and not responding. Found that the Apache2 was stopped, Started it again and got a new error.

image (1)

Checked the logs for any other issues that may be causing the down time using

 sudo tail -n 100 /var/log/apache2/error.log

image

var/www/owncloud/config/config.php

<?php
$CONFIG = array (
  'updatechecker' => false,
  'instanceid' => 'oc106zisx7h1',
  'passwordsalt' => '6cswAylxuDIJOtWz9DSlAYo3dtw5JF',
  'secret' => '9K9g6jcf2Vn1ygvO6cIkgLsyfikASw0Co3NIWK85p5TNbwze',
  'trusted_domains' =>
  array (
    0 => '13.75.139.57',
  ),
  'datadirectory' => '/var/www/owncloud/data',
  'overwrite.cli.url' => 'http://13.75.139.57',
  'dbtype' => 'mysql',
  'version' => '10.14.0.3',
  'dbname' => 'owncloud',
  'dbconnectionstring' => '',
  'dbhost' => 'db_c',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => '**********', //Wrong Password
  'allow_user_to_change_mail_address' => '',
  'logtimezone' => 'UTC',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/owncloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/owncloud/apps-external',
      'url' => '/apps-external',
      'writable' => true,
    ),
  ),
  'installed' => true,
);
Syntax Error

Evetual found the Syntax Error in the config.php and removed it. Had to come back later and take a closer look to find the dbhost was wrong with 'db_c' instead of 'db-c' and that the actual password had been changed to 'wrong_password'.

<?php
$CONFIG = array (
  'updatechecker' => false,
  'instanceid' => 'oc106zisx7h1',
  'passwordsalt' => '6cswAylxuDIJOtWz9DSlAYo3dtw5JF',
  'secret' => '9K9g6jcf2Vn1ygvO6cIkgLsyfikASw0Co3NIWK85p5TNbwze',
  'trusted_domains' =>
  array (
    0 => '13.75.139.57',
  ),
  'datadirectory' => '/var/www/owncloud/data',
  'overwrite.cli.url' => 'http://13.75.139.57',
  'dbtype' => 'mysql',
  'version' => '10.14.0.3',
  'dbname' => 'owncloud',
  'dbconnectionstring' => '',
  'dbhost' => 'db-c',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => '********',
  'allow_user_to_change_mail_address' => '',
  'logtimezone' => 'UTC',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/owncloud/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/owncloud/apps-external',
      'url' => '/apps-external',
      'writable' => true,
    ),
  ),
  'installed' => true,
);
~

Once the errors had been corrected owncloud came back up

image

MYSQL attack that we lost all user data in. Our backups were flawed and ended up overwriting the backup with the user data with a backup that didn't have any. After this incident the backup where updated to include there date, This means that each backup is now distinct and will not overwrite themselves again.

There was a change in the etc/apache2/sites-available/owncloud.conf: the document root was changed to var/www/non-existent when it should have been var/www/owncloud. The permission on the var/www/owncloud were also changed and had to be fixed with sudo chmod 755 /var/www/owncloud