Skip to content

Commit ee79640

Browse files
committed
Docs update on website and multi-db
1 parent 381346e commit ee79640

5 files changed

Lines changed: 34 additions & 23 deletions

File tree

docs/_sidebar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323

2424
**Advanced**:
2525
- [Development guide](development/development.md)
26-
- [Database selector](development/database-selector.md)
2726
- [Migrate to RCDB2](development/rcdb2-migration.md)
2827
- [DAQ Setup](daq/daq.md)
29-
- [Website](web_site_setup.md)
28+
- [Website install](website/install.md)
29+
- [Muli-Database](website/database-selector.md)
3030

3131

3232

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The RCDB web interface supports switching between multiple databases from the br
44
When configured, a dropdown selector appears in the navbar allowing users to pick a database.
55
The selection is saved in a cookie and persists across sessions.
66

7-
## How It Works
7+
### How It Works
88

99
- The Flask app has two config keys: `AVAILABLE_DATABASES` (a dict of `name -> connection_string`)
1010
and `DEFAULT_DATABASE` (the connection string to use when no cookie is set).
@@ -14,9 +14,8 @@ The selection is saved in a cookie and persists across sessions.
1414
is not in the available list, it logs a warning and uses the first entry.
1515
- When `AVAILABLE_DATABASES` is empty (the default), all behavior is identical to a single-database setup.
1616

17-
## Configuration
1817

19-
### CLI (`rcdb web`)
18+
## CLI (`rcdb web`)
2019

2120
Use the `--add-db` flag (repeatable) to register named databases:
2221

@@ -30,6 +29,9 @@ rcdb -c mysql+pymysql://rcdb@prodhost/rcdb web \
3029
- The `-c` / `--connection` / `RCDB_CONNECTION` value becomes the default database.
3130
- If no `-c` is provided, the first `--add-db` entry is used as the default.
3231

32+
33+
## Server Configuration
34+
3335
### WSGI
3436

3537
Set the config keys directly in the WSGI script:

docs/website/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Website
2+
3+
[install.md](install.md ':include')
4+
5+
[database-selector.md](database-selector.md ':include')
Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
# Installing RCDB Website
1+
# Install on server
22

33
Instruction on how to install central RCDB website.
44

5-
We use RHEL9 + Apache Server + mod_wsgi as the example, as this is what usually is used at Jefferson Lab (now is 2025).
5+
RHEL9 + Apache Server + mod_wsgi is used as the example,
6+
as this is what usually is used at Jefferson Lab (now is 2025).
67

8+
***Notes:***
9+
10+
- The RCDB web interface requires the proper database schema to be installed
11+
- For production use, consider setting up HTTPS with SSL certificates
12+
- Consider adjusting the number of threads in the WSGIDaemonProcess directive based on your server's capacity and expected load
13+
14+
15+
### Preinstalled docker image
716
There is [a dockerfile with example Rocky Linux 9](https://github.com/JeffersonLab/rcdb/tree/main/docker/rocky)
817
(binary compatible with RHEL9) setup with config files. To build and run it:
918

@@ -17,15 +26,16 @@ docker run --rm -it --init -p 8888:80 rcdb-rocky:latest
1726
http://localhost:8888/rcdb/
1827
```
1928

20-
2129
- RHEL9 (or compatible) server with Apache HTTP Server installed
2230
- Root access or sudo privileges
2331
- Python 3.9+ (default on RHEL9)
2432
- `mod_wsgi` package for Apache
2533

26-
## Install Required Packages
34+
## Requirements
2735

28-
First, install the necessary packages:
36+
### System Packages
37+
38+
Required system packages:
2939

3040
```bash
3141
# Install Apache and mod_wsgi
@@ -35,7 +45,7 @@ sudo dnf install httpd python3-mod_wsgi python3-pip python3-devel
3545
sudo systemctl enable --now httpd
3646
```
3747

38-
There are two ways of managing rcdb and dependencies:
48+
There are two ways of managing python rcdb and dependencies:
3949

4050
- Install centrally on the server e.g. via RPM
4151
- Install venv and use mod_wsgi with python and packages from venv
@@ -68,11 +78,11 @@ dnf install -y \
6878
```
6979

7080

71-
## Install RCDB Library
81+
### Python dependencies
7282

7383
You have two options for installing the RCDB library:
7484

75-
### Option A: System-wide Installation
85+
#### Option A: System-wide Installation
7686

7787
```bash
7888
git clone --depth=1 https://github.com/JeffersonLab/rcdb.git /opt/rcdb
@@ -93,9 +103,9 @@ pip install rcdb
93103
deactivate
94104
```
95105

96-
## 3. Create the WSGI Script
106+
## WSGI Script
97107

98-
Create a WSGI script at `/group/halld/www/halldwebdev/html/rcdb/rcdb_www.wsgi`:
108+
Example HallD WSGI script is at `/group/halld/www/halldwebdev/html/rcdb/rcdb_www.wsgi`:
99109

100110
If RCDB is installed as a system-wide library:
101111

@@ -131,7 +141,7 @@ rcdb.web.app.config["SQL_CONNECTION_STRING"] = "mysql://rcdb@hallddb.jlab.org/rc
131141
application = rcdb.web.app
132142
```
133143

134-
## 4. Configure Apache
144+
## Apache Configuration
135145

136146
Create an Apache configuration file at `/etc/httpd/conf.d/rcdb.conf`:
137147

@@ -164,16 +174,10 @@ Create an Apache configuration file at `/etc/httpd/conf.d/rcdb.conf`:
164174
```
165175

166176

167-
## 5. Restart Apache
177+
**Restart Apache**
168178

169179
```bash
170180
sudo systemctl restart httpd
171181
```
172182

173-
## Additional Notes
174-
175-
- The RCDB web interface requires the proper database schema to be installed
176-
- For production use, consider setting up HTTPS with SSL certificates
177-
- Consider adjusting the number of threads in the WSGIDaemonProcess directive based on your server's capacity and expected load
178-
179183
Now your RCDB web interface should be up and running on your RHEL9 Apache server!
File renamed without changes.

0 commit comments

Comments
 (0)