前
這個安裝 SRS 服務器的過程,筆者是在 root 身份下進行的。
剛安裝好的 Ubuntu 系統(tǒng)的 root 身份是沒有密碼的,沒有密碼就不能登錄,所以首先要先給 root 設置密碼:
sudo passwd,鍵入兩次密碼設置成功。
然后執(zhí)行 su root 轉換 root 身份。
然后安裝 Git:
執(zhí)行 apt install git
正式安裝
- 執(zhí)行
git clone https://github.com/ossrs/srs[該過程很漫長] - 執(zhí)行
cd srs/trunk - 執(zhí)行
./configure && make - 啟動服務器則執(zhí)行
./objs/srs -c conf/srs.conf
遇到的問題
若在上節(jié)步驟 3 中的時候報下面的錯誤信息:
patching file Makefile
cc -I. -DHTTP_PARSER_STRICT=1 -Wall -Wextra -Werror -O0 -g -c http_parser.c
http_parser.c: In function ‘http_parser_parse_url’:
http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
found_at = 1;
~~~~~~~~~^~~
http_parser.c:2096:7: note: here
case s_req_server:
^~~~
cc1: all warnings being treated as errors
Makefile:40: recipe for target 'http_parser.o' failed
make: *** [http_parser.o] Error 1
build http-parser-2.1 failed, ret=2
該錯誤將在 SRS3 版本后解決,2 版本則需要開發(fā)者自行處理,處理流程在下。
步驟:
執(zhí)行
cd ..回到 trunk 目錄執(zhí)行
cd 3rdparty進入三方框架目錄執(zhí)行
mkdir temp后cd temp-
執(zhí)行
unzip ../http-parser-2.1.zip
image -
執(zhí)行
grep -n "FALLT" ./http-parser-2.1/http_parser.c
image 執(zhí)行
sed -e s/FALLTROUGH/FALLTHROUGH/ -i ./http-parser-2.1/http_parser.c-
執(zhí)行
grep -n "FALLT" ./http-parser-2.1/http_parser.c
image 執(zhí)行
mv ../http-parser-2.1.zip ../http-parser-2.1-orig.zip-
執(zhí)行
zip ../http-parser-2.1.zip http-parser-2.1/*
image 執(zhí)行
cd ../..回到 trunk 文件夾,此時一定是解決成功的 ??。-
執(zhí)行
./configure && make
image




