ubuntu:22.04
下载依赖
1
2
3
4
5
6
7
8
9
10
11
12
13
sudo apt-get install libssl-dev
sudo apt-get install libpcre3 libpcre3-dev
sudo apt-get install openssl libssl-dev
sudo apt-get install zlib1g-dev
sudo apt-get install git
sudo apt-get install wget
sudo apt install build-essential
下载编译包
1
cd ~/rtmp
1
wget https://nginx.org/download/nginx-1.22.1.tar.gz
1
sudo tar -xvf nginx-1.22.1.tar.gz
1
sudo mv nginx-1.22.1 nginx
1
cd /usr/local/src
1
sudo git clone https://gitcode.net/mirrors/arut/nginx-rtmp-module.git
编译
1
cd ~/rtmp/nginx
1
sudo ./configure --add-module=/usr/local/src/nginx-rtmp-module
1
make install
开启
1
cd /usr/local/nginx/sbin
1
sudo ./nginx
检查开启
1
ps -ef|grep nginx
访问nginx服务器
1
ifconfig
1
2
3
4
5
6
7
8
9
10
http://{server ip}/
页面提示:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
关闭
1
pkill nginx