直播推流之nginx服务器搭建
来源:互联网 发布:办户外婚礼多少钱知乎 编辑:程序博客网 时间:2024/05/16 10:19
nginx依赖pcre和zlib和openssl,分别去这两个官方网站下载最新的版本.
pcre下载页面>
zlib下载页面>
openssl下载页面>
最后统一拷贝到某个目录下
用命令解压3个文件
tar -xzvf xxx.tar.gz
tar -jxvf xxx.tar.bz2
到官网下载nginx>
同样用tar命令解压
解压完后进入cd解压出来的目录
wangxiong@Dell:~/Soft/nginx_station/nginx-1.10.1$ sudo ./configure --prefix=/usr/local/nginx --with-pcre=/home/wangxiong/Soft/nginx_station/pcre2-10.20 --with-zlib=/home/wangxiong/Soft/nginx_station/zlib-1.2.8 --with-openssl=/home/wangxiong/Soft/nginx_station/openssl-1.0.1t --with-http_ssl_modulechecking for OS + Linux 3.16.0-71-generic x86_64checking for C compiler ... found + using GNU C compiler + gcc version: 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) checking for gcc -pipe switch ... foundchecking for -Wl,-E switch ... foundchecking for gcc builtin atomic operations ... foundchecking for C99 variadic macros ... foundchecking for gcc variadic macros ... foundchecking for gcc builtin 64 bit byteswap ... foundchecking for unistd.h ... foundchecking for inttypes.h ... foundchecking for limits.h ... foundchecking for sys/filio.h ... not foundchecking for sys/param.h ... foundchecking for sys/mount.h ... foundchecking for sys/statvfs.h ... foundchecking for crypt.h ... foundchecking for Linux specific featureschecking for epoll ... foundchecking for EPOLLRDHUP ... foundchecking for O_PATH ... foundchecking for sendfile() ... foundchecking for sendfile64() ... foundchecking for sys/prctl.h ... foundchecking for prctl(PR_SET_DUMPABLE) ... foundchecking for sched_setaffinity() ... foundchecking for crypt_r() ... foundchecking for sys/vfs.h ... foundchecking for nobody group ... not foundchecking for nogroup group ... foundchecking for poll() ... foundchecking for /dev/poll ... not foundchecking for kqueue ... not foundchecking for crypt() ... not foundchecking for crypt() in libcrypt ... foundchecking for F_READAHEAD ... not foundchecking for posix_fadvise() ... foundchecking for O_DIRECT ... foundchecking for F_NOCACHE ... not foundchecking for directio() ... not foundchecking for statfs() ... foundchecking for statvfs() ... foundchecking for dlopen() ... not foundchecking for dlopen() in libdl ... foundchecking for sched_yield() ... foundchecking for SO_SETFIB ... not foundchecking for SO_REUSEPORT ... foundchecking for SO_ACCEPTFILTER ... not foundchecking for IP_RECVDSTADDR ... not foundchecking for IP_PKTINFO ... foundchecking for IPV6_RECVPKTINFO ... foundchecking for TCP_DEFER_ACCEPT ... foundchecking for TCP_KEEPIDLE ... foundchecking for TCP_FASTOPEN ... foundchecking for TCP_INFO ... foundchecking for accept4() ... foundchecking for eventfd() ... foundchecking for int size ... 4 byteschecking for long size ... 8 byteschecking for long long size ... 8 byteschecking for void * size ... 8 byteschecking for uint32_t ... foundchecking for uint64_t ... foundchecking for sig_atomic_t ... foundchecking for sig_atomic_t size ... 4 byteschecking for socklen_t ... foundchecking for in_addr_t ... foundchecking for in_port_t ... foundchecking for rlim_t ... foundchecking for uintptr_t ... uintptr_t foundchecking for system byte ordering ... little endianchecking for size_t size ... 8 byteschecking for off_t size ... 8 byteschecking for time_t size ... 8 byteschecking for setproctitle() ... not foundchecking for pread() ... foundchecking for pwrite() ... foundchecking for pwritev() ... foundchecking for sys_nerr ... foundchecking for localtime_r() ... foundchecking for posix_memalign() ... foundchecking for memalign() ... foundchecking for mmap(MAP_ANON|MAP_SHARED) ... foundchecking for mmap("/dev/zero", MAP_SHARED) ... foundchecking for System V shared memory ... foundchecking for POSIX semaphores ... not foundchecking for POSIX semaphores in libpthread ... foundchecking for struct msghdr.msg_control ... foundchecking for ioctl(FIONBIO) ... foundchecking for struct tm.tm_gmtoff ... foundchecking for struct dirent.d_namlen ... not foundchecking for struct dirent.d_type ... foundchecking for sysconf(_SC_NPROCESSORS_ONLN) ... foundchecking for openat(), fstatat() ... foundchecking for getaddrinfo() ... foundcreating objs/MakefileConfiguration summary + using PCRE library: /home/wangxiong/Soft/nginx_station/pcre2-10.20 + using OpenSSL library: /home/wangxiong/Soft/nginx_station/openssl-1.0.1t + md5: using OpenSSL library + sha1: using OpenSSL library + using zlib library: /home/wangxiong/Soft/nginx_station/zlib-1.2.8 nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/sbin/nginx" nginx modules path: "/usr/local/nginx/modules" nginx configuration prefix: "/usr/local/nginx/conf" nginx configuration file: "/usr/local/nginx/conf/nginx.conf" nginx pid file: "/usr/local/nginx/logs/nginx.pid" nginx error log file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp"
–prefix参数指定nginx安装的目录,–with-pcre和 –with-zlib以及–with-openssl分别对应自己的解压目录,–with-http_ssl_module是为了防止找不到sha1库,这里会用openssl的sha1库!
配置完成后,执行make和make和make install,完成编译工作!
编译出现的问题:
[1]
错误提示找不到pcre.h这个头文件,解决方法是安装一个依赖库
[2]
在网上查了一下是少了链接库libpcre.la
解决方案:mkdir -p /home/wangxiong/Soft/nginx_station/pcre2-10.20/.libscp /usr/lib/libpcre.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/libpcre.acp /usr/lib/libpcre.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/libpcre.lacp /usr/lib/libpcre.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/.libs/libpcre.acp /usr/lib/libpcre.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/.libs/libpcre.la但是我发现/usr/lib(系统共享库)下面没有libpcre.a,其实我还没有执行过pcre和openssl的编译,这是致命的啊!!!>编译openssl cd /home/wangxiong/Soft/nginx_station/openssl-1.0.1t ./config ./config -t make depend make make test make install>编译pcre./configure makemake install默认共享库安装在/usr/local/下面然后开始执行上面的拷贝命令cp /usr/local/lib/libpcre2-8.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/libpcre.acp /usr/local/lib/libpcre2-8.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/libpcre.lacp /usr/local/lib/libpcre2-8.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/.libs/libpcre.acp /usr/local/lib/libpcre2-8.a /home/wangxiong/Soft/nginx_station/pcre2-10.20/.libs/libpcre.la
链接库有了,然后再次make编译
新的问题又来了,少了一堆变量,什么鬼
网上查了一下,发现pcre其实有2种库
心里一万个草泥马有没有,重新下载PCRE库
解压pcre,配置,编译,很顺利
./configure --prefix=/home/wangxiong/Soft/nginx_station/pcre-8.37makemake install
接着重新配置编译nginx
sudo ./configure --prefix=/usr/local/nginx --with-pcre=/home/wangxiong/Soft/nginx_station/pcre-8.37 --with-zlib=/home/wangxiong/Soft/nginx_station/zlib-1.2.8 --with-openssl=/home/wangxiong/Soft/nginx_station/openssl-1.0.1t --with-http_ssl_modulemake -j4make install
make成功后
make install 成功后
查看nginx安装目录
加权限启动nginx服务器
sudo ./nginx
用浏览器访问,看是否已经启动
退出服务器
sudo ./nginx -s stop
0 0
- 直播推流之nginx服务器搭建
- 搭建nginx rtmp直播服务器,ffmpeg模拟推流
- 搭建nginx rtmp直播服务器,ffmpeg模拟推流
- NGINX-RTMP直播服务器搭建-OBS录制推流-VLC视频流播放
- iOS开发之利用IJKPlayer+nginx+rtmp搭建直播的推流和拉流
- nginx+rtmp直播流服务器搭建
- ubuntu搭建推流服务器Nginx+rtmp
- 搭建rtmp直播流服务之1:使用nginx搭建rtmp直播流服务器(nginx-rtmp模块的安装以及rtmp直播流配置)
- Nginx直播服务器搭建注意事项
- nginx 搭建rtmp直播服务器
- 从零搭建流媒体服务器+obs推流直播
- nginx rtmp & hls 直播流服务器搭建+防盗链
- nginx+ffmpeg搭建流媒体服务器(直播流)
- 使用nginx-rtmp搭建视频直播服务器
- Mac上搭建直播服务器Nginx+rtmp
- 使用nginx-rtmp搭建视频直播服务器
- Mac上搭建nginx+rtmp直播服务器
- 树莓派使用nginx+rtmp搭建直播服务器
- 【文学杂谈】十年学会程序设计
- 浅谈SQL Server中的三种物理连接操作(Nested Loop Join、Merge Join、Hash Join)
- JdbcTemplate返回Map和做ORM的性能比较
- 滚动页面加载 (手机移动)
- LeetCode-191.Number of 1 Bits
- 直播推流之nginx服务器搭建
- poj之旅——2566,2739
- Restful形式接口文档生成之Swagger与SpringMVC整合手记
- codeforces 535D. Tavas and Malekas----#299div2D
- 从一个文件夹中遍历文件插入到数据库
- FFmpeg第一次编译
- 自定义的网络框架
- C++ Primer 第七章函数 7.6 内联函数
- 实模式和保护模式