当前位置:网站首页>edusoho企培版纯内网部署教程(解决播放器,上传,后台卡顿问题)
edusoho企培版纯内网部署教程(解决播放器,上传,后台卡顿问题)
2022-06-30 11:51:00 【不是二师兄的八戒】
重点在后面的内网配置及代码改动
1.先配置linux环境(php nginx mysql)
php7.1 7.2 7.3 选择你要的版本。 7以下 和7.4及以上不支持(装了跑不起来的,不信可以试试)
mysql5.7-mysql8.0 之间选择你要的版本
nginx
注意: 需要修改部分配置
php
//修改/etc/php/7.1/fpm/php.ini文件配置项
vim /etc/php/7.1/fpm/php.ini
post_max_size = 1024M
memory_limit = 1024M
upload_max_filesize = 1024M
//修改 PHP-FPM 监听方式为127.0.0.1:9000:
sudo sed -i 's/listen = .*/listen = 127.0.0.1:9000/g'
/etc/php/7.1/fpm/pool.d/www.conf
//重启php
sudo service php7.1-fpm restart
nginx
vim /etc/nginx/nginx.conf
添加`client_max_body_size 1024M;`到http下,如下所示
http {
##
# Basic Settings
##
client_max_body_size 1024M; #添加后nginx可以允许上传更大的文件
...
}2.下载edusoho企培版
cd /var/www
//这里是21.4.5 你可以选择下载最新的也可以安装这个版本跑通以后,后台再去升级,因为官方下载的包也不是最新的版本
wget https://download.edusoho.com/edusoho-ct-21.4.5.zip
//没有zip 安装zip
sudo apt install zip
unzip edusoho-ct-21.4.5.zip
cd edusoho
// 给权限
sudo chown -R www-data:www-data .
sudo chmod -R 777 .3.配置edusoho的nginx
cd /etc/nginx/sites-enabled
sudo vim edusoho
粘贴下面内容
server {
listen 80;
# [改] 网站的域名 或服务器ip
server_name 121.199.50.180;
#301跳转可以在nginx中配置
# 程序的安装路径
root /var/www/edusoho/web;
# 日志路径
access_log /var/log/nginx/edusoho.com.access.log;
error_log /var/log/nginx/edusoho.com.error.log;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/udisk {
internal;
root /var/www/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=/var/www/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|php7.0)$ {
deny all;
}
# 以下配置允许运行.php的程序,方便于其他第三方系统的集成。
location ~ \.php$ {
# [改] 请根据实际php-fpm运行的方式修改
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_PROXY "";
}
}浏览器输入ip或域名就开始你的安装流程了 直接下一步下一步 就完工了
重点:内网配置 纯内网部署(注意仅限于不能接外网的情况下)
1.下载sdk文件:
链接: https://pan.baidu.com/s/1akGId9DOrtN60iec_Acu1A 提取码: n27n
sdk功能是持续在更新的 目前这个是2021-11-01版本,能正常使用 如需最新需要联系官方获取
2.替换文件 :
替换项目目录web/service-cdn
3. 创建文件(不用管它干嘛用的,没有这个你打不开下一步)
app/data 下新建dev.lock 文件
4. 修改配置 :
进入你的网校地址 /app_dev.php/admin/setting/developer 修改气球云SDK的CDN地址为 域名/service-cdn/ 例子dev.edudev.com/service-cdn/ 切记不带http://
修改是否无外网配置

5.修改部分代码
修改src/Biz/CloudPlatform/Client/FailoverCloudAPI.php 文件中的 getServerList方法
public function getServerList($nextRefreshTime = 0)
{
$prevApiUrl = $this->apiUrl;
$this->setApiUrl($this->rootApiUrl);
$servers = parent::_request('GET', '/server_list', array(), array());
$servers = '{"root":"http:\/\/api.edusoho.net","leafs":[{"url":"http:\/\/leafapi1.edusoho.net","used_count":0},{"url":"http:\/\/leafapi2.edusoho.net","used_count":0}],"current_leaf":"http:\/\/leafapi2.edusoho.net","failed_count":0,"failed_expired":0,"next_refresh_time":1652733014}';
$servers = json_decode($servers, true);
$this->setApiUrl($prevApiUrl);
if (empty($servers) || empty($servers['root']) || empty($servers['current_leaf']) || empty($servers['leafs'])) {
$servers = $this->getServerListFromCdn();
if (empty($servers) || empty($servers['root']) || empty($servers['leafs'])) {
throw new \RuntimeException('Requested API Server list from CDN failed.');
}
}
if (empty($servers['current_leaf'])) {
$servers['current_leaf'] = $servers['leafs'][array_rand($servers['leafs'])]['url'];
}
foreach ($servers['leafs'] as &$leaf) {
$leaf['used_count'] = 0;
unset($leaf);
}
$servers['failed_count'] = 0;
$servers['failed_expired'] = 0;
if (empty($nextRefreshTime)) {
//确保每天的凌晨0~5点之间的时间内更新
$hour = rand(0, 5);
$minute = rand(0, 59);
$second = rand(0, 59);
$nextRefreshTime = strtotime(date('Y-m-d 0:0:0', strtotime('+1 day'))) + $hour * 3600 + $minute * 60 + $second;
}
$servers['next_refresh_time'] = $nextRefreshTime;
return $servers;
}
6.修复内网情况下后台所有页面卡顿问题
修改
src/CorporateTrainingBundle/Resources/views/admin/default/corporate-training-admin-index.html.twig
换上下面所有代码
{% extends 'admin/admin-layout.html.twig' %}
{% block title %}{
{ 'homepage.header.admin_menu'|trans }}{% endblock %}
{% set panel = 'dashboard' %}
{% set script_controller = 'corporatetrainingbundle/controller/default/admin-index' %}
{% do script(['libs/fullcalendar.js', 'corporatetrainingbundle/js/admin/default/index.js', 'corporatetrainingbundle/js/admin/quick-entrance/index.js']) %}
{% block container %}
{
{ web_macro.flash_messages() }}
<link href="{
{ asset('assets/libs/gallery/morris/0.5.0/morris.css') }}" rel="stylesheet"/>
{# 域名检查提示 #}
{# {
{ render(controller('AppBundle:Admin/Default:validateDomain')) }}#}
{% if onlineAdvisoryAuthInfo.level is defined %}
{% set setting = setting('auto_upgrade') %}
{% set onlineAdvisoryAuthInfo = online_advisory_auth_info() %}
{% set showAutoUpgradeNotify = onlineAdvisoryAuthInfo.isCustom != '是' and onlineAdvisoryAuthInfo.level != 'none' and not setting.notification_shown|default(false) %}
<div class="alert alert-success row {% if not has_permission('admin_optimize_settings') or not showAutoUpgradeNotify%}hidden{% endif %}"
data-show-modal="{% if has_permission('admin_optimize_settings') and (onlineAdvisoryAuthInfo.level == 'none' or onlineAdvisoryAuthInfo.level|default('') == 'license') and not setting.notification_shown|default(false) %}1{% else %}0{% endif %}"
id="js-auto-upgrade-box" style="border:none;border-radius:0;padding: 10px 31px 10px 31px;line-height:32px;" data-notify-url="{
{ path('admin_auto_upgrade_notify') }}">
<div class="pull-left">{
{ 'admin.app_upgrades.auto_upgrade_tips'|trans({'%settingUrl%': path('admin_optimize')})|raw }}</div>
<a href="javascript:;" class="btn color-success pull-right" id="js-auto-upgrade-confirm-btn"
data-url="{
{ path('admin_optimize_auto_upgrade') }}">我知道了</a>
</div>
{% endif %}
<div class="admin-index">
<div class="admin-index__left">
{# 待办工作 #}
<div class="admin-index-block to-do-work">
{
{ render(controller('CorporateTrainingBundle:Admin/Train/MyWorks:myWorks')) }}
</div>
{% if app.user.manageOrgIds|default() %}
{# 数据统计 #}
{% include 'admin/default/data-overview.html.twig' %}
{# 学习趋势图 and 排行榜 #}
<div class="echart-rank clearfix">
{% include 'admin/default/corporate-training-echart-rank.html.twig' %}
</div>
{% endif %}
{# 系统状态 #}
<div>
{% cache 'system/version' 600 %}
{# {
{ render(controller('CorporateTrainingBundle:Admin/Analysis:systemStatus')) }}#}
{% endcache %}
</div>
{# 经营建议(高级去版权不显示)#}
{% if not setting('copyright.thirdCopyright', false) == 1 %}
{# <div class="js-admin-advice" data-url="{
{ path('admin_business_advice') }}"></div>#}
{% endif %}
</div>
{# <div class="admin-index__right index-right">#}
{# {% include "admin/default/admin-index-right.html.twig" %}#}
{# </div>#}
</div>
{% endblock %}
{% do load_script('widget/tooltip-widget') %}
最后 去创建课程 上传视频音频。 播放正常就ok了
有问题欢迎私信
边栏推荐
- Openmldb meetup No.4 meeting minutes
- Redis - SDS simple dynamic string
- time 函数和 clock_gettime()函数的区别
- 光谱共焦位移传感器的原理是什么?能应用那些领域?
- Go zero micro Service Practice Series (VIII. How to handle tens of thousands of order requests per second)
- 3D视觉检测在生产流水的应用有哪些
- TypeScript ReadonlyArray(只读数组类型) 详细介绍
- wallys/3 × 3 MIMO 802.11ac Mini PCIe Wi-Fi Module, QCA9880, 2,4GHz / 5GHzDesigned for Enterprise
- 用于生成学习任务的量子神经网络2022最新综述
- 21、wpf之绑定使用小记
猜你喜欢

In depth analysis of Apache bookkeeper series: Part 4 - back pressure

A high precision positioning approach for category support components with multiscale difference reading notes

He was the first hero of Shanghai's two major industries, but died silently in regret

Beego development blog system learning (II)

Limited time appointment | Apache pulsar Chinese developer and user group meeting in June
![Speech recognition - Fundamentals (I): introduction [speech to text]](/img/28/eb45bf27fffaa29108de84aa72a335.png)
Speech recognition - Fundamentals (I): introduction [speech to text]

聊聊怎么做硬件兼容性检测,快速迁移到openEuler?

会议预告 | 华为 2012 实验室全球软件技术峰会-欧洲分会场

led背光板的作用是什麼呢?

Boost研究:Boost Log
随机推荐
Go 语言入门很简单:Go 处理 XML 文件
并行接口8255A
R语言ggplot2可视化:使用ggplot2可视化散点图、使用scale_color_viridis_d函数指定数据点的配色方案
1020. number of enclaves
koa - 洋葱模型浅析
缓存雪崩和缓存穿透解决方案
AUTOCAD——LEN命令
R language ggplot2 visualization: gganimate package is based on Transition_ Time function to create dynamic scatter animation (GIF)
3D线光谱共焦传感器在半导体如何检测
STM32F407ZGT6使用SDIO方式驱动SD卡
"War" caused by a bottle of water
YOLOv5导出onnx遇到的坑
自定义一个注解来获取数据库的链接
一个悄然崛起的国产软件,低调又强大!
Customize an annotation to get a link to the database
shell第一个命令结果传入第二个命令删除
He was the first hero of Shanghai's two major industries, but died silently in regret
来聊聊怎么做硬件兼容性检测,快速迁移到openEuler?
TypeScript ReadonlyArray(只读数组类型) 详细介绍
Flutter 从零开始 005 图片及Icon