Closed walt93 closed 1 year ago
FYI for myself, I use Nginx and apache on the same server and also the same domain
I install the SSL for apache and reuse the certificate files on Nginx (do NOT regenerate)
It is entirely not clear how to do that. Are you saying that I don't use certbot to install the certificate? Now I'm super-confused.
Following the install guide, it says to install the SSL for Nginx This is the step that fails. Every time. This is where it is failing now. I believe you told me that nginx doesn't have a certificate and that is why my RTMP fails to connect.
So how do I "reuse the certificate files on Nginx (do NOT regenerate)"?
walt@conspyre:/usr/local/nginx/conf$ sudo certbot --nginx --nginx-server-root /usr/local/nginx/conf --no-redirect
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): conspyre.tv
Certificate not yet due for renewal
You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/conspyre.tv-0002.conf)
What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Deploying certificate
Could not install certificate
NEXT STEPS:
- The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running:
certbot install --cert-name conspyre.tv-0002
Could not automatically find a matching server block for conspyre.tv. Set the `server_name` directive to use the Nginx installer.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
I tried adding the server_name to the server block for RTMP - and the error says - you can't have a server_name directive here. ππ€¦ββοΈ
Daniel, I see it there too. Certbot is failing. It says:
Could not automatically find a matching server block for conspyre.tv. Set the
server_namedirective to use the Nginx installer.
My previous comment was that I tried adding a server_name conspyre.tv block at or around line 8. That failed. I don't know how to satisfy certbot so that it will install a certificate for nginx.
How do you do it on your systems?
you should use this conf file as a model https://raw.githubusercontent.com/WWBN/AVideo/master/plugin/Live/install/nginx.conf
and update only server_name
on the line 87
before making sure it is working do not update anything else on the file
Ok, I've re-installed a server from scratch Ubuntu 22.04 LTS and followed the guide - this time changing the server_name on line 87 to my server (adserver3.conspyre.tv).
This is the first time I've ever gotten through the installation with Nginx successfully. π₯³ Probably, you should put the server_name part in the guide, just sayingβ¦
Unfortunately, no cause for celebration just yet. I configured the server, turned on the Live plug-in, grabbed my stream keys - OBS studio connected without incident.
OBS log:
14:22:26.292: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://adserver3.conspyre.tv/live?s=Zm1xbXYwL1QydXBDK2FmbTgvSVBJdz09&webSiteRootURL=aHR0cHM6Ly9hZHNlcnZlcjMuY29uc3B5cmUudHYv...
14:22:26.696: [rtmp stream: 'simple_stream'] Connection to rtmp://adserver3.conspyre.tv/live?s=Zm1xbXYwL1QydXBDK2FmbTgvSVBJdz09&webSiteRootURL=aHR0cHM6Ly9hZHNlcnZlcjMuY29uc3B5cmUudHYv successful
14:22:26.700: ==== Streaming Start ===============================================
But AVideo remains still in the "spinning" condition, unable to start the stream.
I noted a couple lines which appear relevant, but a solution is not clear.
[22-Oct-2022 14:22:30 America/Los_Angeles] AVideoLog::DEBUG: avideoEndIncluded already processed SCRIPT_NAME: /view/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: Live::isLiveFromKey(63545e876c144-1, 0, , ) SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: Live::isLiveFromKey(63545e876c144-1, 0, , ) SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: Live::isLiveFromKey namesFound [] SCRIPT_NAME: /plugin/Live/index.php
--->[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: Live::isLiveFromKey is NOT online [63545e876c144-1] SCRIPT_NAME: /plugin/Live/index.php**
---->[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: isLiveAndIsReadyFromKey the key 63545e876c144-1 is not present on the stats live_servers_id=0 SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromUser disableShareOnly SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromVideo canShareVideosFromUser() = false SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: getAllCategories getCache SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: getAllCategories return SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: User::canWatchVideo Video is empty (0) SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: User::canWatchVideo Video is empty (0) SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromUser disableShareOnly SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:36 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromVideo canShareVideosFromUser() = false SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:45 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromUser disableShareOnly SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:45 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromVideo canShareVideosFromUser() = false SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:46 America/Los_Angeles] AVideoLog::DEBUG: getAllCategories getCache SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:46 America/Los_Angeles] AVideoLog::DEBUG: getAllCategories return SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:46 America/Los_Angeles] AVideoLog::DEBUG: User::canWatchVideo Video is empty (0) SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:46 America/Los_Angeles] AVideoLog::DEBUG: User::canWatchVideo Video is empty (0) SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:46 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromUser disableShareOnly SCRIPT_NAME: /plugin/Live/index.php
[22-Oct-2022 14:22:46 America/Los_Angeles] AVideoLog::DEBUG: CustomizeUser::canShareVideosFromVideo canShareVideosFromUser() = false SCRIPT_NAME: /plugin/Live/index.php
I tried the same on the main server, nearly identical results - Nginx seems happy now that it has the domain info - OBS connects without error - and AVideo spins without playing. Logfile here https://pastebin.com/axpps4wy
can you please check your JS console when it is spinning?
also can you please screenshot your Live plugin parameters screen?
Also confused on your docs for nginx I know how to setup blocks for apache and nginx but in your docs for ssl you say to install sudo apt-get install python3-certbot-nginx -y. Doing this will also install nginx via apt which also means nginx will auto start apt installed nginx. running sudo /usr/local/nginx/sbin/nginx does not run because nginx is already running.
Dependencies for python3-certbot-nginx if not found on server it will install it
So after installing python3-certbot-nginx should we ignore /usr/local/nginx Since files are copied over to apt installed nginx
sudo mv /usr/sbin/nginx /usr/sbin/nginx.old && sudo cp /usr/local/nginx/sbin/nginx /usr/sbin/nginx sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old && sudo cp /usr/local/nginx/conf/nginx.conf /etc/nginx/nginx.conf
And comment default nginx.conf to include sites-enabled or conf.d then create nginx blocks.
@lunar54 I believe ignoring the system installed nginx is a must, we're building it from source with the RTMP module. I too have been down this path (running the wrong nginx). Agree it seems that we should look for a means to install certbot without polluting our space with versions of nginx that will get us in trouble.
@Daniel running this from the server I just installed, plug-in settings should be pretty much the default:
[Warning] VIDEOJS: β "WARN:" β "videojs.plugin() is deprecated; use videojs.registerPlugin() instead" (video.min.js, line 12)
[Log] getPleaseWait β 0 (script.js, line 2791)
[Log] updateMediaSessionMetadata isLive β undefined (1, line 1722)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
[Log] addTemplateFromArray prepend β "#topMenuUserNotifications ul .list-group .priority3" (script.js, line 44)
[Log] isOfflineVideo paused (1, line 1397)
[Log] updateUserNotificationCount β 1 (script.js, line 121)
[Log] Service Worker Registered (swRegister.js, line 25)
[Log] showImage β "prerollPoster" β "63545e876c144" β false (live.js, line 20)
[Log] showImage Poster β "prerollPoster" β false β "63545e876c144" (live.js, line 49)
[Log] isOfflineVideo player.readyState not ready β 0 (1, line 1400)
[Log] isOfflineVideo player.readyState not ready β 0 (1, line 1400)
[Log] Change video to please wait β "#liveViewStatusID_63545e876c144_1_0" (1, line 1601)
[Error] TypeError: undefined is not an object (evaluating 'player.tech_.hls.playlists')
playCorrectSourceliveViewStatusID_63545e876c144_1_0 (1:1440)
success (1:1513)
c (jquery.min.js:2:28333)
fireWith (jquery.min.js:2:29074)
l (jquery.min.js:2:80057)
(anonymous function) (jquery.min.js:2:82501)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
[Error] VIDEOJS: β "ERROR:" β "(CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED)" β "The media could not be loaded, either because the server or network failed or because the format is not supported."
bt
code: 4
message: "The media could not be loaded, either because the server or network failed or because the format is not supported."
bt Prototype
(anonymous function) (video.min.js:12:1534)
(anonymous function) (video.min.js:20:173156)
(anonymous function) (video.min.js:20:158381)
(anonymous function)
bound
(anonymous function) (video.min.js:12:13658)
[Log] AvideoJSError reloadVideoJS in 2 sec (script.js, line 3096)
[Log] PError 1 [object Object] (1, line 1437)
and checking back with main site, we find (note: it's super slow to load the live page, about 1 min) note: on both adserver3.conspyre.tv and conspyre.tv - when you load the live page - the play button is non-responsive - you have to re-load the live page on both servers before the play button responds to the mouse. note(2): when I say "live page" I mean https://adserver3.conspyre.tv/live/0/Admin/1
Javascript errors appear about the same:
[Warning] VIDEOJS: β "WARN:" β "videojs.plugin() is deprecated; use videojs.registerPlugin() instead" (video.min.js, line 12)
[Log] expand (script.js, line 19)
[Log] getPleaseWait β 0 (script.js, line 2791)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
[Log] startTrackDisplay started (1, line 3316)
[Log] updateMediaSessionMetadata isLive β undefined (1, line 3195)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
[Log] addTemplateFromArray prepend β "#topMenuUserNotifications ul .list-group .priority6" (script.js, line 44, x4)
[Log] socketLiveUsersBeat β Object (1, line 2756)
Object
[Log] updateViewsLiveUsersBeat β "6350696b15939-1" β null β 14 (1, line 2751)
[Log] getBeatJSSelector β ".liveUsersViews_6350696b15939-1, .liveUsersViews_6350696b15939-1_0, .views_on_total_on_live_6350696b15939-1_0" (1, line 2746)
[Log] socketLiveUsersBeat β Object (1, line 2756)
Object
[Log] updateViewsLiveUsersBeat β "6350696b15939-1" β null β 14 (1, line 2751)
[Log] getBeatJSSelector β ".liveUsersViews_6350696b15939-1, .liveUsersViews_6350696b15939-1_0, .views_on_total_on_live_6350696b15939-1_0" (1, line 2746)
[Log] isOfflineVideo paused (1, line 2428)
[Log] socketConnect: Socket onopen (script.js, line 40)
[Log] updateUserNotificationCount β 4 (script.js, line 121)
[Log] Service Worker Registered (swRegister.js, line 25)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
[Error] VIDEOJS: β "ERROR:" β "(CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED)" β "The media could not be loaded, either because the server or network failed or because the format is not supported." β bt
bt
(anonymous function) (video.min.js:12:1534)
(anonymous function) (video.min.js:20:173156)
(anonymous function) (video.min.js:20:158381)
(anonymous function)
bound
(anonymous function) (video.min.js:12:13658)
[Log] AvideoJSError reloadVideoJS in 2 sec (script.js, line 3096)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (videojs.hotkeys.min.js.map, line 0)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
[Error] VIDEOJS: β "ERROR:" β "(CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED)" β "The media could not be loaded, either because the server or network failed or because the format is not supported." β bt {code: 4, message: "The media could not be loaded, either because the β¦rk failed or because the format is not supported.", status: null, β¦}
bt {code: 4, message: "The media could not be loaded, either because the β¦rk failed or because the format is not supported.", status: null, MEDIA_ERR_CUSTOM: 0, MEDIA_ERR_ABORTED: 1, β¦}bt
(anonymous function) (video.min.js:12:1534)
(anonymous function) (video.min.js:20:173156)
(anonymous function) (video.min.js:20:158381)
(anonymous function)
bound
(anonymous function) (video.min.js:12:13658)
[Log] AvideoJSError reloadDefaultHTML5Player (script.js, line 3101)
[Log] Socket onmessage json.callback β 24356 β "socketLiveUsersBeat" (script.js, line 76)
[Log] socketLiveUsersBeat β {online: 1, views: 14, cache: true, β¦} (1, line 2756)
{online: 1, views: 14, cache: true, transmition_key: "6350696b15939-1", live_servers_id: 0, β¦}Object
[Log] updateViewsLiveUsersBeat β "6350696b15939-1" β null β 14 (1, line 2751)
[Log] getBeatJSSelector β ".liveUsersViews_6350696b15939-1, .liveUsersViews_6350696b15939-1_0, .views_on_total_on_live_6350696b15939-1_0" (1, line 2746)
[Error] Failed to load resource: Could not connect to the server. (index.m3u8, line 0)
As I can see your live server is NOT running
https://adserver3.conspyre.tv:8443/
or maybe you have it in another port
Building from source is fine however apt installed nginx will run not matter what stop apt installed nginx sudo systemctl stop nginx make back up of /usr/lib/systemd/system/nginx.service then edit /usr/lib/systemd/system/nginx.service replace with this [Unit] Description=The NGINX HTTP and reverse proxy server After=syslog.target network-online.target remote-fs.target nss-lookup.target Wants=network-online.target
[Service] Type=forking PIDFile=/usr/local/nginx/logs/nginx.pid ExecStartPre=/usr/local/nginx/sbin/nginx -t ExecStart=/usr/local/nginx/sbin/nginx ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true
[Install] WantedBy=multi-user.target
save file re enable nginx sudo systemctl enable nginx.service reboot server nginx will auto start with correct nginx on a ubuntu/debian system
@lunar54 this makes some sense, I was in a state of not knowing which Nginx was running nor how it was started.
@DanielnetoDotCom I do not know why the live server would not be running. Are additional steps required? It is turned on here.
Checking Live Stats here shows this error:
Checking Live stats over on conspyre.tv, looks pretty much the same:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe. I'm always frustrated when I use the instructions at https://github.com/WWBN/AVideo/wiki/How-to-install-LAMP,-FFMPEG-and-Git-on-a-fresh-Ubuntu-22.x-for-AVideo-Platform-version-11.x-or-newer and the installation fails at certbot acquiring a cert for nginx.
The error is, very consistently (I've got five servers I can replicate this on 100% of the time, all installed via this methodβ¦):
Describe the solution you'd like A nginx.conf that satisfies the requirements for installing a SSL certificate with certbot