Video視頻項目本地啟動搭建環境教程


本項目所有的第三方中間件等地址都是 localhost 如果您需要發布,如果你的中間件地址不是在本地的改一下項目當中對應中間件地址即可完成環境搭建🐤寫的不是很細,不適合給剛入門的小白看的

本文章的目的就是搭建本項目的環境,可以讓你在本地即可把項目跑起來,搭建步驟如下。

搭建 Redis

參考: https://www.cnblogs.com/BNTang/articles/13430578.html

參考如上鏈接搭建好 Redis 因為項目當中所有的 Redis 配置都是 localhost 所以本地搭建好啟動好 Redis 即可,我們只需要把需要用到 Redis 的服務配置好即可,當前項目只是 service_user 用到了更改這個模塊即可:

搭建 Nacos

參考:https://www.cnblogs.com/BNTang/articles/13476559.html

如上的鏈接當中有集群的搭建方案與單擊的搭建,因為項目當中的 Nacos 地址都是 localhost 所以你發現不是你需要自己修改為你搭建的 Nacos 服務器地址即可,項目當中有需要模塊,如果你需要發布等等,如果是本地環境跑起來,你只需要在本地搭建好 Nacos 即可:

SQL 腳本

藍奏雲下載地址:https://wwe.lanzoui.com/iGihtq43okh

搭建 Nginx

參考:https://www.cnblogs.com/BNTang/articles/14614331.html

nginx.conf 內容如下

#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;
    client_max_body_size 1024m;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        location ~ /service_video {
            proxy_pass http://localhost:8001;
        }

        location ~ /service_upload {
            proxy_pass http://localhost:8002;
        }

        location ~ /service_vod {
            proxy_pass http://localhost:8003;
        }

        location ~ /wx {
            proxy_pass http://localhost:8007;
        }

        #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;
    #    }
    #}
}

搭建 Sentinel

搭建 Node.js

參考:https://www.cnblogs.com/BNTang/articles/13674837.html

如果項目在搭建過程當中可能你會少一些依賴,那么你可以把如下的幾篇文章看完即可解決。

有問題一一在評論區當中提問即可🐤


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM