I’m trying to setup CMS (which can be found here here ) on Ubuntu 16.04 32bit.
I’m a complete noob when it comes to Ubuntu so I would like to ask you guys and gals if someone can guide me through this I would be very grateful.
Also please could you provide a lot of details from A to Z because I don't think I can solve a problem on my own when it comes to Ubuntu.
1 Answer
Copied straight from the official installation instructions:
Installation
Dependencies and available compilers
[…]
Ubuntu
On Ubuntu 16.04, one will need to run the following script to satisfy all dependencies:
# Feel free to change OpenJDK packages with your preferred JDK. sudo apt-get install build-essential openjdk-8-jre openjdk-8-jdk fpc postgresql postgresql-client gettext python2.7 iso-codes shared-mime-info stl-manual cgroup-lite # Only if you are going to use pip/virtualenv to install python dependencies sudo apt-get install python-dev libpq-dev libcups2-dev byaml-dev libffi-dev python-pip # Optional sudo apt-get install nginx-full php7.0-cli php5-fpm phppgadmin texlive-latex-base a2ps gcj-jdk haskell-platformPreparation steps
Download CMS 1.3.rc0 from GitHub as an archive, then extract it on your filesystem. You should then access the cms folder using a terminal.
Warning: If you decided to
git clonethe repository instead of downloading the archive, and you didn’t use the--recursiveoption when cloning, then you need to issue the following command to fetch the source code of the sandbox:git submodule update --initIn order to run CMS there are some preparation steps to run (like installing the sandbox, compiling localization files, creating the
cmsuser, and so on). You can either do all these steps by hand or you can run the following command:sudo ./prerequisites.py installThis script will add you to the
cmsusergroup if you answerYwhen asked. If you want to handle your groups by yourself, answerNand then run:sudo usermod -a -G cmsuser <your user>You can verify to be in the group by issuing the command:
groupsRemember to logout, to make the change effective.
Warning: Users in the group
cmsuserwill be able to launch theisolateprogram with root permission. They may exploit this to gain root privileges. It is then imperative that no untrusted user is allowed in the groupcmsuser.Installing CMS and its Python dependencies
There are a number of ways to install CMS and its Python dependencies:
Method 1: Global installation with pip
There are good reasons to install CMS and its Python dependencies via pip (Python Package Index) instead of your package manager (e.g. apt-get). For example: two different Linux distro (or two different versions of the same distro) may offer two different versions of
python-sqlalchemy. When using pip, you can choose to install a specific version ofsqlalchemythat is known to work correctly with CMS.Assuming you have
pipinstalled, you can do this:sudo pip2 install -r requirements.txt sudo python2 setup.py installThis command installs python dependencies globally. Note that on some distros, like Arch Linux, this might interfere with the system package manager. If you want to perform the installation in your home folder instead, then you can do this instead:
pip2 install --user -r requirements.txt python2 setup.py install --userMethod 2: Virtual environment
Warning: An alternative method to perform the installation is with a virtual environment, which is an isolated Python environment that you can put wherever you like and that can be activated/deactivated at will. The tool you need in order to create a virtual environment is called
virtualenv, and can be installed by looking forvirtualenvusing your Linux distribution's package manager. For example:
- Ubuntu 14.x: python-virtualenv.
- Ubuntu 16.x: virtualenv.
Once you installed
virtualenv, you will need to create a virtual environment somewhere in your filesystem. For example, let's assume that you decided to create it under your home directory (as~/cms_venv):virtualenv -p python2 ~/cms_venvTo activate it:
source ~/cms_venv/bin/activateAfter the activation, the
pipcommand will always be available (even if it was not available globally, e.g. because you did not install it). In general, every python command (python, pip) will refer to their corresponding virtual version. So, you can install python dependencies by issuing:pip install -r requirements.txt python setup.py installNote: Once you finished using CMS, you can deactivate the virtual environment by issuing:
deactivateMethod 3: Using
apt-geton UbuntuWarning: It is usually possible to install python dependencies using your Linux distribution's package manager. However, keep in mind that the version of each package is controlled by the package mantainers and could be too new or too old for CMS. On Ubuntu, this is generally not the case since we try to build on the python packages that are available for the current LTS version.
To install CMS and its Python dependencies on Ubuntu, you can issue:
sudo python setup.py install sudo apt-get install python-setuptools python-tornado python-psycopg2 python-sqlalchemy python-psutil python-netifaces python-crypto python-tz python-six python-beautifulsoup python-mechanize python-coverage python-mock python-requests python-werkzeug python-gevent python-bcrypt python-chardet patool # Optional. sudo apt-get install python-yaml python-sphinx python-cups python-pypdf2Running CMS non-installed
To run CMS without installing it in the system, you need first to build the prerequisites:
./prerequisites.py buildThere are still a few steps to complete manually in this case. First, add CMS and isolate to the path and create the configuration files:
export PATH=$PATH:./isolate/ export PYTHONPATH=./ cp config/cms.conf.sample config/cms.conf cp config/cms.ranking.conf.sample config/cms.ranking.confSecond, perform these tasks (that require root permissions):
- create the
cmsuseruser and a group with the same name;- add your user to the
cmsusergroup;- set isolate to be owned by root:cmsuser, and set its suid bit.
For example:
sudo useradd cmsuser sudo usermod -a -G cmsuser <your user> sudo chown root:cmsuser ./isolate/isolate sudo chmod u+s ./isolate/isolateUpdating CMS
As CMS develops, the database schema it uses to represent its data may be updated and new versions may introduce changes that are incompatible with older versions.
To preserve the data stored on the database you need to dump it on the filesystem using
cmsDumpExporterbefore you update CMS (i.e. with the old version).You can then update CMS and reset the database schema by running:
cmsDropDB cmsInitDBTo load the previous data back into the database you can use
cmsDumpImporter: it will adapt the data model automatically on-the-fly (you can usecmsDumpUpdaterto store the updated version back on disk and speed up future imports).