------ body content display, start to learn new knowledge ------
The first step is to modify the /www/server/panel/install/nginx.sh file and find the Install_Configure section. After each . /configure followed by the Add Module Compilation statement:
. /configure --add-module=/www/server/nginx_plus/nginx-rtmp-module
Step 2: Go to the Command Session tool and execute the git clone https://github.com/arut/nginx-rtmp-module /www/server/nginx_plus/ statement until 100% completes.
Step 3: Next, enter the install nginx script statement:
sh /www/server/panel/install/nginx.sh install 1.8
The 1.8 after install is the version number you want to install or switch to. For example, if you have already installed version 1.14 of nginx, then you can put 1.8 or other version number here. If you haven't installed it yet. You can choose the version you need.
Until the installation and compilation is complete. Then type nginx -V to check that the compilation is complete:
When you see the rtmp key module, it means that the module has been installed successfully.Note that after a successful installation theDo not use the NGINX switch version of the Pagoda backend(please refer to the screenshot in step 3 for the location of this feature), the official script will be pulled from the server for execution, so that the rtmp module will disappear in the new nginx version configuration.
Step 4 Create a rtmp.conf file under /www/server/nginx/conf. Create the following:
rtmp_auto_push on;
rtmp {
server {
listen 1935; ping 30s; rtmp { server {
ping 30s; chunk_size 4000; rtmp { server
chunk_size 4000; notify_method get; notify_method
notify_method get.
application hls {
notify_method get; application hls { live on;
hls on; hls_path /www/tmp/hls;
hls_path /www/tmp/hls; hls_sync 100ms; hls_path /www/tmp/hls
hls_sync 100ms;
hls_fragment 5s.
}
application live {
hls_sync 100ms; hls_fragment 5s; } application live { live on; }
}
# Video on demand
# application vod {
# play /www/tmp/Videos; }
#}
# Video on demand over HTTP
#application vod_http {
# play http://localhost:8080/vod/;
#}
}
}
Step 5 Create a file hls.conf under /www/server/nginx/conf. Create the following:
server {
listen 8080;
location /hls {
# Serve HLS fragments
types { application/vnd.apple.mpegurl m3u8; m3u8
application/vnd.apple.mpegurl m3u8; application/vnd.
application/vnd.apple.mpegurl m3u8; video/mp2t ts.
}
root html; expires -1; }
expires -1; } root html; }
}
}
Note: Here this is creating a play entry for a test. If you don't need a specific test entry, you can ignore this step.
Step 6: Open the nginx.conf file under /www/server/nginx/conf and insert include rtmp.conf after the brackets of events. Modify the contents as follows
user www www;
worker_processes auto; error_log /www/wwwlogs/nginx_error crit; worker_processes auto
error_log /www/wwwlogs/nginx_error.log crit;
pid /www/server/nginx/logs/nginx.pid; worker_rlimit_nofile 51200; worker_processes auto; worker_processes auto
worker_rlimit_nofile 51200; worker_rlimit_nofile 51200; worker_rlimit_nofile 51200
worker_rlimit_nofile 51200; events
{
use epoll; worker_connections 51200; worker_rlimit_nofile
worker_connections 51200; worker_rlimit_nofile 51200; events { use epoll.
worker_connections 51200; multi_accept on;
}
include rtmp.conf.
Step 7 Open the nginx.conf file under /www/server/nginx/conf and insert include hls.conf before include /www/server/panel/vhost/nginx/*.conf;. Modify the contents as follows
server
listen 888; server
listen 888; server_name phpmyadmin; server_name
server_name phpmyadmin; index index.html index.htm index.php;
index index.html index.htm index.php;
root /www/server/phpmyadmin;
#error_page 404 /404.html; include enable-php.conf; server_name phpmyadmin; index
include enable-php.conf;
location ~ . *\. (gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d; }
}
location ~ . *\. (js|css)?$
{
expires 12h; }
}
location ~ /\.
{
deny all; }
}
access_log /www/wwwlogs/access.log; }
}
include hls.conf; }
include /www/server/panel/vhost/nginx/*.conf; }
}
The above installation is complete, other configuration optimization please take care of it.
2024-07-13 11:15:03
Please note that some articles are time-sensitive, so if there are any errors or if they are no longer valid, please check below.leave a messageor contactHootSuite OfficialThe
No comments