mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
@@ -50,7 +50,6 @@ systemd 支持 CentOS,Ubuntu,Debian,Fedora...
|
||||
### 问题
|
||||
- Ubuntu 20 无法安装mysql5.7 && mysql 80.
|
||||
- Ftp debian无法安装成功。
|
||||
- php52,在debian无法安装成功。
|
||||
|
||||
|
||||
### GW使用
|
||||
@@ -82,6 +81,14 @@ curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.s
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 通用安装
|
||||
|
||||
```
|
||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/quick/app.sh | bash
|
||||
```
|
||||
|
||||
|
||||
### DEV使用
|
||||
|
||||
- 自动安装
|
||||
@@ -122,11 +129,9 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/up
|
||||
[](https://starchart.cc/midoks/mdserver-web)
|
||||
|
||||
|
||||
### 感谢
|
||||
### 感谢开发赞助
|
||||
|
||||
- 开发赞助
|
||||
|
||||
[digitalvirt](https://digitalvirt.com/)
|
||||
[](https://digitalvirt.com/)
|
||||
|
||||
### 授权许可
|
||||
|
||||
|
||||
@@ -98,6 +98,23 @@ def isAppleSystem():
|
||||
return False
|
||||
|
||||
|
||||
def isNumber(s):
|
||||
try:
|
||||
float(s)
|
||||
return True
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
try:
|
||||
import unicodedata
|
||||
unicodedata.numeric(s)
|
||||
return True
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def deleteFile(file):
|
||||
if os.path.exists(file):
|
||||
os.remove(file)
|
||||
|
||||
@@ -48,6 +48,13 @@ class plugins_api:
|
||||
def listApi(self):
|
||||
sType = request.args.get('type', '0')
|
||||
sPage = request.args.get('p', '1')
|
||||
|
||||
if not mw.isNumber(sPage):
|
||||
sPage = 1
|
||||
|
||||
if not mw.isNumber(sType):
|
||||
sType = 0
|
||||
|
||||
# print sPage
|
||||
data = self.getPluginList(sType, int(sPage))
|
||||
return mw.getJson(data)
|
||||
|
||||
@@ -48,8 +48,7 @@ INSERT INTO `firewall` (`id`, `port`, `ps`, `addtime`) VALUES
|
||||
(1, '80', '网站默认端口', '0000-00-00 00:00:00'),
|
||||
(2, '7200', 'WEB面板', '0000-00-00 00:00:00'),
|
||||
(3, '22', 'SSH远程管理服务', '0000-00-00 00:00:00'),
|
||||
(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00'),
|
||||
(5, '3306', 'MySQL端口', '0000-00-00 00:00:00');
|
||||
(4, '888', 'phpMyAdmin默认端口', '0000-00-00 00:00:00');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -267,7 +267,21 @@ def initdUinstall():
|
||||
def runInfo():
|
||||
# 取Openresty负载状态
|
||||
try:
|
||||
result = mw.httpGet('http://127.0.0.1/nginx_status')
|
||||
url = 'http://' + mw.getHostAddr() + '/nginx_status'
|
||||
result = mw.httpGet(url)
|
||||
tmp = result.split()
|
||||
data = {}
|
||||
data['active'] = tmp[2]
|
||||
data['accepts'] = tmp[9]
|
||||
data['handled'] = tmp[7]
|
||||
data['requests'] = tmp[8]
|
||||
data['Reading'] = tmp[11]
|
||||
data['Writing'] = tmp[13]
|
||||
data['Waiting'] = tmp[15]
|
||||
return mw.getJson(data)
|
||||
except Exception as e:
|
||||
url = 'http://127.0.0.1/nginx_status'
|
||||
result = mw.httpGet(url)
|
||||
tmp = result.split()
|
||||
data = {}
|
||||
data['active'] = tmp[2]
|
||||
|
||||
@@ -24,6 +24,7 @@ else
|
||||
useradd -g www -s /bin/bash www
|
||||
fi
|
||||
|
||||
# cd /www/server/mdserver-web/plugins/openresty && /bin/bash install.sh install 1.21.4.1
|
||||
Install_openresty()
|
||||
{
|
||||
mkdir -p ${openrestyDir}
|
||||
@@ -37,13 +38,19 @@ Install_openresty()
|
||||
cd ${openrestyDir} && tar -zxvf openresty-${VERSION}.tar.gz
|
||||
|
||||
# --with-openssl=$serverPath/source/lib/openssl-1.0.2q
|
||||
cd ${openrestyDir}/openresty-${VERSION} && ./configure --prefix=$serverPath/openresty \
|
||||
cd ${openrestyDir}/openresty-${VERSION} && ./configure \
|
||||
--prefix=$serverPath/openresty \
|
||||
--with-http_v2_module \
|
||||
--with-http_ssl_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module && make && make install && \
|
||||
echo "${VERSION}" > $serverPath/openresty/version.pl
|
||||
echo "" > $serverPath/web_conf/nginx/enable-php-00.conf
|
||||
--with-http_stub_status_module
|
||||
|
||||
make && make install && make clean
|
||||
|
||||
if [ -d $serverPath/openresty ];then
|
||||
echo "${VERSION}" > $serverPath/openresty/version.pl
|
||||
echo "" > $serverPath/openresty/nginx/conf/enable-php-00.conf
|
||||
fi
|
||||
echo '安装完成' > $install_tmp
|
||||
}
|
||||
|
||||
|
||||
+28
-15
@@ -521,25 +521,38 @@ def setFpmConfig(version):
|
||||
|
||||
|
||||
def checkFpmStatusFile(version):
|
||||
if mw.isInstalledWeb():
|
||||
sdir = mw.getServerDir()
|
||||
dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
||||
if not os.path.exists(dfile):
|
||||
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
||||
content = mw.readFile(tpl)
|
||||
content = contentReplace(content, version)
|
||||
mw.writeFile(dfile, content)
|
||||
mw.restartWeb()
|
||||
if not mw.isInstalledWeb():
|
||||
return False
|
||||
|
||||
dfile = getServerDir() + '/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
||||
if not os.path.exists(dfile):
|
||||
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
||||
content = mw.readFile(tpl)
|
||||
content = contentReplace(content, version)
|
||||
mw.writeFile(dfile, content)
|
||||
mw.restartWeb()
|
||||
return True
|
||||
|
||||
|
||||
def getFpmStatus(version):
|
||||
checkFpmStatusFile(version)
|
||||
result = mw.httpGet(
|
||||
'http://127.0.0.1/phpfpm_status_' + version + '?json')
|
||||
tmp = json.loads(result)
|
||||
fTime = time.localtime(int(tmp['start time']))
|
||||
tmp['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
||||
return mw.getJson(tmp)
|
||||
|
||||
try:
|
||||
url = 'http://' + mw.getHostAddr() + '/phpfpm_status_' + version + '?json'
|
||||
result = mw.httpGet(url)
|
||||
data = json.loads(result)
|
||||
fTime = time.localtime(int(data['start time']))
|
||||
data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
||||
except Exception as e:
|
||||
url = 'http://127.0.0.1/phpfpm_status_' + version + '?json'
|
||||
result = mw.httpGet(url)
|
||||
data = json.loads(result)
|
||||
fTime = time.localtime(int(data['start time']))
|
||||
data['start time'] = time.strftime('%Y-%m-%d %H:%M:%S', fTime)
|
||||
except Exception as e:
|
||||
data = {}
|
||||
|
||||
return mw.getJson(data)
|
||||
|
||||
|
||||
def getDisableFunc(version):
|
||||
|
||||
@@ -13,7 +13,7 @@ rootPath=$(dirname "$rootPath")
|
||||
SERVER_ROOT=$rootPath/lib
|
||||
SOURCE_ROOT=$rootPath/source/lib
|
||||
|
||||
if [ ! -d ${SERVER_ROOT}/libiconv ];then
|
||||
if [ ! -d ${SERVER_ROOT}/zlib ];then
|
||||
|
||||
cd $SOURCE_ROOT
|
||||
if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then
|
||||
|
||||
@@ -11,6 +11,46 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
|
||||
_os=`uname`
|
||||
echo "use system: ${_os}"
|
||||
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rocky'
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||
OSNAME='raspbian'
|
||||
else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
|
||||
if [ "$OSNAME" == 'ubuntu' ] || [ "$OSNAME" == 'debian' ] ;then
|
||||
apt install bison=2.4.1
|
||||
if [ "$?" != "0" ]; then
|
||||
echo 'The system version is too high to install'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apt install flex=2.5.4
|
||||
if [ "$?" != "0" ]; then
|
||||
echo 'The system version is too high to install'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
version=5.2.17
|
||||
PHP_VER=52
|
||||
Install_php()
|
||||
|
||||
@@ -11,6 +11,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
|
||||
version=5.3.29
|
||||
PHP_VER=53
|
||||
Install_php()
|
||||
@@ -34,15 +35,6 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
fi
|
||||
|
||||
|
||||
if [ -f $serverPath/php/53/bin/php.dSYM ];then
|
||||
mv $serverPath/php/53/bin/php.dSYM $serverPath/php/53/bin/php
|
||||
fi
|
||||
|
||||
if [ -f $serverPath/php/53/sbin/php-fpm.dSYM ];then
|
||||
mv $serverPath/php/53/sbin/php-fpm.dSYM $serverPath/php/53/sbin/php-fpm
|
||||
fi
|
||||
|
||||
|
||||
if [ -f $serverPath/php/53/bin/php ];then
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -96,9 +96,12 @@ def initDreplace():
|
||||
|
||||
# config replace
|
||||
dst_conf = getServerDir() + '/redis.conf'
|
||||
conf_content = mw.readFile(getConfTpl())
|
||||
conf_content = conf_content.replace('{$SERVER_PATH}', service_path)
|
||||
mw.writeFile(dst_conf, conf_content)
|
||||
dst_conf_init = getServerDir() + '/init.pl'
|
||||
if not os.path.exists(dst_conf_init):
|
||||
conf_content = mw.readFile(getConfTpl())
|
||||
conf_content = conf_content.replace('{$SERVER_PATH}', service_path)
|
||||
mw.writeFile(dst_conf, conf_content)
|
||||
mw.writeFile(dst_conf_init, 'ok')
|
||||
|
||||
# systemd
|
||||
systemDir = '/lib/systemd/system'
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<p class="bgw" onclick="pluginService('varnish');">服务</p>
|
||||
<p onclick="pluginInitD('varnish');">自启动</p>
|
||||
<p onclick="pluginConfigTpl('varnish');">VCL</p>
|
||||
<p onclick="varnishPluginConfig('varnish','','conf_service');">服务配置</p>
|
||||
<p onclick="pluginLogs('varnish','','run_log');">日志</p>
|
||||
<p onclick="varnishStatus();">状态</p>
|
||||
</div>
|
||||
|
||||
@@ -172,6 +172,10 @@ def initdUinstall():
|
||||
def runLog():
|
||||
return "/var/log/varnish/varnishncsa.log"
|
||||
|
||||
|
||||
def confService():
|
||||
return '/lib/systemd/system/varnish.service'
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
@@ -194,6 +198,8 @@ if __name__ == "__main__":
|
||||
print(runInfo())
|
||||
elif func == 'conf':
|
||||
print(getConf())
|
||||
elif func == 'conf_service':
|
||||
print(confService())
|
||||
elif func == 'run_log':
|
||||
print(runLog())
|
||||
elif func == 'config_tpl':
|
||||
|
||||
@@ -9,7 +9,7 @@ function pRead(){
|
||||
}
|
||||
|
||||
|
||||
//redis负载状态 start
|
||||
//varnish负载状态 start
|
||||
function varnishStatus() {
|
||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||
$.post('/plugins/run', {name:'varnish', func:'run_info'}, function(data) {
|
||||
@@ -41,4 +41,61 @@ function varnishStatus() {
|
||||
$(".soft-man-con").html(Con);
|
||||
},'json');
|
||||
}
|
||||
//redis负载状态 end
|
||||
//varnish负载状态 end
|
||||
|
||||
|
||||
//varnish service ---
|
||||
function varnishPluginConfig(_name, version, func){
|
||||
if ( typeof(version) == 'undefined' ){
|
||||
version = '';
|
||||
}
|
||||
|
||||
var func_name = 'conf';
|
||||
if ( typeof(func) != 'undefined' ){
|
||||
func_name = func;
|
||||
}
|
||||
|
||||
var con = '<p style="color: #666; margin-bottom: 7px">提示:Ctrl+F 搜索关键字,Ctrl+G 查找下一个,Ctrl+S 保存,Ctrl+Shift+R 查找替换!</p>\
|
||||
<textarea class="bt-input-text" style="height: 320px; line-height:18px;" id="textBody"></textarea>\
|
||||
<button id="onlineEditFileBtn" class="btn btn-success btn-sm" style="margin-top:10px;">保存</button>\
|
||||
<ul class="help-info-text c7 ptb15">\
|
||||
<li>此处为'+ _name + version +'主配置文件,若您不了解配置规则,请勿随意修改。</li>\
|
||||
</ul>';
|
||||
$(".soft-man-con").html(con);
|
||||
|
||||
var loadT = layer.msg('配置文件路径获取中...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
$.post('/plugins/run', {name:_name, func:func_name,version:version},function (data) {
|
||||
layer.close(loadT);
|
||||
|
||||
var loadT2 = layer.msg('文件内容获取中...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
var fileName = data.data;
|
||||
$.post('/files/get_body', 'path=' + fileName, function(rdata) {
|
||||
layer.close(loadT2);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
$("#textBody").empty().text(rdata.data.data);
|
||||
$(".CodeMirror").remove();
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("textBody"), {
|
||||
extraKeys: {
|
||||
"Ctrl-Space": "autocomplete",
|
||||
"Ctrl-F": "findPersistent",
|
||||
"Ctrl-H": "replaceAll",
|
||||
"Ctrl-S": function() {
|
||||
$("#textBody").text(editor.getValue());
|
||||
pluginConfigSave(fileName);
|
||||
}
|
||||
},
|
||||
lineNumbers: true,
|
||||
matchBrackets:true,
|
||||
});
|
||||
editor.focus();
|
||||
$(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0});
|
||||
$("#onlineEditFileBtn").click(function(){
|
||||
$("#textBody").text(editor.getValue());
|
||||
pluginConfigSave(fileName);
|
||||
});
|
||||
},'json');
|
||||
},'json');
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,6 +22,6 @@ zmq==0.0.0
|
||||
pymongo
|
||||
pillow
|
||||
Jinja2>=2.11.2
|
||||
mysqlclient>=2.0.3
|
||||
flask-caching>=1.10.1
|
||||
mysql-connector-python
|
||||
mysqlclient>=2.0.3
|
||||
|
||||
@@ -33,7 +33,7 @@ function getSList(isdisplay) {
|
||||
var loadT = layer.msg('正在获取列表...', { icon: 16, time: 0, shade: [0.3, '#000'] })
|
||||
}
|
||||
if (!isdisplay || isdisplay === true)
|
||||
isdisplay = getCookie('p' + getCookie('softType'));
|
||||
isdisplay = getCookie('p' + getCookie('soft_type'));
|
||||
if (isdisplay == true || isdisplay == 'true') isdisplay = 1;
|
||||
|
||||
var search = $("#SearchValue").val();
|
||||
@@ -41,7 +41,7 @@ function getSList(isdisplay) {
|
||||
search = '&search=' + search;
|
||||
}
|
||||
var type = '';
|
||||
var istype = getCookie('softType');
|
||||
var istype = getCookie('soft_type');
|
||||
if (istype == 'undefined' || istype == 'null' || !istype) {
|
||||
istype = '0';
|
||||
}
|
||||
@@ -50,7 +50,7 @@ function getSList(isdisplay) {
|
||||
var page = '';
|
||||
if (isdisplay) {
|
||||
page = '&p=' + isdisplay;
|
||||
setCookie('p' + getCookie('softType'), isdisplay);
|
||||
setCookie('p' + getCookie('soft_type'), isdisplay);
|
||||
}
|
||||
|
||||
var condition = (search + type + page).slice(1);
|
||||
@@ -162,7 +162,7 @@ function getSList(isdisplay) {
|
||||
sBody += pBody;
|
||||
$("#softList").html(sBody);
|
||||
$(".menu-sub span").click(function() {
|
||||
setCookie('softType', $(this).attr('typeid'));
|
||||
setCookie('soft_type', $(this).attr('typeid'));
|
||||
$(this).addClass("on").siblings().removeClass("on");
|
||||
getSList();
|
||||
});
|
||||
|
||||
+29
-5
@@ -175,7 +175,7 @@ case "$1" in
|
||||
|
||||
if [ ! -f $mw_path/data/default.pl ];then
|
||||
echo -e "\033[33mInstall Failed\033[0m"
|
||||
exit 0
|
||||
exit 1
|
||||
fi
|
||||
|
||||
password=$(cat $mw_path/data/default.pl)
|
||||
@@ -185,19 +185,43 @@ case "$1" in
|
||||
if [ -f $mw_path/data/admin_path.pl ];then
|
||||
auth_path=$(cat $mw_path/data/admin_path.pl)
|
||||
fi
|
||||
if [ "$address" = "" ];then
|
||||
address=$(curl -sS --connect-timeout 10 -m 60 https://v6r.ipip.net/?format=text)
|
||||
|
||||
if [ "$address" = "" ];then
|
||||
v4_available=true
|
||||
v6_available=true
|
||||
{
|
||||
v4=$(curl -4 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text)
|
||||
} || {
|
||||
v4_available=false
|
||||
}
|
||||
{
|
||||
v6=$(curl -6 -sS --connect-timeout 5 -m 60 https://v6r.ipip.net/?format=text)
|
||||
} || {
|
||||
v6_available=false
|
||||
}
|
||||
|
||||
if [ $v4_available = true ] && [ $v6_available = true ]; then
|
||||
address="MW-Panel-Url: http://$v4:$port$auth_path \nMW-Panel-Url: http://[$v6]:$port$auth_path"
|
||||
elif [ $v4_available = true ]; then
|
||||
address="MW-Panel-Url: http://$v4:$port$auth_path"
|
||||
elif [ $v6_available = true ]; then
|
||||
address="MW-Panel-Url: http://[$v6]:$port$auth_path"
|
||||
else
|
||||
address="No v4 or v6 available"
|
||||
fi
|
||||
else
|
||||
address="MW-Panel-Url: http://$address:$port$auth_path"
|
||||
fi
|
||||
|
||||
echo -e "=================================================================="
|
||||
echo -e "\033[32mMW-Panel default info!\033[0m"
|
||||
echo -e "=================================================================="
|
||||
echo -e "MW-Panel-URL: http://$address:$port$auth_path"
|
||||
echo -e "$address"
|
||||
echo -e `python3 $mw_path/tools.py username`
|
||||
echo -e "password: $password"
|
||||
echo -e "\033[33mWarning:\033[0m"
|
||||
echo -e "\033[33mIf you cannot access the panel, \033[0m"
|
||||
echo -e "\033[33mrelease the following port (7200|888|80|443|20|21) in the security group\033[0m"
|
||||
echo -e "\033[33mrelease the following port (7200|888|80|443|22) in the security group\033[0m"
|
||||
echo -e "=================================================================="
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -44,6 +44,9 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
apt install -y devscripts
|
||||
apt install -y wget zip unzip
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
|
||||
@@ -26,7 +26,7 @@ if [ -f /etc/init.d/iptables ];then
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||
service iptables save
|
||||
|
||||
@@ -50,7 +50,7 @@ if [ ! -f /etc/init.d/iptables ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ if [ -f /etc/init.d/iptables ];then
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||
service iptables save
|
||||
|
||||
@@ -54,7 +54,7 @@ if [ ! -f /etc/init.d/iptables ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||
|
||||
|
||||
|
||||
@@ -3,12 +3,21 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
LANG=en_US.UTF-8
|
||||
|
||||
# RED='\e[1;31m' # 红色
|
||||
# GREEN='\e[1;32m' # 绿色
|
||||
# YELLOW='\e[1;33m' # 黄色
|
||||
# BLUE='\e[1;34m' # 蓝色
|
||||
# PURPLE='\e[1;35m' # 紫色
|
||||
# CYAN='\e[1;36m' # 蓝绿色
|
||||
# WHITE='\e[1;37m' # 白色
|
||||
# NC='\e[0m' # 没有颜色
|
||||
|
||||
apt update -y
|
||||
|
||||
|
||||
apt install -y wget curl lsof unzip
|
||||
apt install -y python3-pip
|
||||
apt install -y python3-dev
|
||||
apt install -y python3-venv
|
||||
|
||||
apt install -y cron
|
||||
@@ -24,7 +33,7 @@ if [ -f /usr/sbin/ufw ];then
|
||||
ufw allow 443/tcp
|
||||
ufw allow 888/tcp
|
||||
ufw allow 7200/tcp
|
||||
ufw allow 3306/tcp
|
||||
# ufw allow 3306/tcp
|
||||
# ufw allow 30000:40000/tcp
|
||||
|
||||
fi
|
||||
@@ -46,7 +55,7 @@ if [ ! -f /usr/sbin/ufw ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||
|
||||
# fix:debian10 firewalld faq
|
||||
@@ -60,16 +69,47 @@ fi
|
||||
systemctl stop firewalld
|
||||
|
||||
|
||||
#fix zlib1g-dev fail
|
||||
echo -e "\e[0;32mfix zlib1g-dev install question start\e[0m"
|
||||
Install_TmpFile=/tmp/debian-fix-zlib1g-dev.txt
|
||||
apt install -y zlib1g-dev > ${Install_TmpFile}
|
||||
if [ "$?" != "0" ];then
|
||||
ZLIB1G_BASE_VER=$(cat ${Install_TmpFile} | grep zlib1g | awk -F "=" '{print $2}' | awk -F ")" '{print $1}')
|
||||
ZLIB1G_BASE_VER=`echo ${ZLIB1G_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"`
|
||||
# echo "1${ZLIB1G_BASE_VER}1"
|
||||
echo -e "\e[1;31mapt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev\e[0m"
|
||||
echo "Y" | apt install zlib1g=${ZLIB1G_BASE_VER} zlib1g-dev
|
||||
fi
|
||||
rm -rf ${Install_TmpFile}
|
||||
echo -e "\e[0;32mfix zlib1g-dev install question end\e[0m"
|
||||
|
||||
|
||||
#fix libunwind-dev fail
|
||||
echo -e "\e[0;32mfix libunwind-dev install question start\e[0m"
|
||||
Install_TmpFile=/tmp/debian-fix-libunwind-dev.txt
|
||||
apt install -y libunwind-dev > ${Install_TmpFile}
|
||||
if [ "$?" != "0" ];then
|
||||
liblzma5_BASE_VER=$(cat ${Install_TmpFile} | grep liblzma-dev | awk -F "=" '{print $2}' | awk -F ")" '{print $1}')
|
||||
liblzma5_BASE_VER=`echo ${liblzma5_BASE_VER} | sed "s/^[ \s]\{1,\}//g;s/[ \s]\{1,\}$//g"`
|
||||
echo -e "\e[1;31mapt install liblzma5=${liblzma5_BASE_VER} libunwind-dev\e[0m"
|
||||
echo "Y" | apt install liblzma5=${liblzma5_BASE_VER} libunwind-dev
|
||||
fi
|
||||
rm -rf ${Install_TmpFile}
|
||||
echo -e "\e[0;32mfix libunwind-dev install question end\e[0m"
|
||||
|
||||
|
||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||
chmod 755 /www/server/mdserver-web/data
|
||||
|
||||
|
||||
|
||||
if [ ! -f /usr/local/bin/pip3 ];then
|
||||
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
||||
fi
|
||||
|
||||
pip install --upgrade pip
|
||||
pip install --upgrade setuptools
|
||||
|
||||
sed -i "/mysqlclient/d" /www/server/mdserver-web/requirements.txt
|
||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
||||
|
||||
pip3 install gunicorn==20.1.0
|
||||
@@ -77,24 +117,23 @@ pip3 install gevent==21.1.2
|
||||
pip3 install gevent-websocket==0.10.1
|
||||
pip3 install requests==2.20.0
|
||||
pip3 install flask-caching==1.10.1
|
||||
pip3 install flask-socketio==5.2.0
|
||||
pip3 install pymongo
|
||||
pip3 install psutil
|
||||
pip3 install flask-socketio==5.2.0
|
||||
|
||||
if [ ! -f /www/server/mdserver-web/bin/activate ];then
|
||||
cd /www/server/mdserver-web && python3 -m venv .
|
||||
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip3 install -r /www/server/mdserver-web/requirements.txt
|
||||
pip install --upgrade setuptools
|
||||
pip3 install gunicorn==20.1.0
|
||||
pip3 install gevent==21.1.2
|
||||
pip3 install gevent-websocket==0.10.1
|
||||
pip3 install requests==2.20.0
|
||||
pip3 install flask-caching==1.10.1
|
||||
pip3 install flask-socketio==5.2.0
|
||||
pip3 install pymongo
|
||||
pip3 install psutil
|
||||
pip3 install psutil
|
||||
pip3 install flask-socketio==5.2.0
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ if [ -f /etc/init.d/iptables ];then
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||
service iptables save
|
||||
|
||||
@@ -55,7 +55,7 @@ if [ "${isVersion}" == '' ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||
firewall-cmd --reload
|
||||
fi
|
||||
|
||||
@@ -31,7 +31,7 @@ if [ -f /etc/init.d/iptables ];then
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||
service iptables save
|
||||
|
||||
@@ -55,7 +55,7 @@ if [ ! -f /etc/init.d/iptables ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ apt update -y
|
||||
apt install -y wget curl lsof unzip
|
||||
apt install -y python3-pip
|
||||
apt install -y python3-venv
|
||||
apt install -y python3-dev
|
||||
|
||||
|
||||
apt install -y cron
|
||||
|
||||
@@ -24,7 +26,7 @@ if [ -f /usr/sbin/ufw ];then
|
||||
ufw allow 443/tcp
|
||||
ufw allow 888/tcp
|
||||
ufw allow 7200/tcp
|
||||
ufw allow 3306/tcp
|
||||
# ufw allow 3306/tcp
|
||||
# ufw allow 30000:40000/tcp
|
||||
|
||||
fi
|
||||
@@ -44,7 +46,7 @@ if [ ! -f /usr/sbin/ufw ];then
|
||||
firewall-cmd --permanent --zone=public --add-port=443/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||
|
||||
# fix:debian10 firewalld faq
|
||||
|
||||
@@ -44,6 +44,9 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
apt install -y devscripts
|
||||
apt install -y wget zip unzip
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
|
||||
@@ -44,6 +44,8 @@ elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; th
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
apt install -y devscripts
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
|
||||
+6
-3
@@ -295,16 +295,19 @@ elif [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "debian" ]; then
|
||||
apt install -y cmake automake make
|
||||
|
||||
apt install -y webp scons
|
||||
apt install -y lzma lzma-dev libunwind-dev
|
||||
apt install -y lzma lzma-dev
|
||||
apt install -y libunwind-dev
|
||||
|
||||
apt install -y libpcre3 libpcre3-dev
|
||||
apt install -y openssl
|
||||
|
||||
apt install -y libxml2 libxml2-dev libbz2-dev libmcrypt-dev libpspell-dev librecode-dev
|
||||
apt install -y libgmp-dev libgmp3-dev libreadline-dev libxpm-dev
|
||||
apt install -y zlib1g-dev dia pkg-config
|
||||
apt install -y libjpeg62-turbo-dev libjpeg-dev libpng-dev
|
||||
apt install -y dia pkg-config
|
||||
apt install -y zlib1g-dev
|
||||
apt install -y libjpeg-dev libpng-dev
|
||||
apt install -y libfreetype6
|
||||
apt install -y libjpeg62-turbo-dev
|
||||
apt install -y libfreetype6-dev
|
||||
apt install -y libevent-dev libncurses5-dev libldap2-dev
|
||||
|
||||
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
echo "welcome to mdserver-web panel"
|
||||
|
||||
startTime=`date +%s`
|
||||
|
||||
if [ ! -d /www/server/mdserver-web ];then
|
||||
echo "mdserver-web not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# openresty
|
||||
if [ ! -d /www/server/openresty ];then
|
||||
cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1
|
||||
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start
|
||||
else
|
||||
echo "openresty alreay exist!"
|
||||
fi
|
||||
|
||||
|
||||
# php
|
||||
if [ ! -d /www/server/php/71 ];then
|
||||
cd /www/server/mdserver-web/plugins/php && bash install.sh install 71
|
||||
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71
|
||||
else
|
||||
echo "php71 alreay exist!"
|
||||
fi
|
||||
|
||||
# mysql
|
||||
if [ ! -d /www/server/mysql ];then
|
||||
cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5
|
||||
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5
|
||||
else
|
||||
echo "mysql alreay exist!"
|
||||
fi
|
||||
|
||||
endTime=`date +%s`
|
||||
((outTime=(${endTime}-${startTime})/60))
|
||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
echo "welcome to mdserver-web panel"
|
||||
|
||||
startTime=`date +%s`
|
||||
|
||||
if [ ! -d /www/server/mdserver-web ];then
|
||||
echo "mdserver-web not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# openresty
|
||||
if [ ! -d /www/server/openresty ];then
|
||||
cd /www/server/mdserver-web/plugins/openresty && bash install.sh install 1.21.4.1
|
||||
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/openresty/index.py start
|
||||
fi
|
||||
|
||||
|
||||
# php
|
||||
if [ ! -d /www/server/php/71 ];then
|
||||
cd /www/server/mdserver-web/plugins/php && bash install.sh install 71
|
||||
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/php/index.py start 71
|
||||
fi
|
||||
|
||||
# mysql
|
||||
if [ ! -d /www/server/mysql ];then
|
||||
cd /www/server/mdserver-web/plugins/mysql && bash install.sh install 5.5
|
||||
cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql/index.py start 5.5
|
||||
fi
|
||||
|
||||
endTime=`date +%s`
|
||||
((outTime=(${endTime}-${startTime})/60))
|
||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||
|
||||
Reference in New Issue
Block a user