Install |RCE| ============= To install |RCE|, download and run the installer script. This script installs |RCE|, Pylons, and all other required |py| libraries into an activated ``virtualenv`` and starts an instance. To do this, use the following example. Installing on Linux ------------------- Use the following example to install on a Linux distro. .. code-block:: python # makes a directory for RhodeCode Enterprise mkdir ~/rhodecode # navigates into the directory cd ~/rhodecode # Downloads the installer curl -O -L https://rhodecode.com/trial/rhodecode-installer.py # Runs the installer sudo python rhodecode-installer.py Installing on Windows --------------------- To install |RCE| on Windows, use the installer. You can download it here |rhodecode-installer.exe|. This installs |RCE| 2.2.5. To upgrade to |RCE| 2.2.6, use the following steps: 1. Navigate into your |RCE| virtual environment 2. Upgrade |RCE| using the following command: ``paster upgrade production.ini`` Using Pip --------- You can also install |RCE| using pip from our server. To install |RCE| use the following command: * ``pip install https://rhodecode.com/dl/latest`` To upgrade using pip, use the following command: *``pip install --upgrade https://rhodecode.com/dl/latest`` Configuring |RCE| ----------------- If you need to make changes to the default installation, then you must alter the configuration file. This configuration file contains the various settings for |RCE|, e.g proxy port, email settings, cache, celery settings, and logging details. By default the file is created in the following location: ``~/rhodecode/data/production.ini``. If it does not exist, create the configuration file using the following command. .. code-block:: python rhodecode-config --filename=production.ini Setting up Email ---------------- To setup email with your |RCE| instance, open the default ``~/rhodecode/data/production.ini`` file and uncomment and configure the email section. .. code-block:: python #email_to = admin@localhost #error_email_from = paste_error@localhost #app_email_from = rhodecode-noreply@localhost #error_message = #email_prefix = [RhodeCode] #smtp_server = mail.server.com #smtp_username = #smtp_password = #smtp_port = #smtp_use_tls = false #smtp_use_ssl = true ## Specify available auth parameters here (e.g. LOGIN PLAIN CRAM-MD5, etc.) #smtp_auth = Changing Database Settings -------------------------- If you wish to make a database change in |RCE| you need to specify the database details in the ``production.ini`` file. In this file you must properly adjust the database url. If you have not created a database you can create one by running the following command. .. code-block:: python paster setup-rhodecode production.ini This will prompt you for a ``root`` path. This ``root`` path is the location where |RCE| will store all repositories on the current machine. After entering this ``root`` path the ``setup-rhodecode`` command will also prompt you for a ``username`` and ``password`` for the initial admin account. If you need to set the database, use the following example to get started, MySQL and PostgreSQL. .. code-block:: python # SQLITE [default] sqlalchemy.db1.url = sqlite:////root/rhodecode/data/rhodecode.db?timeout=60 # see sqlalchemy docs for other advanced settings sqlalchemy.db1.echo = false sqlalchemy.db1.pool_recycle = 3600 sqlalchemy.db1.convert_unicode = true Setup |RCE| Shortcut -------------------- Use the following example to setup |RCE| in one command. .. code-block:: python paster setup-rhodecode production.ini --user=marcink --password=secret --email=marcin@rhodecode.org --repos=/home/marcink/my_repos - The ``setup-rhodecode`` command will create all of the needed tables and an admin account. When choosing a root path you can either use a new empty location, or a location which already contains existing repositories. If you choose a location which contains existing repositories |RCE| will simply add all of the repositories at the chosen location to its database. .. note:: The path for mercurial_ repositories **must** be write accessible since the |RCE| web interface will work without write access, but when trying to do a push will fail with permission denied errors. Run |RCE| --------- To run |RCE| with the ``paster`` command, use the following example. .. code-block:: python paster serve production.ini This command runs the |RCE| server. The default web app location is ``127.0.0.1:5000``. You can set this in the ``production.ini`` file under the **COMMON** section. .. code-block:: python ## COMMON ## host = 0.0.0.0 port = 5000 Install **rcextensions** ------------------------ You can install the ``rcextensions`` package with |RCE|. This must be installed in the same location as your ``production.ini`` file. ``rcextensions`` adds additional mapping for whoosh, statistics, and adds additional code for |repo| hooks. This is used for for sending signals to build-bots such as jenkins_. For more information, see the ``__init__.py`` file inside the ``rcextensions`` package. To install ``rcextensions``, use the following example: .. code-block:: python rhodecode-extensions --config=/path/to/production.ini Whoosh Full Text Search ----------------------- The whoosh index can be build by using the ``paster`` command with the ``make-index`` option. To use the``make-index`` option you must specify the configuration file that stores the location of the index. You can also specify the location of the repositories you wish to index with the ``--repo-location`` option. If this is not specified, the location is retrieved from the database. You can also specify a comma separated list of repositories with the ``--index-only`` option to build an index of just the specified |repos| and omitting any others from the index. To enable a full index rebuild use the ``-f`` option. Without the `-f` option, indexing will run always in "incremental" mode. Use the following examples to build your required Whoosh full text search. .. code-block:: python paster make-index production.ini # Incremental build paster make-index production.ini -f # Full index build paster make-index production.ini --index-only=vcs,rhodecode # Only index these repos In order to do periodical index builds and keep your index always up to date. It's recommended to do a crontab entry for incremental indexing. Use the following example to set up a cronjob. .. code-block:: python crontab -e # open cron job file # rebuild a full index every from scratch every Sunday at 4am 01 4 * * 0 /path/to/python/bin/paster make-index /path/to/rhodecode/production.ini -f Install Celery (Optional) ------------------------- By default, |RCE| works in synchronous mode. Running |RCE| with Celery_ will give you a large speed improvement when handling many large repositories. Celery is an asynchronous task manager based on distributed message passing, and this makes asynchronous task queuing work efficiently. If you install Celery you also need multi-broker support. The recommended message broker is rabbitmq_. If you make the decision to run |RCE| with Celery you need to run ``celeryd`` using the ``paster`` command and message broker. To configure Celery and RabbitMQ, see the documentation here_ on the Celery website. .. _virtualenv: http://pypi.python.org/pypi/virtualenv .. _python: http://www.python.org/ .. _mercurial: http://mercurial.selenic.com/ .. _celery: http://celeryproject.org/ .. _rabbitmq: http://www.rabbitmq.com/ .. _here: http://docs.celeryproject.org/en/master/getting-started/brokers/rabbitmq.html .. _jenkins: http://jenkins-ci.org/ .. |rhodecode-installer.exe| raw:: html rhodecode-installer.exe