Edusohu搭建

edusohu网站: 线上视频网站

获取代码信息

wget http://download.edusoho.com/edusoho-8.2.17.tar.gz
tar xf edusoho-8.2.17.tar.gz
mv /server/tools/edusoho/*  /html/edusoho/

nginx配置文件

server {
         listen 80;
         server_name edu.oldboy.com;
         root /html/edusoho/web;
         client_max_body_size 200m;
     
         location / {
             index app.php;
             try_files $uri @rewriteapp;
         }
         location @rewriteapp {
             rewrite ^(.*)$ /app.php/$1 last;
         }
     
         location ~ ^/udisk {
             internal;
             root /html/edusoho/app/data/;
         }
     
         location ~ ^/(app|app_dev)\.php(/|$) {
             fastcgi_pass   127.0.0.1:9000;
             fastcgi_split_path_info ^(.+\.php)(/.*)$;
             include fastcgi_params;
             fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
             fastcgi_param  HTTPS              off;
             fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect;
             fastcgi_param HTTP_X-Accel-Mapping /udisk=/html/edusoho/app/data/udisk;
             fastcgi_buffer_size 128k;
             fastcgi_buffers 8 128k;
         }
     
         # 配置设置图片格式文件
         location ~* \.(jpg|jpeg|gif|png|ico|swf)$ {
             # 过期时间为3年
             expires 3y;
             # 关闭日志记录
             access_log off;
             # 关闭gzip压缩,减少CPU消耗,因为图片的压缩率不高。
             gzip off;
         }
         # 配置css/js文件
         location ~* \.(css|js)$ {
             access_log off;
             expires 3y;
         }
         # 禁止用户上传目录下所有.php文件的访问,提高安全性
         location ~ ^/files/.*\.(php|php5)$ {
             deny all;
         }
     
         # 以下配置允许运行.php的程序,方便于其他第三方系统的集成。
         location ~ \.php$ {
             fastcgi_pass   127.0.0.1:9000;
             fastcgi_split_path_info ^(.+\.php)(/.*)$;
             include fastcgi_params;
             fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
             fastcgi_param  HTTPS              off;
         }
     }

第三个里程: 网站页面初始化

(页面安装向导)

第四个里程: 访问测试

(视频数据无法上传 是由于php程序限制数据上传大小)

PS:

# vim /etc/php.ini

​ post_max_size = 200M

​ upload_max_filesize = 200M

​ # systemctl restart php-fpm

posted @ 2020-11-09 15:16  HSping  阅读(169)  评论(0编辑  收藏  举报