ubuntu搭建推流服務器Nginx+rtmp [論壇 - Ubuntu 哈啦]
正在瀏覽:
1 名遊客
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員二級
![]() ![]() 註冊日期:
2013/11/7 9:24 所屬群組:
已註冊使用者 等級: 8
HP : 0 / 187
![]() |
jbyziag 寫到: 先不管主題,首先,pwd指令是顯示當前所在目錄,而出現 /root/project代表執時期,你的所在位置是/root/project,至於為何不是在你所期待的位置,就得看你的script的內容才能知道了 不過單就/root/project和你原本期待的路徑比較一下,我猜是你原本想把專案放在/<使用者目錄>/project下,但是由於你當時的權限是root,所以<使用者目錄>會由原本期待的/home/jbyziag變成為/root,導致原本你想要的/home/jbyziag/project變成/root/project。因此我猜想問題的根源應該是該script執行時期的權限問題,也就是你應該是用jbyziag這個使用者來執行script,但是你「可能」誤植,變成以root權限來執行,造成這一連串的問題 以上供你參考 BR, Mark Chang
2017/7/13 17:38
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
jbyziag 寫到: 關於 jbyziag 寫到: 一開始看到上面的文字,我會想問您, 1. 您如何產生「test.sh」這個檔案? 2. 您「test.sh」檔案的內容為何? 不過從您在「#10」提供的「Doc3.docx」裡面的操作步驟來看, 建議您再回過頭來看「#8」我寫的步驟,其中有一段文字,我原本就有標紅字了。 samwhelp 寫到: 建議您從原本的上下文,再反覆的閱讀,然後操作指令,歸納概念, 藉由這樣的方式,看看您是否能理解一些我要表達的概念, 這是我個人學習的方式「反覆的閱讀,然後操作指令,歸納概念」, 若您「反覆閱讀」後,還是無法理解,有可能是我的表達方式,無法讓您理解, 這時候,我就會採取另一個策略,就是在網路上,透過關鍵字,再找尋其他的參考文章來觀看, 通常我都是這樣交叉的對照,在有些契機下,就融會貫通了某些概念了。 上面我個人的學習方式,不見得適合您,不過還是提供您參考。 不過我目前在跟您討論,所以我下面還是做一些說明或是提問, 看看是否能釐清您對某些概念的認知, 並且釐清您認知的,是否和我的認知是一致的。 因此另外我想到一個問題,想再問您,這樣比較可以瞭解您目前學習的狀況。 3. 那就是您在Ubuntu的「文字界面」下,您慣用的「文字編輯器」為何? 是「[vi(m)]」或是「emacs」或是「nano」或是「mcedit」或是其他的? 提問這個問題,除了瞭解您慣用的「文字編輯器」為何? 另一個想要從中瞭解的,您是否瞭解在Ubuntu的「文字界面」下,如何產生一個檔案的內容? * Ubuntu Community Help Wiki / VimHowto * Ubuntu Community Help Wiki / EmacsHowto * Ubuntu Community Help Wiki / Nano * Ubuntu Community Help Wiki / mc ================================================================================ 關於 jbyziag 寫到: 我原本在「回覆#8」裡面有寫一段文字如下,原本沒有標上顏色,現在我把他標上顏色。 samwhelp 寫到: 而我會使用『帳號「jbyziag」』 這個帳號來舉例, 只是是要固定一個基礎路徑,用來說明, 我原本預期,這樣您比較可以理解您所在的路徑,您不會混淆,我也好說明目前所在的路徑。 結果我還是失算,讓您混淆了,Orz... 我上面「#8」提的操作步驟,您不管使用什麼帳號登入,都可以操作, 而關於一開始的操作路徑,沒有限定一定要在哪個路徑操作。 我之前一開始從您「回覆#5」提供的「Doc1.docx」 和「回覆#7」提供的「Doc2.docx 」, 就可以知道您登入的帳號是「root」, 以及現在從您「回覆#10」提供的「 Doc3.docx 」,也可以知道您登入的帳號是「root」。 我上面「回覆#8」沒有使用「root」這個帳號來舉例,只是因為我大部份是在「一般的帳號」下工作, 所以我用「jbyziag」這個帳號來舉例,只是假設舉例, 本來預期您可以「依此類推」做調整,即使您使用「root」這個帳號來執行我提到的步驟,也是OK的。 不過既然您會這麼問, jbyziag 寫到: 所以我推測「您有些概念還沒建立」, 所以換個方式,換我來問您問題,您來回答, 藉由「您回答我問題的這個方式,您找尋答案的過程」, 也許有機會可以釐清您一些概念,建立一些概念。 4. 您知道你登入的帳號為何? 5. 您登入後,如何知道您登入的帳號名稱? 6. 您登入某個帳號後,預設會進入那個路徑? 7. 關於「pwd」這個指令,可以讓您瞭解到什麼樣的資訊? ================================================================================ 另外從您「回覆#10」提供的「 Doc3.docx 」。 看到您執行下面的指令
會無法下載「https://ftp.pcre.org/pub/pcre/pcre-8.39.tar.gz」這個檔案。 因為我這邊的環境,沒有這樣的情形,以前我也沒遇過,所以我也沒特別注意到, 您可改採用下面兩個指令測試看看,看看是否能完整下載「pcre-8.39.tar.gz」這個檔案。
注意:原本的是「https」,上面的改成「http」,後面沒有「s」。 或是執行
您原本的「 Doc3.docx 」,裡面有提示訊息,請您加上「--no-check-certificate」這個參數。 然後「wget」的參數和用法,可以執行「$ man wget」來觀看說明。 或是也可以從「Google」查詢「wget」,就可以找到一些中文的參考文章了。 若需要的話,也可以切換「所有中文網頁」或是切換「繁體中文網頁」 關於「man」的用法, 可以參考「鳥哥的 Linux 私房菜 / 第四章、首次登入與線上求助 / 4.3 Linux系統的線上求助man page與info page」 ================================================================================ ## pwd * $ man pwd * Wikipidia / pwd (中文) * 鳥哥的 Linux 私房菜 / 第六章、Linux 檔案與目錄管理 / 6.1.2 目錄的相關操作: cd, pwd, mkdir, rmdir * 阿旺的 Linux 開竅手冊 / Chapter 4 : 檔案/目錄與路徑 / 4.0 Linux 的目錄與路徑 / pwd 顯示工作目錄 ================================================================================ ## 家目錄 * Wikipidia / Home directory * 維基百科 / 家目錄 * 鳥哥的 Linux 私房菜 / 第五章、Linux 的檔案權限與目錄配置 / 5.3 Linux目錄配置 * 鳥哥的 Linux 私房菜 / 第六章、Linux 檔案與目錄管理 / 6.1.2 目錄的相關操作 * 鳥哥的 Linux 私房菜 / 第十三章、Linux 帳號管理與 ACL 權限設定 * 阿旺的 Linux 開竅手冊 / Advanced Chapter 1 : 帳號和群組管理 * Ubuntu Community Help Wiki / HomeFolder * Debian Wiki / home_directory * The Debian Administrator's Handbook / 8.4. 使用者與群組資料庫 / 8.4.1. 使用者清單:/etc/passwd * The Debian Administrator's Handbook / 8.6. Shell 環境 * The Debian Administrator's Handbook / 8.4. User and Group Databases / 8.4.1. User List: /etc/passwd * The Debian Administrator's Handbook / 8.6. Shell Environment * The Debian Administrator's Handbook / B.2. Organization of the Filesystem Hierarchy * Ubuntu Server Guide / Security / User Management * $ man useradd * $ man 5 passwd 執行
執行
執行
然後用「HOME」當關鍵字查詢,可以找到下面這一段說明
執行
然後用「HOME」當關鍵字查詢,可以找到下面這一段說明
執行
顯示
上面「$ man sh」或「$ man bash」,也可以使用「Tilde」當關鍵字來查詢,也可以找到「~」相關的說明。 ================================================================================ ## id * $ man id * $ man whoami * 第十三章、Linux 帳號管理與 ACL 權限設定 / 13.2.2 使用者功能:id, finger, chfn, chsh * 阿旺的 Linux 開竅手冊 / Advanced Chapter 1 : 帳號和群組管理 / 1.5 其他帳號相關指令 / id 顯示帳號 ID 執行下面指令
顯示
上面會顯示「數字」,若假設您目前的身份是「root」,則會顯示「0」。 執行下面指令
顯示 (以下 user_name 根據您登入的帳號而定)
執行下面指令
顯示
假設您目前的身份是「root」,上面的「user_name」就會是「root」。 假設您目前的身份是「jbyziag」,上面的「user_name」就會是「jbyziag」。 請依此類推... ================================================================================ ## 索引 * Ubuntu 文件資源 * [索引]如何執行指令 * [索引] 使用者管理 * 阿旺的 Linux 開竅手冊 * The Debian Administrator's Handbook ================================================================================ 以上釐清 報告完畢 ![]()
2017/7/14 10:32
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員二級
![]() ![]() 註冊日期:
2017/7/1 0:41 所屬群組:
已註冊使用者 等級: 7
HP : 0 / 152
![]() |
2017/7/15 19:33
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員二級
![]() ![]() 註冊日期:
2017/7/1 0:41 所屬群組:
已註冊使用者 等級: 7
HP : 0 / 152
![]() |
login as: wjfadiwjf
wjfadiwjf@192.168.43.79's password: ******** Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage 76 packages can be updated. 19 updates are security updates. Last login: Wed Jul 19 20:02:46 2017 from 192.168.43.4 [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ chmod a+x cfg.sh chmod: cannot access 'cfg.sh': No such file or directory [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ echo'yes' echoyes: command not found [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ echo 'or' or [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ echo 'yes' yes [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ echo 'no' no [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ sh test.sh sh: 0: Can't open test.sh [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ chmod u+x ./text.sh chmod: cannot access './text.sh': No such file or directory [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ chmod u+x. /test.sh chmod: invalid mode: âu+x.â Try 'chmod --help' for more information. [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ ./test.st -bash: ./test.st: No such file or directory [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~[0m$ 麻煩大大,可以告訴我為何我不能存檔……我操作很多次了………
2017/7/19 22:07
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
jbyziag 寫到: 在回答您問題之前,先釐清一下 * 執行「sh test.sh」,並不是在執行「存檔」的動作。 * 執行「chmod u+x test.sh」,並不是在執行「存檔」的動作。 ================================================================================ 在執行「sh test.sh」之前,您要先產生「test.sh」這個檔案。 所以您需要學習「文字編輯器(Text Editor)」來編輯「test.sh」這個檔案。 上面「回覆 #12」有提到四個「文字編輯器」供您參考 samwhelp 寫到: ================================================================================ 所以您可以執行下面指令,來編輯「test.sh」
或是執行下面指令,來編輯「test.sh」
或是執行下面指令,來編輯「test.sh」
或是執行下面指令,來編輯「test.sh」
上面四種,您只要選擇其中一個執行就可以了, 至於進入文字編輯器後,一些操作步驟,就由您自行摸索,或是您再找其它網路的參考文章來學習。 我上面回覆有貼「Ubuntu Community Help Wiki」的連結,和「Debian Wiki / TextEditor」。 samwhelp 寫到: 您可以再回過頭,再對照我上面幾個的回覆提到的相關內容 ================================================================================ 以下用法,若是您一時無法理解,也許您可以等您比較熟悉如何執行指令,再來深入探索研究。 ================================================================================ 另外也可以執行下面指令,將「檔案內容」這四個字,存到「test.sh」。
或是執行下面指令,將「檔案內容」這四個字,附加到「test.sh」。
這裡要要注意的,是第一個指令是採用「>」,第二個指令是採用「>>」。 第一個指令是採用「>」,概念上是「覆蓋」,所以您重複執行第一個指令,「test.sh」永遠只有一行內容,就是「檔案內容」四個字。 第二個指令是採用「>>」,概念上是「附加」,所以您重複執行第二個指令,「test.sh」則會有多行內容,每行內容就是「檔案內容」四個字。 -------------------------------------------------------------------------------- 例如,執行「echo '檔案內容' > test.sh」三次。
然後您執行下面指令,將「test.sh」的內容,印出來
會顯示
-------------------------------------------------------------------------------- 例如,執行「echo '檔案內容' >> test.sh」三次。
然後您執行下面指令,將「test.sh」的內容,印出來
會顯示
上面會顯示四行, 是因為您剛剛有先執行過三次「echo '檔案內容' > test.sh」, 所以原本「test.sh」就有一行「檔案內容」這四個字, 後來再執行「echo '檔案內容' >> test.sh」三字,所以最後結果一共有四行「檔案內容」在「test.sh」 ================================================================================ 另一種方式,也可以執行下面指令
上面這個方式跟「echo '檔案內容' > test.sh」這個方式的結果是一樣,「test.sh」永遠只有一行「檔案內容」這四個字。 或是執行下面指令,附加文字到「test.sh」這個檔案
上面這個方式跟「echo '檔案內容' >> test.sh」這個方式,一樣是「附加」。 ================================================================================ 若是「test.sh」這個檔案原本不存在, 您也可執行下面指令,產生空白的檔案
================================================================================ ## Manpage $ man vim $ man emacs $ man nano $ man mcedit $ man echo $ help echo $ man cat $ man touch ================================================================================ ## 更多可以閱讀的 * https://help.ubuntu.com/community/UsingTheTerminal * https://help.ubuntu.com/community/CommandlineHowto * https://help.ubuntu.com/community/AdvancedCommandlineHowto * https://www.ubuntu-tw.org/modules/newbb/viewtopic.php?post_id=348698#forumpost348698 ================================================================================ ## vim * Wikipedia / Vim (text editor) (中文) * Ubuntu Community Help Wiki / VimHowto * Debian Wiki / vim * 鳥哥的 Linux 私房菜 / 第九章、vim 程式編輯器 * 用Open Source工具開發軟體: 新軟體開發關念 / vi 快速入門 * 阿旺的 Linux 開竅手冊 / Chapter 6 : vi 文字編輯器 * $ vimtutor ================================================================================ ## emacs * Wikipedia / Emacs (中文) * Ubuntu Community Help Wiki / EmacsHowto * 用Open Source工具開發軟體: 新軟體開發關念 / emacs 快速入門 ================================================================================ ## nano * 關鍵字查詢「nano editor」 * Wikipedia / GNU nano (中文) * Ubuntu Community Help Wiki / Nano * 鳥哥的 Linux 私房菜 / 第五章、首次登入與線上求助 man page / 4. 超簡單文書編輯器: nano ================================================================================ ## mc * Wikipedia / Midnight Commander * Ubuntu Community Help Wiki / mc ================================================================================ 綜合上面所說的,再回過頭來看上面「回覆#8」提到的「test.sh」。 目標就是,產生一個檔案,檔案名稱是「test.sh」, 而檔案內容是下面三行
================================================================================ ## 方式一 先執行下面指令,
然後再執行下面指令,
最後執行下面指令,
這時候「test.sh」的內容,就會是下面三行
您可以執行下面指令,觀看「test.sh」的內容,就會看到上面那三行。
也可以執行下面指令,觀看「test.sh」的內容。
也可以執行下面指令,觀看「test.sh」的內容。
這時候可以按下「q」,離開「less」。 ================================================================================ ## 方式二 執行下面指令,產生「test.sh」
執行下面指令,觀看「test.sh」
顯示
================================================================================ ## 方式三 假設原本沒有「test.sh」 執行下面指令
然後將下面三行「複製」,然後「貼上」剛剛開啟的「nano」編輯區。
然後按下「Ctrl+o」, 畫面下方就會顯示
這時候只要按下「Enter」,就會存檔。 然後按下「Ctrl+x」,因為剛剛已經先存擋了,所以就會直接離開「nano」。 若是剛剛沒有先存檔,按下「Ctrl+x」, 畫面下方則會顯示 Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y Yes N No ^C Cancel 這時候只要按下「y」 畫面下方則會顯示
然後一樣按下「Enter」,就會「存檔」,接著離開「nano」了。 ================================================================================ ## 方式四 執行下面指令
然後按下「i」,進入「Insert Mode」, 然後將下面三行「複製」,然後「貼上」剛剛開啟的「vi(m)」編輯區。
這時候按下「Esc」,或是按下「Ctrl+[」,切換到「Normal Mode」。 然後輸入「:」,在畫面最下方,就會看到「:」,也就目前是處在「Command Line Mode」。 這時候只要再輸入「wq」,也就是畫面最下方是顯示「:wq」,這時候按下「Enter」,就會離開「vi(m)」了。 * Learning the vi Editor/Vim/Modes ================================================================================ ## 方式五 執行下面指令
然後將下面三行「複製」,然後「貼上」剛剛開啟的「emacs」編輯區。
這時候按下「Ctrl+x」,再按下「Ctrl+c」, 這時候最下方顯示
只要輸入「y」,就會「存檔」,接著離開「emacs」了。 ================================================================================ ## 方式六 執行下面指令
然後將下面三行「複製」,然後「貼上」剛剛開啟的「mcedit」編輯區。
這時候可以按下「F2」,或是也可以用滑鼠左鍵點選畫面最下方的「2Save」。 就會出現一個「確認對話框」,類似如下的文字 Save File Confirm save file: "/tmp/test.sh" [ Save ] [ Cancel ] 這時候可以用「Tab」鍵切換「[ Save ]」或「[ Cancel ]」,請切換到「[ Save ]」,然後按下「Enter」,就會存檔。 或是在確認對話框這個階段,直接按下「s」,也是會存檔。 若有支援滑鼠功能,也可以直接用滑鼠左鍵點選「[ Save ]」,一樣會存檔。 因為剛剛有事先存檔,這時候可以按下「F10」,就會離開「mcedit」。 若有支援滑鼠功能,也可以直接用滑鼠左鍵點選畫面最下方的「10Quit」,一樣會離開「mcedit」。 若是事先沒有存檔,採用上面的方式,要離開「mcedit」,就會出現一個「確認對話框」,類似如下的文字。 Close File File /tmp/test.sh was modified. Save before close? [ Yes ] [ No ] [ Cancel ] 這時候可以用「Tab」鍵切換「[ Yes ]」或「[ No ]」或「[ Cancel ]」, 請切換到「[ Yes ]」,然後按下「Enter」,就會存檔,接著離開「mcedit」。 或是在確認對話框這個階段,直接按下「y」,也是會存檔,然後接著離開「mcedit」。 若有支援滑鼠功能,也可以直接用滑鼠左鍵點選「[ Yes ]」,一樣會存檔,然後接著離開「mcedit」。 ================================================================================ 採用上面的其中一種方式,編輯好「test.sh」後, 這時候只要執行
就會顯示
其他更多的概念,您可以再回頭來看上面「回覆#8」提到的「Shell Script」的那邊的上下文。 * Wikipidia / Shell script (中文) * Wikipidia / Shebang (Unix) (中文) * Wikipidia / chmod (中文) * Ubuntu Community Help Wiki / Beginners/BashScripting * bash-handbook / Non-interactive mode (中文) * Bash Guide for Beginners / 2.1. Creating and running a script ================================================================================ 以上釐清 報告完畢 ![]()
2017/7/19 23:42
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員二級
![]() ![]() 註冊日期:
2017/7/1 0:41 所屬群組:
已註冊使用者 等級: 7
HP : 0 / 152
![]() |
-o objs/ngx_modules.o \
objs/ngx_modules.c cd ../pcre-8.39 \ && make libpcre.la make[2]: Entering directory '/home/wjfadiwjf/project/nginx-src/pcre-8.39' CC libpcre_la-pcre_byte_order.lo CC libpcre_la-pcre_compile.lo CC libpcre_la-pcre_config.lo CC libpcre_la-pcre_dfa_exec.lo CC libpcre_la-pcre_exec.lo CC libpcre_la-pcre_fullinfo.lo CC libpcre_la-pcre_get.lo CC libpcre_la-pcre_globals.lo CC libpcre_la-pcre_jit_compile.lo CC libpcre_la-pcre_maketables.lo CC libpcre_la-pcre_newline.lo CC libpcre_la-pcre_ord2utf8.lo CC libpcre_la-pcre_refcount.lo CC libpcre_la-pcre_string_utils.lo CC libpcre_la-pcre_study.lo CC libpcre_la-pcre_tables.lo CC libpcre_la-pcre_ucd.lo CC libpcre_la-pcre_valid_utf8.lo CC libpcre_la-pcre_version.lo CC libpcre_la-pcre_xclass.lo rm -f pcre_chartables.c ln -s ./pcre_chartables.c.dist pcre_chartables.c CC libpcre_la-pcre_chartables.lo CCLD libpcre.la ar: `u' modifier ignored since `D' is the default (see `U') make[2]: Leaving directory '/home/wjfadiwjf/project/nginx-src/pcre-8.39' cc -o objs/nginx \ objs/src/core/nginx.o \ objs/src/core/ngx_log.o \ objs/src/core/ngx_palloc.o \ objs/src/core/ngx_array.o \ objs/src/core/ngx_list.o \ objs/src/core/ngx_hash.o \ objs/src/core/ngx_buf.o \ objs/src/core/ngx_queue.o \ objs/src/core/ngx_output_chain.o \ objs/src/core/ngx_string.o \ objs/src/core/ngx_parse.o \ objs/src/core/ngx_parse_time.o \ objs/src/core/ngx_inet.o \ objs/src/core/ngx_file.o \ objs/src/core/ngx_crc32.o \ objs/src/core/ngx_murmurhash.o \ objs/src/core/ngx_md5.o \ objs/src/core/ngx_rbtree.o \ objs/src/core/ngx_radix_tree.o \ objs/src/core/ngx_slab.o \ objs/src/core/ngx_times.o \ objs/src/core/ngx_shmtx.o \ objs/src/core/ngx_connection.o \ objs/src/core/ngx_cycle.o \ objs/src/core/ngx_spinlock.o \ objs/src/core/ngx_rwlock.o \ objs/src/core/ngx_cpuinfo.o \ objs/src/core/ngx_conf_file.o \ objs/src/core/ngx_resolver.o \ objs/src/core/ngx_open_file_cache.o \ objs/src/core/ngx_crypt.o \ objs/src/core/ngx_proxy_protocol.o \ objs/src/core/ngx_syslog.o \ objs/src/event/ngx_event.o \ objs/src/event/ngx_event_timer.o \ objs/src/event/ngx_event_posted.o \ objs/src/event/ngx_event_accept.o \ objs/src/event/ngx_event_connect.o \ objs/src/event/ngx_event_pipe.o \ objs/src/os/unix/ngx_time.o \ objs/src/os/unix/ngx_errno.o \ objs/src/os/unix/ngx_alloc.o \ objs/src/os/unix/ngx_files.o \ objs/src/os/unix/ngx_socket.o \ objs/src/os/unix/ngx_recv.o \ objs/src/os/unix/ngx_readv_chain.o \ objs/src/os/unix/ngx_udp_recv.o \ objs/src/os/unix/ngx_send.o \ objs/src/os/unix/ngx_writev_chain.o \ objs/src/os/unix/ngx_channel.o \ objs/src/os/unix/ngx_shmem.o \ objs/src/os/unix/ngx_process.o \ objs/src/os/unix/ngx_daemon.o \ objs/src/os/unix/ngx_setaffinity.o \ objs/src/os/unix/ngx_setproctitle.o \ objs/src/os/unix/ngx_posix_init.o \ objs/src/os/unix/ngx_user.o \ objs/src/os/unix/ngx_process_cycle.o \ objs/src/os/unix/ngx_linux_init.o \ objs/src/event/modules/ngx_epoll_module.o \ objs/src/os/unix/ngx_linux_sendfile_chain.o \ objs/src/event/ngx_event_openssl.o \ objs/src/event/ngx_event_openssl_stapling.o \ objs/src/core/ngx_regex.o \ objs/src/http/ngx_http.o \ objs/src/http/ngx_http_core_module.o \ objs/src/http/ngx_http_special_response.o \ objs/src/http/ngx_http_request.o \ objs/src/http/ngx_http_parse.o \ objs/src/http/ngx_http_header_filter_module.o \ objs/src/http/ngx_http_write_filter_module.o \ objs/src/http/ngx_http_copy_filter_module.o \ objs/src/http/modules/ngx_http_log_module.o \ objs/src/http/ngx_http_request_body.o \ objs/src/http/ngx_http_variables.o \ objs/src/http/ngx_http_script.o \ objs/src/http/ngx_http_upstream.o \ objs/src/http/ngx_http_upstream_round_robin.o \ objs/src/http/modules/ngx_http_static_module.o \ objs/src/http/modules/ngx_http_index_module.o \ objs/src/http/modules/ngx_http_chunked_filter_module.o \ objs/src/http/modules/ngx_http_range_filter_module.o \ objs/src/http/modules/ngx_http_headers_filter_module.o \ objs/src/http/modules/ngx_http_not_modified_filter_module.o \ objs/src/http/ngx_http_file_cache.o \ objs/src/http/modules/ngx_http_gzip_filter_module.o \ objs/src/http/ngx_http_postpone_filter_module.o \ objs/src/http/modules/ngx_http_ssi_filter_module.o \ objs/src/http/modules/ngx_http_charset_filter_module.o \ objs/src/http/modules/ngx_http_userid_filter_module.o \ objs/src/http/v2/ngx_http_v2.o \ objs/src/http/v2/ngx_http_v2_table.o \ objs/src/http/v2/ngx_http_v2_huff_decode.o \ objs/src/http/v2/ngx_http_v2_huff_encode.o \ objs/src/http/v2/ngx_http_v2_module.o \ objs/src/http/v2/ngx_http_v2_filter_module.o \ objs/src/http/modules/ngx_http_autoindex_module.o \ objs/src/http/modules/ngx_http_auth_basic_module.o \ objs/src/http/modules/ngx_http_access_module.o \ objs/src/http/modules/ngx_http_limit_conn_module.o \ objs/src/http/modules/ngx_http_limit_req_module.o \ objs/src/http/modules/ngx_http_geo_module.o \ objs/src/http/modules/ngx_http_map_module.o \ objs/src/http/modules/ngx_http_split_clients_module.o \ objs/src/http/modules/ngx_http_referer_module.o \ objs/src/http/modules/ngx_http_rewrite_module.o \ objs/src/http/modules/ngx_http_ssl_module.o \ objs/src/http/modules/ngx_http_proxy_module.o \ objs/src/http/modules/ngx_http_fastcgi_module.o \ objs/src/http/modules/ngx_http_uwsgi_module.o \ objs/src/http/modules/ngx_http_scgi_module.o \ objs/src/http/modules/ngx_http_memcached_module.o \ objs/src/http/modules/ngx_http_empty_gif_module.o \ objs/src/http/modules/ngx_http_browser_module.o \ objs/src/http/modules/ngx_http_flv_module.o \ objs/src/http/modules/ngx_http_mp4_module.o \ objs/src/http/modules/ngx_http_upstream_hash_module.o \ objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \ objs/src/http/modules/ngx_http_upstream_least_conn_module.o \ objs/src/http/modules/ngx_http_upstream_keepalive_module.o \ objs/src/http/modules/ngx_http_upstream_zone_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_init.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_handshake.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_handler.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_amf.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_send.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_shared.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_eval.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_receive.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_core_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_cmd_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_codec_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_access_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_record_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_live_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_play_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_flv_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_mp4_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_netcall_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_relay_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_bandwidth.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_exec_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_auto_push_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_notify_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_log_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_limit_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_bitop.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_proxy_protocol.o \ objs/addon/hls/ngx_rtmp_hls_module.o \ objs/addon/dash/ngx_rtmp_dash_module.o \ objs/addon/hls/ngx_rtmp_mpegts.o \ objs/addon/dash/ngx_rtmp_mp4.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_stat_module.o \ objs/addon/nginx-rtmp-module/ngx_rtmp_control_module.o \ objs/ngx_modules.o \ -lpthread -lcrypt ../pcre-8.39/.libs/libpcre.a -lssl -lcrypto -ldl -lz make[1]: Leaving directory '/home/wjfadiwjf/project/nginx-src/nginx' make -f objs/Makefile manpage make[1]: Entering directory '/home/wjfadiwjf/project/nginx-src/nginx' sed -e "s|%%PREFIX%%|/usr/local/nginx|" \ -e "s|%%PID_PATH%%|/usr/local/nginx/logs/nginx.pid|" \ -e "s|%%CONF_PATH%%|/usr/local/nginx/conf/nginx.conf|" \ -e "s|%%ERROR_LOG_PATH%%|/usr/local/nginx/logs/error.log|" \ < docs/man/nginx.8 > objs/nginx.8 make[1]: Leaving directory '/home/wjfadiwjf/project/nginx-src/nginx' [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~/project/nginx-src/nginx[0m$ sudo make install [sudo] password for wjfadiwjf: make -f objs/Makefile install make[1]: Entering directory '/home/wjfadiwjf/project/nginx-src/nginx' test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx' test -d '/usr/local/nginx/sbin' || mkdir -p '/usr/local/nginx/sbin' test ! -f '/usr/local/nginx/sbin/nginx' || mv '/usr/local/nginx/sbin/nginx' '/usr/local/nginx/sbin/nginx.old' cp objs/nginx '/usr/local/nginx/sbin/nginx' test -d '/usr/local/nginx/conf' || mkdir -p '/usr/local/nginx/conf' cp conf/koi-win '/usr/local/nginx/conf' cp conf/koi-utf '/usr/local/nginx/conf' cp conf/win-utf '/usr/local/nginx/conf' test -f '/usr/local/nginx/conf/mime.types' || cp conf/mime.types '/usr/local/nginx/conf' cp conf/mime.types '/usr/local/nginx/conf/mime.types.default' test -f '/usr/local/nginx/conf/fastcgi_params' || cp conf/fastcgi_params '/usr/local/nginx/conf' cp conf/fastcgi_params '/usr/local/nginx/conf/fastcgi_params.default' test -f '/usr/local/nginx/conf/fastcgi.conf' || cp conf/fastcgi.conf '/usr/local/nginx/conf' cp conf/fastcgi.conf '/usr/local/nginx/conf/fastcgi.conf.default' test -f '/usr/local/nginx/conf/uwsgi_params' || cp conf/uwsgi_params '/usr/local/nginx/conf' cp conf/uwsgi_params '/usr/local/nginx/conf/uwsgi_params.default' test -f '/usr/local/nginx/conf/scgi_params' || cp conf/scgi_params '/usr/local/nginx/conf' cp conf/scgi_params '/usr/local/nginx/conf/scgi_params.default' test -f '/usr/local/nginx/conf/nginx.conf' || cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf' cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default' test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs' test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs' test -d '/usr/local/nginx/html' || cp -R docs/html '/usr/local/nginx' test -d '/usr/local/nginx/logs' || mkdir -p '/usr/local/nginx/logs' make[1]: Leaving directory '/home/wjfadiwjf/project/nginx-src/nginx' [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~/project/nginx-src/nginx[0m$ tree/usr/local/nginx -bash: tree/usr/local/nginx: No such file or directory [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~/project/nginx-src/nginx[0m$ /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx: /usr/local/openssl/lib/libcrypto.so.1.0.0: no version information available (required by /usr/local/nginx/sbin/nginx) /usr/local/nginx/sbin/nginx: /usr/local/openssl/lib/libcrypto.so.1.0.0: no version information available (required by /usr/local/nginx/sbin/nginx) /usr/local/nginx/sbin/nginx: /usr/local/openssl/lib/libssl.so.1.0.0: no version information available (required by /usr/local/nginx/sbin/nginx) /usr/local/nginx/sbin/nginx: /usr/local/openssl/lib/libssl.so.1.0.0: no version information available (required by /usr/local/nginx/sbin/nginx) /usr/local/nginx/sbin/nginx: /usr/local/openssl/lib/libssl.so.1.0.0: no version information available (required by /usr/local/nginx/sbin/nginx) nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied) 2017/07/20 22:27:06 [warn] 9577#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/nginx/conf/nginx.conf:1 2017/07/20 22:27:06 [emerg] 9577#0: unknown directive "stub_status" in /usr/local/nginx/conf/nginx.conf:70 [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~/project/nginx-src/nginx[0m$ pwd /home/wjfadiwjf/project/nginx-src/nginx [1;32mwjfadiwjf@ubuntuserverb[0m:[1;34m~/project/nginx-src/nginx[0m$ 我用大大#8方法操作到這裡了…… 原文這些我如何寫入……… # RMTP的服务器配置信息 rtmp { server { listen 2016; #推流的监听端口 publish_time_fix on; # 推流其一 application live { live on; #stream on live allow allow publish all; # control access privilege allow play all; # control access privilege } #推流其二 application hls_alic { live on; hls on; hls_path /home/alic/www/hls; hls_fragment 5s; } } } 作者:AlicFeng 和大大#3 #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { #listen 80; listen 8080; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { #root html; root /home/user/Videos/hls/www; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} } rtmp { server { listen 2016; #推流的監聽端口 publish_time_fix on; #推流其一 application live { live on; #stream on live allow allow publish all; # control access privilege allow play all; # control access privilege } #推流其二 application hls_alic { live on; hls on; hls_path /home/user/Videos/hls/www; hls_fragment 5s; } } } 差別在那裏……… 而這指令我要如何下…… 我的推流ip位子是192.168.43.168 如果我有2個以上推流ip位,那我要如何下指令…… $ ffmpeg -re -i /home/user/Videos/hls/video/test.mp4 -c copy -f flv rtmp://localhost:2016/hls_alic/film 接下來我要如何下指令…
2017/7/20 23:06
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
我之前有寫好一些範例,您可以先參考看看
* https://github.com/samwhelp/demo-nginx-rtmp/tree/gh-pages/example/prototype-001 上面連結,我之前有貼在「回覆#3」和「回覆#8」的最下方 原本一開始提到的範例,也就是「回覆#3」提到的範例,則是下面這一個連結 * https://github.com/samwhelp/demo-nginx-rtmp/tree/gh-pages/example/prototype-000 依照原文,nginx安裝的路徑是在 /usr/local/nginx 所以您要用文字編輯器,編輯下面這個檔案 /usr/local/nginx/conf/nginx.conf 附加原文提到設定,在上面那個檔案內容的下方 您問的差異,我之前有寫在「回覆#3」,您可以再研究比對, 另外之前在「回覆#3」的「nginx.conf」我有標藍色字。
2017/7/21 0:13
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
剛看了一下您「回覆#16」提供的「Doc6.docx」,
釐清一下 ================================================================================ 要執行「tree」這個指令, 要先安裝「tree」這個套件,系統預設應該是沒有安裝。 執行下面指令,安裝「tree」這個套件
安裝完畢後,可以執行下面指令確認是否已經安裝了
會顯示
套件操作的一些討論案例,紀錄在「[索引] 套件操作實務」,未來您再去深究這一段,現在先聚焦在目前的議題上。 ================================================================================ 而從您「回覆#16」提供的「Doc6.docx」。 您執行
顯示
這樣會把「tree/usr/local/nginx」整個當成一個指令,所以當然無法執行 正確的下法應該是下面的
在「tree」和「/usr/local/nginx」中間需要有「空白」, 就會顯示 /usr/local/nginx ├── conf │ ├── fastcgi.conf │ ├── fastcgi.conf.default │ ├── fastcgi_params │ ├── fastcgi_params.default │ ├── koi-utf │ ├── koi-win │ ├── mime.types │ ├── mime.types.default │ ├── nginx.conf │ ├── nginx.conf.default │ ├── scgi_params │ ├── scgi_params.default │ ├── uwsgi_params │ ├── uwsgi_params.default │ └── win-utf ├── html │ ├── 50x.html │ └── index.html ├── logs └── sbin └── nginx 4 directories, 18 files 可以執行下面指令,來瞭解「tree」這個指令的用法 $ man tree 另外這時候建議您可以看「鳥哥的 Linux 私房菜 / 第四章、首次登入與線上求助 / 4.2.1 開始下達指令」, 趁這個機會,您可以再反覆閱讀,讓您建立下指令的一些概念,更熟悉如何下指令。 上面這個連結,我有紀錄在「[索引]如何執行指令」這篇。 ================================================================================ ## start nginx 從您「回覆#16」提供的「Doc6.docx」來看, 依照您「nginx」安裝的路徑「/usr/local/nginx」為例, 您要啟動「nginx」, 您原本的指令下法,
上面指令應該要用「root」權限來執行, 因為您現在是的身份是「wjfadiwjf」,猜測應該是一般使用者。 所以您要在「/usr/local/nginx/sbin/nginx」前面加上「sudo」 也就是執行下面指令,
這時候系統會先問您密碼,您只要輸入「wjfadiwjf」的密碼就行了。 關於「sudo」的用法,可以參考「鳥哥的 Linux 私房菜 / 第十三章、Linux 帳號管理與 ACL 權限設定 / 13.4.2 sudo」, 上面這個連結,一樣有紀錄在「[索引]如何執行指令」這篇。 ================================================================================ ## reload nginx 執行
================================================================================ ## stop nginx 執行
================================================================================ 上面「start nginx」和「reload nginx」和「stop nginx」,可以參考另一個範例的說明, 可以從「nginx 簡易操作」那裡看起。 要注意的是,那個範例,「nginx」安裝的位置是在「/usr/local/share/nginx/」這個路徑。 所以執行檔的路徑則是在「/usr/local/share/nginx/sbin/nginx」這個路徑。 ================================================================================ 以上釐清 報告完畢 ![]()
2017/7/21 16:59
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 36
HP : 0 / 898
![]() |
寫了兩個新的範例,放在「GitHub」上
* concept-document-root-php * concept-document-root-nginx 用來輔助您瞭解「Document Root」的概念。 請依照上面列的順序閱讀「README.md」。 ![]() ## 更多參考 * Wikipedia / Web server (網頁伺服器) * Nginx Documentation / Beginner’s Guide / Serving Static Content * Apache / Mapping URLs to Filesystem Locations * PHP: Built-in web server - Manual * Python2 / 20.19. SimpleHTTPServer * Python3 / 21.22. http.server
2017/7/21 18:27
|
||||||||||
![]() |
回覆: ubuntu搭建推流服務器Nginx+rtmp |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員二級
![]() ![]() 註冊日期:
2017/7/1 0:41 所屬群組:
已註冊使用者 等級: 7
HP : 0 / 152
![]() |
謝謝大大,我在多看幾次....
如有不懂,在問大大..... 謝謝這幾天大力幫忙....
2017/7/22 17:22
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.