My Centova Cast v2 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?
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).
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.shscript 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 0711 /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 0755 /home/centovacast/vhosts/*/var/log/reports chmod 0644 /home/centovacast/vhosts/*/var/log/reports/* chmod 0600 /home/centovacast/vhosts/*/var/run/* chmod -R 0755 /path-to-centovacast-web-interface/
Recursively change the owner and group of
/home/centovacastto the user account under which Centova Cast was installed. Usually, the user account is named
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
This should yield a working Centova Cast installation.
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
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
vhostpath field in the
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
rsyncfor 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.
/home/centovacast/vhostsdirectory, 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.
Unpack the Centova Cast tarball to a temporary directory.
install.shfile and set the
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.
At this point, you should have a working Centova Cast installation.