This document will provide a set of commands and guidelines to manage the servers.
Project Overview
This README will guide you through the necessary steps to manage and maintain the servers & sites.
Useful Commands
Here are some essential commands for managing the servers:
Wordpress
To manually submit joined users of a workshop do below: https://jsonformatter.org/xml-parser (recording.event[*].name)
<?php
$names = []; // Placeholder for names
foreach ($names as $name) {
$result = $wpdb->get_row($wpdb->prepare("SELECT * FROM `wp_users` WHERE `display_name` = %s", $name));
$wpdb->insert("wp_saho_workshops", array(
'user_id' => $result->ID,
'meta_key' => "z3169",
'meta_value' => 1,
'workshop_title' => "ورکشاپ برندسازی و بازاریابی مد",
'slug' => "fashion-branding-and-marketing-workshop/",
'join_time' => "1617560399"
));
}
?>
Extract all workshop users:
<table>
<?php
if ($user_id == 1) {
$students_courses = $wpdb->get_results("SELECT * FROM `{$table_prefix}saho_workshops`");
$count = [];
foreach ($students_courses as $student_course) {
$user = get_user_by('id', $student_course->user_id);
$username = $user->user_login;
$name = $user->first_name . " " . $user->last_name;
$row_id = $student_course->id;
$mobile = get_user_meta($student_course->user_id, "mobile", true);
$count[] = $mobile;
}
$list_count = array_count_values($count);
foreach ($list_count as $key => $value) {
?>
<tr>
<td><?php echo $key ?></td>
<td><?php echo $value ?></td>
</tr>
<?php
}
}
?>
</table>
BigBlueButton
BigBlueButton management
bbb-conf —check
bbb-conf --clean
systemctl restart bbb-web.service
BigBlueButton recordings
bbb-record --debug
service bbb-rap-archive-worker start
service bbb-rap-sanity-worker start
service bbb-rap-publish-worker start
# Check if ffmpeg is converting a recording:
ps aux | grep ffmpeg
FFMPEG Conversion Options:
nano /usr/local/bigbluebutton/core/lib/recordandplayback/generators/video.rb
Is there a way to pause and resume FFmpeg encoding? Live Webcam Quality Increase FFMPEG Quality Increase
Recorded meeting didn’t get processed when BBB is restarted? Create /var/bigbluebutton/recording/status/recorded/<\internal meeting id>.done
touch /var/bigbluebutton/recording/status/recorded/eb60ea08d8238fdca0c946f35126b7b825999999-1592026999999.done
Useful Links: Recording Video-Audio Sync Problem Fix: Link1 Link2
BigBlueButton update
Backup following before update:
- /var/bigbluebutton/playback/presentation/2.0
If getting 403 error for downloading components or packages:
# Edit this file
nano /etc/resolv.conf
Add below lines
nameserver 178.22.122.100
nameserver 185.51.200.2
BigBlueButton directories & files
Files:
1. HTML & Metadata of VClass: /var/www/bigbluebutton-default/index.html
2. Properties of VClass /usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
3. Some other Settings (Video/Audio stream quality, branding, etc): /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml
4. Videos path: /var/www/bigbluebutton-default/videos
5. Event files (including participants): /var/bigbluebutton/recording/raw/ (See below)
6. Config.xml: /var/www/bigbluebutton/client/conf/config.xml
7. HTML5 client (class ui): /usr/share/meteor/bundle/programs/web.browser
8. vclass-style.css: Loaded from bbb plugin -> class-bigbluebutton-api.php
9. Error 1020: Comment the externalIPv4 in /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
10. For 1004 or other erros try this:
Try switching the value of sipjsHackViaWs config in the file:
/usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml
If it is set to true, try changing to false, and vice versa.
Test this:
change /etc/bigbluebutton/nginx/sip.nginx
proxy_pass to server’s external ip
Edit: /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml
# this is the best trick to make it work
<bean id="stun1" class="org.bigbluebutton.web.services.turn.StunServer">
<constructor-arg index="0" value="stun:stun.freeswitch.org"/>
</bean>
Logs: - bbb-rap-archive-worker.service - bbb-rap-sanity-worker.service - bbb-rap-process-worker.service - bbb-rap-publish-worker.service - bbb-rap-events-worker.service
Note: Each unit file has a log that you can follow.
sudo journalctl -f -u **bbb-rap-archive-worker.service**
ls /opt/freeswitch/var/log/freeswitch
-
Update Packages:
bash sudo apt update sudo apt upgrade -
File Manipulation:
bash cp [source] [destination] # Copy files/directories mv [source] [destination] # Move/Rename files/directories rm [file] # Remove a file -
Managing Services:
bash sudo systemctl start [service] # Start a service sudo systemctl stop [service] # Stop a service sudo systemctl restart [service] # Restart a service -
Checking System Resources:
bash top # Display system processes df -h # Check disk space free -h # Check memory usage -
Changing room settings (Camera, share desktop, etc.):
nano /usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml
- Change stun server if problem occures with the default:
# For example an error like below could be solved by chaning the stun server:
# Warning: Failed to verify STUN server at stun.freeswitch.org 3478 with command
# List of stun servers: https://www.voip-info.org/stun/
nano /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml
BigBlueButton Monitoring
Grafna + Prometheus used for monitoring:
http://185.209.161.45/monitoring/d/HIbd_CXZz3/bigbluebutton-server-instance-node_exporter?orgId=1&refresh=10s
# Bigbluebutton monitoring
# https://bigbluebutton-exporter.greenstatic.dev/installation/all_in_one_monitoring_stack/
# 1. Setup docer (if not on the same server hosting BBB)
sudo apt update
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
# Install docker compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
# 2. Get Promethus Exporter
mkdir ~/bbb-monitoring
cd bbb-monitoring/
wget https://raw.githubusercontent.com/greenstatic/bigbluebutton-exporter/master/extras/all_in_one_monitoring/bbb_exporter_secrets.env
wget https://raw.githubusercontent.com/greenstatic/bigbluebutton-exporter/master/extras/all_in_one_monitoring/docker-compose.yaml
wget https://raw.githubusercontent.com/greenstatic/bigbluebutton-exporter/master/extras/all_in_one_monitoring/prometheus.yaml
# Put server credentials to bbb exporter secrets.env file
# Starup docker-compose
sudo docker-compose up -d
# Add new Nginx directive for
cd /etc/nginx/sites-available/
sudo nano default
# Add the following
# BigBlueButton monitoring location /monitoring/ { proxy_pass http://127.0.0.1:3001/; include proxy_params; }
# Restart Nginx
service nginx restart
# Import dashboard in Grafna the following json:
https://github.com/greenstatic/bigbluebutton-exporter/tree/master/extras/dashboards/server_instance_node_exporter.json
3rd-party Services
- SMS Panel: This panel is used for user account activation, user and password reset, etc. It must be charged and it needs yearly activation which is possible through sms.ir.
- Payment Gateway: Payments are made through zarinpal.com's API. It does not need any maintenance. Its most use case is to view transactions made outside of website, through direct payment which are not observable through our websites.