|
1 | 1 | # Installing RCDB Website |
2 | 2 |
|
3 | | -Here RHEL9 + Apache Server + mod_wsgi is considered as this setup is mainly used at Jefferson Lab. |
| 3 | +Here RHEL9 + Apache Server + mod_wsgi is considered as this setup is mainly used at Jefferson Lab. |
4 | 4 |
|
| 5 | +There is a dockerfile with example Rocky Linux 9 (binary compatible with RHEL9) setup with config files: |
| 6 | + |
| 7 | +```bash |
| 8 | +# Assuming cwd is rcdb repo root: |
| 9 | +cd docker/rocky |
| 10 | +docker build -t rcdb-rocky:latest . |
| 11 | +docker run --rm -it --init -p 8888:80 rcdb-rocky:latest |
| 12 | + |
| 13 | +# site should be seen on |
| 14 | +http://localhost:8888/rcdb/ |
| 15 | +``` |
5 | 16 |
|
6 | | -## Prerequisites |
7 | 17 |
|
8 | | -- RHEL9 server with Apache HTTP Server installed |
| 18 | +- RHEL9 (or compatible) server with Apache HTTP Server installed |
9 | 19 | - Root access or sudo privileges |
10 | 20 | - Python 3.9+ (default on RHEL9) |
11 | 21 | - `mod_wsgi` package for Apache |
12 | 22 |
|
13 | | -## 1. Install Required Packages |
| 23 | +## Install Required Packages |
14 | 24 |
|
15 | 25 | First, install the necessary packages: |
16 | 26 |
|
17 | 27 | ```bash |
18 | 28 | # Install Apache and mod_wsgi |
19 | | -sudo dnf install httpd python3-mod_wsgi |
20 | | - |
21 | | -# Install required Python packages |
22 | | -sudo dnf install python3-pip python3-devel |
| 29 | +sudo dnf install httpd python3-mod_wsgi python3-pip python3-devel |
23 | 30 |
|
24 | 31 | # Start and enable Apache |
25 | 32 | sudo systemctl enable --now httpd |
26 | 33 | ``` |
27 | 34 |
|
28 | | -## 2. Install RCDB Library |
| 35 | +There are two ways of managing rcdb and dependencies: |
| 36 | + |
| 37 | +- Install centrally on the server e.g. via RPM |
| 38 | +- Install venv and use mod_wsgi with python and packages from venv |
| 39 | + |
| 40 | +Both have procs and cons. |
| 41 | +Using system-wide packages simplifies centralized updates across multiple RHEL servers; |
| 42 | +If you need specific package version and package isolation from system changes and |
| 43 | +e.g. when multiple sites on a server require different versions of the same packages, |
| 44 | +a dedicated Python virtual environment is preferable. |
| 45 | + |
| 46 | +**If you choose to use route A - RPMs*** |
| 47 | + |
| 48 | +``` |
| 49 | +# Enable EPEL and CRB |
| 50 | +dnf install -y epel-release |
| 51 | +dnf config-manager --set-enabled epel |
| 52 | +dnf config-manager --set-enabled crb |
| 53 | +
|
| 54 | +# Install rcdb dependendencies |
| 55 | +dnf install -y \ |
| 56 | + python3-markupsafe \ |
| 57 | + python3-click \ |
| 58 | + python3-rich \ |
| 59 | + python3-sqlalchemy \ |
| 60 | + python3-mako \ |
| 61 | + python3-ply \ |
| 62 | + python3-PyMySQL \ |
| 63 | + python3-pygments \ |
| 64 | + python3-flask |
| 65 | +``` |
| 66 | + |
| 67 | + |
| 68 | +## Install RCDB Library |
29 | 69 |
|
30 | 70 | You have two options for installing the RCDB library: |
31 | 71 |
|
32 | 72 | ### Option A: System-wide Installation |
33 | 73 |
|
34 | 74 | ```bash |
35 | | -sudo pip3 install rcdb |
| 75 | +git clone --depth=1 https://github.com/JeffersonLab/rcdb.git /opt/rcdb |
| 76 | + |
| 77 | +# Install RCDB *without* re-downloading dependencies (they are from RPM) |
| 78 | +# The --no-deps flag ensures pip won’t try to reinstall them. |
| 79 | +cd /opt/rcdb/python |
| 80 | +python3 -m pip install --no-cache-dir --no-deps . |
36 | 81 | ``` |
37 | 82 |
|
38 | 83 | ### Option B: Virtual Environment (Recommended) |
|
0 commit comments