Skip to content

Commit 085d526

Browse files
authored
Update INSTALL.md
1 parent 4d1dc85 commit 085d526

1 file changed

Lines changed: 51 additions & 25 deletions

File tree

INSTALL.md

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Install the following Ubuntu/Debian packages, or the equivalent for your operati
3434
- vorbis-tools (for Ogg Vorbis audio encoding)
3535

3636

37-
## Installation Steps
37+
## Files and Database Setup
3838

3939
1. Copy the OpenBroadcaster Server files to your web server's document root directory.
4040

@@ -48,34 +48,20 @@ composer install && npm install
4848

4949
4. Copy the `config.sample.php` file to `config.php` and open it in a text editor. Set the required configuration items, such as database connection details and other settings specific to your environment.
5050

51-
5. Run the following command to validate your configuration file. Correct any errors displayed in red.
52-
53-
```
54-
tools/cli/ob check
55-
```
56-
57-
6. Run the following command to install database updates. This may take a few minutes to complete.
58-
59-
```
60-
tools/cli/ob updates run all
61-
```
62-
63-
7. Set the password for the default admin user by running the following command. Enter a secure password when prompted.
64-
65-
```
66-
tools/cli/ob passwd admin
67-
```
68-
69-
8. Set up a service (or similar) to run required background tasks such as generating thumbnails and cache management. This service should ensure that `tools/cli/ob cron monitor` is running continuously.
70-
71-
9. To improve performance, uncomment the `OB_SENDFILE_HEADER` line appropriate for your webserver in `config.php`. Ensure your web server and site configuration supports this (see Nginx example below).
51+
5. To improve performance, uncomment the `OB_SENDFILE_HEADER` line appropriate for your web server in `config.php`. Ensure your web server and site configuration supports this (see Nginx example below).
7252

7353
```
7454
// define('OB_SENDFILE_HEADER', 'X-Sendfile'); // set appropriate SENDFILE header based on server (apache)
7555
// define('OB_SENDFILE_HEADER', 'X-Accel-Redirect'); // set appropriate SENDFILE header based on server (nginx)
7656
// define('OB_SENDFILE_HEADER', 'X-LIGHTTPD-send-file'); // set appropriate SENDFILE header based on server (lighttpd)
7757
```
7858

59+
## Users and Permissions
60+
61+
1. Create a dedicated user for OpenBroadcaster. This user should be the same user the web server PHP process runs as, the background task service runs as, and any manual use of the CLI tool runs as.
62+
63+
2. Ensure the paths specified in `config.php` exist and are writable by this user.
64+
7965

8066
## PHP Configuration
8167

@@ -88,8 +74,26 @@ A default PHP installation is generally adequate, though you will likely want to
8874

8975
Note that increasing `upload_max_filesize` should not be necessary given how OpenBroadcaster handles file uploads.
9076

91-
Additionally, ensure that PHP runs as a user that has write access to paths specified in `config.php`.
77+
Additionally, PHP should be configured to run as the dedicated OpenBroadcaster user. The following is an example PHP pool.d file at `/etc/php/8.3/fpm/pool.d/openbroadcaster.conf`:
78+
79+
```
80+
[openbroadcaster]
81+
user = openbroadcaster
82+
group = openbroadcaster
83+
listen = /run/php/php8.3-openbroadcaster-fpm.sock
84+
listen.owner = www-data
85+
listen.group = www-data
86+
pm = dynamic
87+
pm.max_children = 5
88+
pm.start_servers = 2
89+
pm.min_spare_servers = 1
90+
pm.max_spare_servers = 3
91+
92+
php_admin_value[memory_limit] = 512M
93+
php_admin_value[post_max_size] = 1024M
94+
```
9295

96+
This assumes the dedicated OpenBroadcaster user is `openbroadcaster`, and that Nginx is running as `www-data`.
9397

9498
## Nginx Configuration
9599

@@ -146,10 +150,32 @@ server {
146150
}
147151
```
148152

153+
## Verifying Install and Running Updates
154+
155+
1. Run the following command to validate your configuration file. Correct any errors displayed in red.
156+
157+
```
158+
tools/cli/ob check
159+
```
160+
161+
2. Run the following command to install database updates. This may take a few minutes to complete.
162+
163+
```
164+
tools/cli/ob updates run all
165+
```
166+
167+
3. Set the password for the default admin user by running the following command. Enter a secure password when prompted.
168+
169+
```
170+
tools/cli/ob passwd admin
171+
```
172+
173+
4. Set up a service (or similar) to run required background tasks such as generating thumbnails and cache management. This service should ensure that `tools/cli/ob cron monitor` is running continuously.
174+
149175

150176
## Service Configuration
151177

152-
As an example for step 8, set up a service, `/etc/systemd/system/ob.service`, as follows. Be sure to update the `ExecStart` path and `User` as necessary.
178+
The last step is to ensure `tools/cli/ob cron monitor` is running continuously in the background. To do this, you may set up a service, `/etc/systemd/system/ob.service`, as follows. Be sure to update the `ExecStart` path and `User` as necessary.
153179

154180
```
155181
[Unit]
@@ -158,7 +184,7 @@ After=network.target
158184
159185
[Service]
160186
Type=simple
161-
User=obuser
187+
User=openbroadcaster
162188
ExecStart=/path/to/ob/tools/cli/ob cron monitor
163189
Restart=always
164190
RestartSec=10

0 commit comments

Comments
 (0)