WWBN / AVideo

Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
https://avideo.tube/AVideo_OpenSource
Other
1.91k stars 972 forks source link

Adding SSL #330

Closed ghost closed 6 years ago

ghost commented 6 years ago

How would i go about adding SSL?

SparksSkywere commented 6 years ago

Ok.. @DanielnetoDotCom this is getting more and more

image

SparksSkywere commented 6 years ago

So i followed it to here but what do i need to type in?

image

SparksSkywere commented 6 years ago

@DanielnetoDotCom Fixed SQL but still this is the only error coming back on the encoder

image

DanielnetoDotCom commented 6 years ago

This is not an error, it is just a log

SparksSkywere commented 6 years ago

Its the issue. i have cleared all the other issues and problems but it is only something that is causing the login page to be denying. I cant determine where it is coming from, ive done the dump that was suggested higher up this post but still cant find where it is coming from, im checking down NGINX to see if it is coming internally. If you come up with anything @DanielnetoDotCom let me know :3

DanielnetoDotCom commented 6 years ago

I know what you have mix the http and https what are you really using? update your encoder configuration database with the correct protocol

image

SparksSkywere commented 6 years ago

Im doing a reinstall of the encoder entirely, seeing if that works

SparksSkywere commented 6 years ago

Done and it was a SQL error all along

image

DanielnetoDotCom commented 6 years ago

is it working now? looks like is working for me

SparksSkywere commented 6 years ago

Yep it is working now

DanielnetoDotCom commented 6 years ago

Great :)

karvox commented 6 years ago

Hi,

I follow all documentation on https://github.com/DanielnetoDotCom/YouPHPTube to configure, including SSL settings, but after I change all to SSL live stream not works. My browser show this error:

Live Streaming really works over SSL?

untitled

DanielnetoDotCom commented 6 years ago

It does, please check demo site, it is working there

DanielnetoDotCom commented 6 years ago

How is your plugin configuration screen?

karvox commented 6 years ago

My plugin configuration

untitled

karvox commented 6 years ago

I change playerServer port to 444 and not works, what is wrong?

untitled

DanielnetoDotCom commented 6 years ago

Make sure the URL https://evideo.ect.ufrn.br:444/stat is working

also there are many issues on this github regarding nginx ssl, try to see if you can find a solution there

karvox commented 6 years ago

Yes, its works! but the live not appears on streamer site still.

untitled

DanielnetoDotCom commented 6 years ago

I saw this problem before

you probably has a misconfiguration on your stats/nginx.conf

look the demo page https://youphptube.com:444/stat

you suppose to have the key name instead the URL on the stats

image

karvox commented 6 years ago

Hi Daniel, my URL and key are correctly, how the key appear on "live streams" field of image above?

untitled untitled1

DanielnetoDotCom commented 6 years ago

it is correct,

but you should not have your URL here, it should be your key. that is how the script indentify the live stream image

I think it is due your nginx.conf file

karvox commented 6 years ago

But where is the conf in nginx.conf file?

SparksSkywere commented 6 years ago

Depends where your going, /etc/nginx is the common installation

karvox commented 6 years ago

So, I want to know where to find this configuration (stats) inside nginx.conf. I compiled my nginx and the configuration file is in:

root@ubuntu:/usr/local/nginx/conf# ls fastcgi.conf koi-utf nginx.conf scgi_params.default fastcgi.conf.default koi-win nginx.conf.default uwsgi_params fastcgi_params mime.types nginx.conf.old uwsgi_params.default fastcgi_params.default mime.types.default scgi_params win-utf

DanielnetoDotCom commented 6 years ago

my nginx file is on /usr/local/nginx/conf/nginx.conf

Usually it is a missconfiguration, I have one user with the same problem, and it was fixed replacing the conf. file, I have pasted the nginx.conf used somewere on the git issues

karvox commented 6 years ago

Hi,

Now I have success, its running, but the streamer page not indicate that there is a live stream running. I have to copie and paste the url on browser for see live stream.

untitled untitled1

DanielnetoDotCom commented 6 years ago

did you fix this? image

karvox commented 6 years ago

Hi Daniel,

I dont know where to find this configuration on nginx.conf to change it.

DanielnetoDotCom commented 6 years ago

I have posted where it should be on the comment above

ldgv commented 6 years ago

Hi guys+ How I must to configure my nginx.conf for enable SSL?

Stream is working fine in http but I could enable SSL, when I enabled it stream no work.

This is my Nginx conf

worker_processes  1;
error_log  logs/error.log debug;
events {
        worker_connections  1024;
}

rtmp { server { listen 1935; allow play all;

creates our "live" full-resolution HLS videostream from our incoming encoder stream and$

                application live {
                        allow play all;
                        live on;
                        #record all;
                        #record_path /video_recordings;
                        #record_unique on;
                        hls on;
                        hls_nested on;
                        hls_path /HLS/live;
                        #hls_playlist_length 4s;
                        #hls_fragment 1s;
                        hls_fragment 10s;
                        on_publish http://xxxxxxxxx/plugin/Live/on_publish.php;
                        on_play http://xxxxxxxxx/plugin/Live/on_play.php;
                        on_record_done http://xxxxxxxxxx/plugin/Live/on_record_done.php;
                }
        }
}

http {
        include       mime.types;
        default_type  application/octet-stream;
        server {
        listen 9090;
        server_name localhost;
                #creates the http-location for our full-resolution (desktop) HLS stream - "http://my-ip/live/my-stream-key/index.m3u8"      
                location /live {
                        # Disable cache
                        add_header 'Cache-Control' 'no-cache';

                        # CORS setup
                        add_header 'Access-Control-Allow-Origin' '*' always;
                        add_header 'Access-Control-Expose-Headers' 'Content-Length';

                        # allow CORS preflight requests
                        if ($request_method = 'OPTIONS') {
                                add_header 'Access-Control-Allow-Origin' '*';
                                add_header 'Access-Control-Max-Age' 1728000;
                                add_header 'Content-Type' 'text/plain charset=UTF-8';
                                add_header 'Content-Length' 0;
                                return 204;
                        }
                        types {
                                application/vnd.apple.mpegurl m3u8;
                        }
                        alias /HLS/live;
                }
                #allows us to see how stats on viewers on our Nginx site using a URL like: "http://my-ip/stats"     
                #location /stats {
                #        stub_status;
                #}
                location /stat {
                        rtmp_stat all;
                        rtmp_stat_stylesheet stat.xsl;
                }
                location /stat.xsl {
                        root html;
                }
                location /control {
                        rtmp_control all;
                }
                #allows us to host some webpages which can show our videos: "http://my-ip/my-page.html"     
                location / {
                        root   html;
                        index  index.html index.htm;
                }   
        }

}

Thanks

karvox commented 6 years ago

@ldgv here is my nginx conf file

worker_processes 1; error_log logs/error.log debug; events { worker_connections 1024; } rtmp { server { listen 1935; allow play all;

creates our "live" full-resolution HLS videostream from our incoming encoder stream and tells where to put the HLS video manifest and video fragments

                application live {
                        allow play all;
                        live on;
                        #record all;
                        #record_path /video_recordings;
                        #record_unique on;
                        hls on;
                        hls_nested on;
                        hls_path /HLS/live;
                        #hls_playlist_length 4s;
                        hls_fragment 10s;
                        on_publish http://evideo.ect.ufrn.br/plugin/Live/on_publish.php;
                        on_play http://evideo.ect.ufrn.br/plugin/Live/on_play.php;
                        on_record_done http://evideo.ect.ufrn.br/plugin/Live/on_record_done.php;
                }
        }
}
http {
        include       mime.types;
        default_type  application/octet-stream;
        server {
                listen 8080;
                server_name evideo.ect.ufrn.br encoder-evideo.ect.ufrn.br;
                #creates the http-location for our full-resolution (desktop) HLS stream - "http://my-ip/live/my-stream-key/index.m3u8"
                location /live {
                        # Disable cache
                        add_header 'Cache-Control' 'no-cache';

                        # CORS setup
                        add_header 'Access-Control-Allow-Origin' '*' always;
                        add_header 'Access-Control-Expose-Headers' 'Content-Length';

                        # allow CORS preflight requests
                        if ($request_method = 'OPTIONS') {
                                add_header 'Access-Control-Allow-Origin' '*';
                                add_header 'Access-Control-Max-Age' 1728000;
                                add_header 'Content-Type' 'text/plain charset=UTF-8';
                                add_header 'Content-Length' 0;
                                return 204;
                        }
                        types {
                                application/vnd.apple.mpegurl m3u8;
                        }
                        alias /HLS/live;
                }
                #allows us to see how stats on viewers on our Nginx site using a URL like: "http://my-ip/stats"
                location /stats {
                        stub_status;
                }
                location /stat {
                        rtmp_stat all;
                        rtmp_stat_stylesheet stat.xsl;
                }
                location /stat.xsl {
                        root html;
                }
                location /control {
                        rtmp_control all;
                }
                #allows us to host some webpages which can show our videos: "http://my-ip/my-page.html"
                location / {
                        root   html;
                        index  index.html index.htm;
                }

            listen 444 ssl; 
                #server_name evideo.ect.ufrn.br;
                ssl_certificate /etc/apache2/ssl/xxxxxxxxx.chain.crt;
                ssl_certificate_key /etc/apache2/ssl/xxxxxxxx.key;

    }
}
DanielnetoDotCom commented 6 years ago

Try to find help here https://github.com/arut/nginx-rtmp-module

And make sure why your live stream name is your URL, NOT the stream key

ldgv commented 6 years ago

Guys... the problem is with apache server and the virtual hots

When I force ssl in my virtual hots my live streams show the error (show URL and no name of key)

Now Ive enabled my SSL but without force SSL.... Site is in https with no forced... Now my 444/stat show my key and my site couter show my stream...

This is my apache conf for my virtual host for my youphptube site

MY VIRTUAL HOSTS CONF HTTP AND HTTPS http://www.fotowisp.org/image/EOU7 http://www.fotowisp.org/image/E85k

Some idea to enable SSL forced?

DanielnetoDotCom commented 6 years ago

I dont understand well what you wrote.

but your NGINX https is not working here https://www.lookymore.gq:444/

ldgv commented 6 years ago

Mmm sorry My bad...

Problem is with Apache and the SSL forced by rewrite

ldgv commented 6 years ago

I dont understand well what you wrote.

but your NGINX https is not working here https://www.lookymore.gq:444/

Is working in https://lookymore.gq:444/stat

But Ive not enblaed my redirection to internet

Try again please

DanielnetoDotCom commented 6 years ago

it is working, your code should be working as well.

If you want, screenshot your live plugin parameters and your live screen

ldgv commented 6 years ago

it is working, your code should be working as well.

If you want, screenshot your live plugin parameters and your live screen

Ok My plugin conf https://footo.gq/image/ieir

The problem, I think, is when SSL is forced for rewrite....

So, how to enable SSL? So that the site always working on SSL

DanielnetoDotCom commented 6 years ago

Looks like all fine for me, but this question is not regarding youphptube.

try to google to figure it out

ldgv commented 6 years ago

Ok, thx you for your time.

hosnyegy commented 2 years ago

my dear Daniel I have a problem after installing the security certificate https://koora4k.com:8443/stat it does not work

DanielnetoDotCom commented 2 years ago

my dear Daniel I have a problem after installing the security certificate https://koora4k.com:8443/stat it does not work

Your nginx seems to not be installed or running

hosnyegy commented 2 years ago

I installed it with the same steps https://github.com/WWBN/AVideo/wiki/Set-up-my-own-Stream-Server and it worked for me, but when I deactivated the security certificate, it stopped working

DanielnetoDotCom commented 2 years ago

What do you mean "deactivated the security certificate"?

the SSL is strongly recommended to be installed

for my self I use letsencrypt

hosnyegy commented 2 years ago

I mean, after installing ssl, the problem occurred

hosnyegy commented 2 years ago

These are the errors [2022-01-10 19:26:27] Time Elapsed: 0.00002 seconds - Starting try to get URL https://koora4k.com:8443/stat [2022-01-10 19:26:27] Time Elapsed: 0.00013 seconds - url_get_contents start timeout=2

Warning: file_get_contents(https://koora4k.com:8443/stat): failed to open stream: Connection refused in /var/www/html/AVideo/plugin/Live/test.php on line 54 [2022-01-10 19:26:27] Time Elapsed: 0.00083 seconds - file_get_contents:: [2022-01-10 19:26:27] Time Elapsed: 0.00084 seconds - file_get_contents fail return an empty content [2022-01-10 19:26:27] Time Elapsed: 0.00085 seconds - FAIL [2022-01-10 19:26:27] Time Elapsed: 0.00085 seconds - Finish try to get URL

hosnyegy commented 2 years ago

Sorry dear if I bothered you

DanielnetoDotCom commented 2 years ago

your Nginx seems to not even be running

try to stop and start it

sudo /usr/local/nginx/sbin/nginx -s stop

than

sudo /usr/local/nginx/sbin/nginx

hosnyegy commented 2 years ago

same problem not working

hosnyegy commented 2 years ago

Can my friend send you the server data to help me?