# 自架直播網站 # ZLMediaKit篇 https://github.com/ZLMediaKit/ZLMediaKit ## 一、安裝 官網教學 https://github.com/ZLMediaKit/ZLMediaKit/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B ### 1、git 程式碼 先把程式碼git clone下來 ```bash git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit cd ZLMediaKit ``` 有依賴其他lib,這步請不要遺漏 ```bash git submodule update --init ``` ### 2、編譯器 確認電腦有Cmake與gcc,沒有的話官方給出以下安裝方法 #### gcc ```bash sudo apt-get install build-essential ``` #### cmake ```bash sudo apt-get install cmake ``` ### 3、依賴庫 ```bash #必裝 sudo apt-get install libssl-dev #可選 (建議裝ffmpeg) sudo apt-get install libsdl-dev sudo apt-get install libavcodec-dev sudo apt-get install libavutil-dev sudo apt-get install ffmpeg ``` ### 4、編譯程式 跟我們一般在編譯程式一模一樣 ```bash cd ZLMediaKit mkdir build cd build cmake .. make -j4 ``` ### 5、運行 ```bash cd ZLMediaKit/release/linux/Debug #透過-h可以了解啟動參數 ./MediaServer -h #啟動 ./MediaServer ``` 我的系統沒有root,似乎要加sudo,你們就跑跑看吧 ```bash sudo ./MediaServer ``` 啟動後如果沒有跳紅色的錯誤訊息 那就代表成功了 ## 常用指令 ```bash sudo code . --user-data-dir="." --no-sandbox cd /ext/nginx/ sudo nginx -s reload sudo systemctl status nginx sudo netstat -pan | grep ":80" ifstat http://127.0.0.1/index/api/addFFmpegSource?src_url=rtmp://taiyopen.ddns.net/live/test&dst_url=rtmp://taiyopen.ddns.net/live1/test&timeout_ms=10000 http://taiyopen.ddns.net:1650/ZLMediakit/index/api/addFFmpegSource?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&src_url=rtmp://taiyopen.ddns.net/live/test&dst_url=rtmp://taiyopen.ddns.net/live1/test&timeout_ms=10000 ``` 降低延遲 https://serverfault.com/questions/927613/how-to-reduce-latency-with-nginx-rtmp-streaming-server https://blog.csdn.net/impingo/article/details/102558792 https://github.com/pingostack/h5player https://ithelp.ithome.com.tw/articles/10209237 <script src="https://cdn.jsdelivr.net/npm/videojs-flash@2/dist/videojs-flash.min.js"></script> https://github.com/shiyuan598/live-video https://github.com/ZLMediaKit/ZLMediaKit/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B # Apache與wordpress網站架站教學 不錯的教學 https://cclfun.com/%E7%94%A8ubuntu-20-04%E8%87%AA%E6%9E%B6wordpress5-5/ ## 一、wordpress安裝 安裝apache2 ```bash= sudo apt update sudo apt upgrade sudo apt install apache2 sudo ufw app list sudo ufw allow ‘Apache Full’ sudo ufw status sudo systemctl status apache2 (完成apache2) ``` 安裝mysql ```bash= sudo apt install mysql-server sudo service mysql status sudo mysql_secure_installation ``` 安裝PHP ```bash= sudo apt install php libapache2-mod-php php7.4-mysql php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y php -v ``` 調整PHP的一些上傳檔案的設定(這個很重要) ```bash sudo vim /etc/php/7.4/apache2/php.ini ``` 找到下列選項調成對應的值 upload_max_filesize = 128M post_max_size = 128M memory_limit = 256M max_execution_time = 600 max_input_vars = 3000 max_input_time = 1000 ## 永久連結沒反應 首先要修改 Apache 的 apache2.conf,該檔案存放在 etc/apache2 底下 ```bash sudo vim /etc/apache2/apache2.conf ``` 找到 <Directory /var/www/> 這段,將 AllowOverride None 改成 AllowOverride all 然後給予.htaccess讀寫權限 ```bash sudo chmod 777 -R /var/www/html/.htaccess ``` 開啟 Apache 的 mod_rewrite 功能,預設是關閉的,透過以下指令來啟動覆寫功能 ```bash sudo a2enmod rewrite ``` 設定完成,重啟伺服器與資料庫 ```bash sudo service apache2 restart sudo service mysql restart ``` 再回到瀏覽器,進入 WordPress 後台,設定永久連結,就能成功了 add_action( 'admin_init', function() { update_option( 'brizy-pro_activation', [ 'license_key' => 'NulledbyBabiato' ] ); } );
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up