Knowledge Base
Disaster recovery
Mar 13, 2009 05:21 PM
Question:
My Centova Cast installation was damaged and I tried to repair it. I've re-uploaded all of the files; can I just set the permissions to 0777 to make everything work?
Answer:
No. Setting permissions to 0777 is guaranteed to cause problems -- both technical and security-related. Note that Centova Cast is not a typical PHP script; it is a control panel, and due to its nature of operation it has special requirements in terms of ownerships and permissions. More information is included in the sections below.Procedures described hereunder are dangerous and unsupported
Please note that we cannot provide support for anything explained below; this article is intended to assist advanced users in recovering a damaged installation, but this is outside of the scope of the Centova Cast support agreement. Please also note that the procedures described below are advanced and risky, and may result in data loss if performed incorrectly.
Recovery by a Centova Technologies Technician
If you have any doubts about your ability to perform a recovery, but are sure your data is intact, you may wish to contact Centova Technologies to have an experienced technician perform the recovery for you. In most cases, this requires less than an hour of time and thus will only incur a fee of one hour of professional services (priced at USD$69.99 at the time of this writing).
Manual recovery
If you are sure you have re-uploaded all of the files correctly, and/or your original files are still intact and have not been damaged or deleted, and are all located in the same paths as you originally installed them:
- If you are using Centova Cast v2.2.0 or better, you can run the /home/centovacast/scripts/fixperms.sh script to automatically correct your filesystem permissions and ownerships. If you use this script, you can skip steps 2-4.
NOTE: This script makes a best-effort attempt to fix the permissions problems, but in some cases it may fail. If you receive any errors, you will need to proceed with the manual process in steps 2-4 below. - Ensure that the permissions on /home/centovacast and your Centova Cast web interface directory (and their contents) are NOT 0777. Set them as follows to ensure that they are correct:
chmod -R 0755 /home/centovacast
chmod 0711 /home/centovacast/vhosts/*
chmod 0700 /home/centovacast/vhosts/*/etc
chmod 0700 /home/centovacast/vhosts/*/var/log
chmod 0700 /home/centovacast/vhosts/*/var/run
chmod 0600 /home/centovacast/vhosts/*/etc/*
chmod 0600 /home/centovacast/vhosts/*/var/log/*
chmod 0600 /home/centovacast/vhosts/*/var/run/*
chmod -R 0755 /path-to-centovacast-web-interface/ - Recursively change the owner and group of /home/centovacast to the user account under which Centova Cast was installed. Usually, the user account is named 'centovacast', i.e.:
chown -R centovacast.centovacast /home/centovacast/ - Change to the /home/centovacast/system/runascc directory and run these two commands:
rm -f runascc spawn castd
make all
Changing the Centova Cast user account
While we strongly recommand against doing so, if you change the UID/GID of the user account under which Centova Cast runs as part of the above process, you will need to edit the Centova Cast database and change the ccuid/ccgid fields in the 'settings' table to match the new UID/GID.
Changing the Centova Cast core files path
While we strongly recommand against doing so, if you change the location of Centova Cast's files, you will need to edit config.php in your Centova Cast web interface directory, as well as in /home/centovacast, and update them with the new path. You will also need to edit your Centova Cast database and change the 'vhostpath' field in the 'settings' table.
Reinstallation and recovery
If your Centova Cast installation is damaged beyond repair, the best approach is often to reinstall Centova Cast, then restore your old data. Please note that this is a particularly risky procedure; be sure to backup your data carefully in advance.
To perform a reinstallation and subsequent recovery:
- Backup your Centova Cast database and the /home/centovacast/vhosts/ directory, maintaining permissions and ownership on the latter (i.e., using tar or rsync for the backup). If either of these items are lost, then your installation has sustained permanent data loss and recovery will not be possible.
Note that this is not simply a cautionary procedure; you will need to restore this backup at the end of the recovery process, so do not skip this step. - Delete the /home/centovacast/system directory, the /home/centovacast/vhosts directory, and your Centova Cast web interface directory.
- Download a fresh copy of Centova Cast from the Centova Technologies web site. Ensure that you download the exact same version as you already have installed. If you are using an older version that is no longer listed on our web site, please contact us and we will provide a copy of the older version if it is available.
- Unpack the Centova Cast tarball to a temporary directory.
- Edit the install.sh file and set the CREATEUSER setting to 0. This will allow Centova Cast to re-use your existing Centova Cast UID/GID.
- Install Centova Cast as usual, as descrbied in the installation manual. Ensure that you install it exactly as you did the first time (using the same paths and so-on) otherwise your database will become desynchronized from the configuration files.
- Remove all tables from the newly-installed Centova Cast database, and restore the backup you made of your Centova Cast database.
- Restore your backup of the /home/centovacast/vhosts/ directory, maintaining ownerships and permissions.








