mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 09:09:26 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b71d6b3d7 | ||
|
|
becb7f8c7f | ||
|
|
3da7b57242 | ||
|
|
42e8057356 | ||
|
|
e082baabe8 | ||
|
|
74d565c99a | ||
|
|
750efbf430 | ||
|
|
68112ba978 | ||
|
|
e994375fc8 | ||
|
|
998f677ee7 | ||
|
|
8b1b50938d | ||
|
|
3dbece0b5e | ||
|
|
e9f1e522de | ||
|
|
8a815159c1 | ||
|
|
c8af676d6f | ||
|
|
3bee84a52f | ||
|
|
82828aacf6 | ||
|
|
e4de3cff61 | ||
|
|
4ed7f5d7fd | ||
|
|
7b956c73e4 | ||
|
|
8535dd2306 | ||
|
|
e13df3ae58 | ||
|
|
44fa68f52d | ||
|
|
d72abb1e30 | ||
|
|
aad4343a59 | ||
|
|
6b5717b04f | ||
|
|
655946a467 | ||
|
|
80f3d98162 | ||
|
|
d73be680e2 | ||
|
|
ad9595b3b2 | ||
|
|
8a337fcfd6 | ||
|
|
38b1dba395 | ||
|
|
7195de0418 | ||
|
|
20cb30ba51 | ||
|
|
2a7c96b0f5 | ||
|
|
8503e6ebe9 | ||
|
|
be2c2a2436 | ||
|
|
8a247c93d4 | ||
|
|
b4cdc7fc2d | ||
|
|
cc3f1ed01a | ||
|
|
4db4284362 | ||
|
|
3c2e517c61 | ||
|
|
1d712d1f84 | ||
|
|
f1e1e3c82c | ||
|
|
8e587cf055 | ||
|
|
277b95f74b | ||
|
|
b89b180ee9 | ||
|
|
3e89c35111 | ||
|
|
52f7939b06 | ||
|
|
13d038e855 | ||
|
|
325046d3c2 | ||
|
|
8cb3b578e0 | ||
|
|
3b5a5206fc |
@@ -1,4 +1,10 @@
|
||||
### mdserver-web 0.9.7
|
||||
<p align="center">
|
||||
<img alt="logo" src="https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/logo.png" height="140" />
|
||||
<h3 align="center">mdserver-web</h3>
|
||||
<p align="center">一款简单Linux面板服务</p>
|
||||
</p>
|
||||
|
||||
### 简介
|
||||
|
||||
简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
|
||||
复制了后台管理界面,按照自己想要的方式写了一版。
|
||||
@@ -61,6 +67,15 @@ PHP[53-72]支持phpMyAdmin[4.4.15]
|
||||
PHP[72-81]支持phpMyAdmin[5.2.0]
|
||||
```
|
||||
|
||||
# AD - VPS推荐 - 🙏
|
||||
|
||||
- [ZZZ评测](https://www.zzzvps.com/)
|
||||
|
||||
| 服务商 | LOGO | 推广地址 | 优惠码 |
|
||||
| ------------- |----------|-----------|-------|
|
||||
| digitalvirt |[](https://digitalvirt.com/aff.php?aff=154) | https://digitalvirt.com/aff.php?aff=154 | 9SYDY7UH0U |
|
||||
| 搬瓦工 |[](https://bandwagonhost.com/aff.php?aff=54161) | https://bandwagonhost.com/aff.php?aff=54161 | BWH3HYATVBJW |
|
||||
|
||||
# Docker
|
||||
|
||||
- 由[DDSRem](https://github.com/DDSRem)开发维护。
|
||||
@@ -71,10 +86,19 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.9.7
|
||||
### 版本更新 0.9.9
|
||||
|
||||
* 更换Logo。
|
||||
* 增加amazon linux系统支持。
|
||||
* 修复rsyncd在debian或ubuntu下安装失败问题。
|
||||
* Readme加入一AD。
|
||||
* PHP-YUM|PHP-APT优化[性能调整]。
|
||||
* 优化Gogs使用MySQL的方式。
|
||||
* 配置模板添加一个whmcs。
|
||||
* MySQL和MariaDB无法直接卸载。
|
||||
* OpenResty加入http_realip_module模块。
|
||||
* PHP加入igbinary扩展。
|
||||
|
||||
* haproxy插件添加.
|
||||
* 细节优化.
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
@@ -120,9 +144,19 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/qu
|
||||
```
|
||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh | bash
|
||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
|
||||
|
||||
|
||||
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install_dev.sh | bash
|
||||
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_dev.sh | bash
|
||||
```
|
||||
|
||||
### 捐赠地址 USDT(TRC20)
|
||||
|
||||
TVbNgrpeGBGZVm5gTLa21ADP7RpnPFhjya
|
||||
|
||||
|
||||
### 微信赞助
|
||||
|
||||
[](https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/img/weixin_zz.jpg)
|
||||
|
||||
|
||||
@@ -138,7 +172,7 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/up
|
||||
|
||||
### 感谢开发赞助
|
||||
|
||||
[](https://digitalvirt.com/)
|
||||
[](https://digitalvirt.com/aff.php?aff=154)
|
||||
|
||||
### 授权许可
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
__version = '0.9.7'
|
||||
__version = '0.9.9'
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@@ -497,7 +497,7 @@ class site_api:
|
||||
certName = request.form.get('certName', '')
|
||||
siteName = request.form.get('siteName', '')
|
||||
try:
|
||||
path = self.sslDir + siteName
|
||||
path = self.sslDir + siteName.strip()
|
||||
if not os.path.exists(path):
|
||||
return mw.returnJson(False, '证书不存在!')
|
||||
|
||||
|
||||
@@ -68,6 +68,9 @@ class ORM:
|
||||
def setPort(self, port):
|
||||
self.__DB_PORT = port
|
||||
|
||||
def setUser(self, user):
|
||||
self.__DB_USER = user
|
||||
|
||||
def setPwd(self, pwd):
|
||||
self.__DB_PASS = pwd
|
||||
|
||||
|
||||
@@ -77,6 +77,12 @@ class ORM:
|
||||
def getPwd(self):
|
||||
return self.__DB_PASS
|
||||
|
||||
def setDbName(self, name):
|
||||
self.__DB_NAME = name
|
||||
|
||||
def setUser(self, user):
|
||||
self.__DB_USER = user
|
||||
|
||||
def execute(self, sql):
|
||||
# 执行SQL语句返回受影响行
|
||||
if not self.__Conn():
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
|
||||
# sys.path.append("/usr/local/lib/python3.6/site-packages")
|
||||
|
||||
|
||||
class mysqlDb:
|
||||
__DB_PASS = None
|
||||
__DB_USER = 'root'
|
||||
__DB_PORT = 3306
|
||||
__DB_HOST = 'localhost'
|
||||
__DB_NAME = 'test'
|
||||
__DB_CONN = None
|
||||
__DB_CUR = None
|
||||
__DB_ERR = None
|
||||
__DB_CNF = '/etc/my.cnf'
|
||||
|
||||
def __Conn(self):
|
||||
'''连接MYSQL数据库'''
|
||||
try:
|
||||
socket = '/www/server/mysql/mysql.sock'
|
||||
try:
|
||||
import MySQLdb
|
||||
except Exception as ex:
|
||||
self.__DB_ERR = ex
|
||||
return False
|
||||
try:
|
||||
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
|
||||
port=self.__DB_PORT, db=self.__DB_NAME, charset="utf8", connect_timeout=10, unix_socket=socket)
|
||||
except MySQLdb.Error as e:
|
||||
self.__DB_HOST = '127.0.0.1'
|
||||
self.__DB_CONN = MySQLdb.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
|
||||
port=self.__DB_PORT, db=self.__DB_NAME, charset="utf8", connect_timeout=10, unix_socket=socket)
|
||||
self.__DB_CUR = self.__DB_CONN.cursor()
|
||||
return True
|
||||
|
||||
except MySQLdb.Error as e:
|
||||
self.__DB_ERR = e
|
||||
return False
|
||||
|
||||
def setHost(self, host):
|
||||
self.__DB_HOST = host
|
||||
|
||||
def setPwd(self, pwd):
|
||||
self.__DB_PASS = pwd
|
||||
|
||||
def setUser(self, user):
|
||||
self.__DB_USER = user
|
||||
|
||||
def setPort(self, port):
|
||||
self.__DB_PORT = port
|
||||
|
||||
def setDb(self, name):
|
||||
self.__DB_NAME = name
|
||||
|
||||
def getPwd(self):
|
||||
return self.__DB_PASS
|
||||
|
||||
def execute(self, sql):
|
||||
# 执行SQL语句返回受影响行
|
||||
if not self.__Conn():
|
||||
return self.__DB_ERR
|
||||
try:
|
||||
result = self.__DB_CUR.execute(sql)
|
||||
self.__DB_CONN.commit()
|
||||
self.__Close()
|
||||
return result
|
||||
except Exception as ex:
|
||||
return ex
|
||||
|
||||
def query(self, sql):
|
||||
# 执行SQL语句返回数据集
|
||||
if not self.__Conn():
|
||||
return self.__DB_ERR
|
||||
try:
|
||||
self.__DB_CUR.execute(sql)
|
||||
result = self.__DB_CUR.fetchall()
|
||||
# 将元组转换成列表
|
||||
# data = map(list, result)
|
||||
self.__Close()
|
||||
return result
|
||||
except Exception as ex:
|
||||
return "error: " + str(ex)
|
||||
|
||||
# 关闭连接
|
||||
def __Close(self):
|
||||
self.__DB_CUR.close()
|
||||
self.__DB_CONN.close()
|
||||
+12
-12
@@ -31,9 +31,6 @@ def getPluginName():
|
||||
def getPluginDir():
|
||||
return mw.getPluginDir() + '/' + getPluginName()
|
||||
|
||||
sys.path.append(getPluginDir() + "/class")
|
||||
import mysqlDb
|
||||
|
||||
|
||||
def getServerDir():
|
||||
return mw.getServerDir() + '/' + getPluginName()
|
||||
@@ -235,16 +232,19 @@ def getDbConfValue():
|
||||
|
||||
|
||||
def pMysqlDb(conf):
|
||||
|
||||
host = conf['HOST'].split(':')
|
||||
conn = mysqlDb.mysqlDb()
|
||||
# pymysql
|
||||
db = mw.getMyORM()
|
||||
# MySQLdb |
|
||||
# db = mw.getMyORMDb()
|
||||
|
||||
conn.setHost(host[0])
|
||||
conn.setUser(conf['USER'])
|
||||
conn.setPwd(conf['PASSWD'])
|
||||
conn.setPort(int(host[1]))
|
||||
conn.setDb(conf['NAME'])
|
||||
return conn
|
||||
db.setPort(int(host[1]))
|
||||
db.setUser(conf['USER'])
|
||||
db.setPwd(conf['PASSWD'])
|
||||
db.setDbName(conf['NAME'])
|
||||
# db.setSocket(getSocketFile())
|
||||
db.setCharset("utf8")
|
||||
return db
|
||||
|
||||
|
||||
def pSqliteDb(conf):
|
||||
@@ -476,7 +476,7 @@ def userList():
|
||||
|
||||
start = (page - 1) * page_size
|
||||
list_count = pQuery('select count(id) as num from user')
|
||||
count = list_count[0][0]
|
||||
count = list_count[0]["num"]
|
||||
list_data = pQuery(
|
||||
'select id,name,email from user order by id desc limit ' + str(start) + ',' + str(page_size))
|
||||
data['list'] = mw.getPage({'count': count, 'p': page,
|
||||
|
||||
@@ -29,6 +29,8 @@ getBit(){
|
||||
|
||||
Install_gogs()
|
||||
{
|
||||
pip3 install mysqlclient
|
||||
|
||||
mkdir -p $serverPath/source/gogs
|
||||
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
@@ -163,11 +163,11 @@ function gogsUserList(page, search) {
|
||||
|
||||
ulist = rdata['data']['data'];
|
||||
for (i in ulist){
|
||||
email = ulist[i][2] == '' ? '无' : ulist[i][2];
|
||||
content += '<tr><td>'+ulist[i][0]+'</td>'+
|
||||
'<td>'+ulist[i][1]+'</td>'+
|
||||
email = ulist[i]["email"] == '' ? '无' : ulist[i]["email"];
|
||||
content += '<tr><td>'+ulist[i]["id"]+'</td>'+
|
||||
'<td>'+ulist[i]["name"]+'</td>'+
|
||||
'<td>'+email+'</td>'+
|
||||
'<td><a class="btlink" onclick="userProjectList(\''+ulist[i][1]+'\')">项目管理</a></td>'+
|
||||
'<td><a class="btlink" onclick="userProjectList(\''+ulist[i]["name"]+'\')">项目管理</a></td>'+
|
||||
'</tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -2180,8 +2180,11 @@ def installPreInspection(version):
|
||||
|
||||
|
||||
def uninstallPreInspection(version):
|
||||
# return "请手动删除MySQL[{}]".format(version)
|
||||
return 'ok'
|
||||
stop(version)
|
||||
if mw.isDebugMode():
|
||||
return 'ok'
|
||||
|
||||
return "请手动删除MariaDB[{}]<br/> rm -rf {}".format(version, getServerDir())
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
|
||||
@@ -2338,8 +2338,11 @@ def installPreInspection(version):
|
||||
|
||||
|
||||
def uninstallPreInspection(version):
|
||||
# return "请手动删除MySQL[{}]".format(version)
|
||||
return 'ok'
|
||||
stop(version)
|
||||
if mw.isDebugMode():
|
||||
return 'ok'
|
||||
|
||||
return "请手动删除MySQL[{}]<br/> rm -rf {}".format(version, getServerDir())
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
|
||||
@@ -59,10 +59,12 @@ Install_openresty()
|
||||
# --with-openssl=$serverPath/source/lib/openssl-1.0.2q
|
||||
cd ${openrestyDir}/openresty-${VERSION} && ./configure \
|
||||
--prefix=$serverPath/openresty \
|
||||
--with-ipv6 \
|
||||
--with-http_v2_module \
|
||||
--with-http_ssl_module \
|
||||
--with-http_slice_module \
|
||||
--with-http_stub_status_module
|
||||
--with-http_stub_status_module \
|
||||
--with-http_realip_module
|
||||
|
||||
make -j${cpuCore} && make install && make clean
|
||||
|
||||
|
||||
@@ -417,8 +417,8 @@ def setFpmConfig(version):
|
||||
max_spare_servers = args['max_spare_servers']
|
||||
pm = args['pm']
|
||||
|
||||
file = getServerDir() + '/php' + version + '/php-fpm.d/www.conf'
|
||||
conf = mw.readFile(file)
|
||||
filefpm = getFpmConfFile(version)
|
||||
conf = mw.readFile(filefpm)
|
||||
|
||||
rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*"
|
||||
conf = re.sub(rep, "\npm.max_children = " + max_children, conf)
|
||||
@@ -437,7 +437,7 @@ def setFpmConfig(version):
|
||||
rep = "\s*pm\s*=\s*(\w+)\s*"
|
||||
conf = re.sub(rep, "\npm = " + pm + "\n", conf)
|
||||
|
||||
mw.writeFile(file, conf)
|
||||
mw.writeFile(filefpm, conf)
|
||||
reload(version)
|
||||
|
||||
msg = mw.getInfo('设置PHP-{1}并发设置,max_children={2},start_servers={3},min_spare_servers={4},max_spare_servers={5}',
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
{
|
||||
"name": "pdo",
|
||||
"versions": [
|
||||
"56",
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
@@ -16,6 +21,11 @@
|
||||
"name": "mysqlnd",
|
||||
"versions": [
|
||||
"56",
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
@@ -29,6 +39,11 @@
|
||||
"name": "sqlite3",
|
||||
"versions": [
|
||||
"56",
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
@@ -50,6 +65,11 @@
|
||||
"name": "odbc",
|
||||
"versions": [
|
||||
"56",
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
|
||||
@@ -412,15 +412,15 @@ def setFpmConfig(version):
|
||||
# if not 'max' in args:
|
||||
# return 'missing time args!'
|
||||
|
||||
version = args['version']
|
||||
max_children = args['max_children']
|
||||
start_servers = args['start_servers']
|
||||
min_spare_servers = args['min_spare_servers']
|
||||
max_spare_servers = args['max_spare_servers']
|
||||
pm = args['pm']
|
||||
|
||||
file = getServerDir() + '/php' + version + '/php-fpm.d/www.conf'
|
||||
conf = mw.readFile(file)
|
||||
# file = getServerDir() + '/php' + version + '/php-fpm.d/www.conf'
|
||||
filefpm = getFpmConfFile(version)
|
||||
conf = mw.readFile(filefpm)
|
||||
|
||||
rep = "\s*pm.max_children\s*=\s*([0-9]+)\s*"
|
||||
conf = re.sub(rep, "\npm.max_children = " + max_children, conf)
|
||||
@@ -439,7 +439,7 @@ def setFpmConfig(version):
|
||||
rep = "\s*pm\s*=\s*(\w+)\s*"
|
||||
conf = re.sub(rep, "\npm = " + pm + "\n", conf)
|
||||
|
||||
mw.writeFile(file, conf)
|
||||
mw.writeFile(filefpm, conf)
|
||||
reload(version)
|
||||
|
||||
msg = mw.getInfo('设置PHP-{1}并发设置,max_children={2},start_servers={3},min_spare_servers={4},max_spare_servers={5}', (version, max_children,
|
||||
|
||||
@@ -140,6 +140,26 @@
|
||||
"shell": "fileinfo.sh",
|
||||
"check": "fileinfo"
|
||||
},
|
||||
{
|
||||
"name": "simplexml",
|
||||
"versions": [
|
||||
"53",
|
||||
"54",
|
||||
"55",
|
||||
"56",
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "用于XML!",
|
||||
"shell": "simplexml.sh",
|
||||
"check": "simplexml"
|
||||
},
|
||||
{
|
||||
"name": "exif",
|
||||
"versions": [
|
||||
|
||||
Executable
+109
@@ -0,0 +1,109 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source/php
|
||||
|
||||
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
LIBNAME=igbinary
|
||||
LIBV=3.2.7
|
||||
|
||||
if [ "$version" -lt "70" ];then
|
||||
echo "not need"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LIB_PATH_NAME=lib/php
|
||||
if [ -d $serverPath/php/${version}/lib64 ];then
|
||||
LIB_PATH_NAME=lib64
|
||||
fi
|
||||
|
||||
NON_ZTS_FILENAME=`ls $serverPath/php/${version}/${LIB_PATH_NAME}/extensions | grep no-debug-non-zts`
|
||||
extFile=$serverPath/php/${version}/${LIB_PATH_NAME}/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so
|
||||
|
||||
sysName=`uname`
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
BAK='_bak'
|
||||
else
|
||||
BAK=''
|
||||
fi
|
||||
|
||||
Install_lib()
|
||||
{
|
||||
|
||||
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
|
||||
if [ "${isInstall}" != "" ];then
|
||||
echo "php-$version 已安装${LIBNAME},请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
php_lib=$sourcePath/php_lib
|
||||
mkdir -p $php_lib
|
||||
if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then
|
||||
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
|
||||
cd $php_lib
|
||||
tar xvf ${LIBNAME}-${LIBV}.tgz
|
||||
fi
|
||||
cd $php_lib/${LIBNAME}-${LIBV}
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make clean && make && make install && make clean
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return;
|
||||
fi
|
||||
|
||||
echo "" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
bash ${rootPath}/plugins/php/versions/lib.sh $version restart
|
||||
echo '==========================================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
Uninstall_lib()
|
||||
{
|
||||
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
|
||||
echo "php-$version 未安装,请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php-$version 未安装${LIBNAME},请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
echo $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}.use_namespace/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/\[${LIBNAME}\]/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
bash ${rootPath}/plugins/php/versions/lib.sh $version restart
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source/php
|
||||
|
||||
LIBNAME=memcached
|
||||
LIBV=3.2.0
|
||||
LIBV=3.1.5
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
@@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source/php
|
||||
|
||||
LIBNAME=xhprof
|
||||
LIBV=2.3.5
|
||||
LIBV=2.3.7
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
@@ -202,6 +202,23 @@
|
||||
"shell": "exif.sh",
|
||||
"check": "exif.so"
|
||||
},
|
||||
{
|
||||
"name": "igbinary",
|
||||
"versions": [
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "序列化扩展!",
|
||||
"shell": "igbinary.sh",
|
||||
"check": "igbinary.so"
|
||||
},
|
||||
{
|
||||
"name": "gd",
|
||||
"versions": [
|
||||
|
||||
@@ -23,7 +23,7 @@ Install_rsyncd()
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
|
||||
if [ "$OSNAME" == "debian'" ] || [ "$OSNAME" == "ubuntu'" ];then
|
||||
if [ "$OSNAME" == "debian" ] || [ "$OSNAME" == "ubuntu" ];then
|
||||
apt install -y rsync
|
||||
apt install -y lsyncd
|
||||
elif [[ "$OSNAME" == "arch" ]]; then
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
location / {
|
||||
|
||||
# https://www.cloudflare.com/zh-cn/ips/
|
||||
set_real_ip_from 103.21.244.0/22;
|
||||
set_real_ip_from 103.22.200.0/22;
|
||||
set_real_ip_from 103.31.4.0/22;
|
||||
set_real_ip_from 104.16.0.0/13;
|
||||
set_real_ip_from 104.24.0.0/14;
|
||||
set_real_ip_from 108.162.192.0/18;
|
||||
set_real_ip_from 131.0.72.0/22;
|
||||
set_real_ip_from 141.101.64.0/18;
|
||||
set_real_ip_from 162.158.0.0/15;
|
||||
set_real_ip_from 172.64.0.0/13;
|
||||
set_real_ip_from 173.245.48.0/20;
|
||||
set_real_ip_from 188.114.96.0/20;
|
||||
set_real_ip_from 190.93.240.0/20;
|
||||
set_real_ip_from 197.234.240.0/22;
|
||||
set_real_ip_from 198.41.128.0/17;
|
||||
set_real_ip_from 2400:cb00::/32;
|
||||
set_real_ip_from 2606:4700::/32;
|
||||
set_real_ip_from 2803:f800::/32;
|
||||
set_real_ip_from 2405:b500::/32;
|
||||
set_real_ip_from 2405:8100::/32;
|
||||
set_real_ip_from 2c0f:f248::/32;
|
||||
set_real_ip_from 2a06:98c0::/29;
|
||||
# use any of the following two
|
||||
real_ip_header CF-Connecting-IP;
|
||||
#real_ip_header X-Forwarded-For;
|
||||
|
||||
|
||||
index index.html index.php;
|
||||
if (-f $request_filename/index.html){
|
||||
rewrite (.*) $1/index.html break;
|
||||
}
|
||||
if (-f $request_filename/index.php){
|
||||
rewrite (.*) $1/index.php;
|
||||
}
|
||||
if (!-f $request_filename){
|
||||
rewrite (.*) /index.php;
|
||||
}
|
||||
}
|
||||
|
||||
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||||
+30
-31
@@ -1,34 +1,33 @@
|
||||
location / {
|
||||
if (!-e $request_filename)
|
||||
{
|
||||
rewrite "^/index\.html" /index.php last;
|
||||
rewrite "^/category$" /index.php last;
|
||||
rewrite "^/feed-c([0-9]+)\.xml$" /feed.php?cat=$1 last;
|
||||
rewrite "^/feed-b([0-9]+)\.xml$" /feed.php?brand=$1 last;
|
||||
rewrite "^/feed\.xml$" /feed.php last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2 last;
|
||||
rewrite "^/category-([0-9]+)(.*)\.html$" /category.php?id=$1 last;
|
||||
rewrite "^/goods-([0-9]+)(.*)\.html" /goods.php?id=$1 last;
|
||||
rewrite "^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;
|
||||
rewrite "^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$" /article_cat.php?id=$1&page=$2 last;
|
||||
rewrite "^/article_cat-([0-9]+)(.*)\.html$" /article_cat.php?id=$1 last;
|
||||
rewrite "^/article-([0-9]+)(.*)\.html$" /article.php?id=$1 last;
|
||||
rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html" /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;
|
||||
rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2&page=$3 last;
|
||||
rewrite "^/brand-([0-9]+)-c([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2 last;
|
||||
rewrite "^/brand-([0-9]+)(.*)\.html" /brand.php?id=$1 last;
|
||||
rewrite "^/tag-(.*)\.html" /search.php?keywords=$1 last;
|
||||
rewrite "^/snatch-([0-9]+)\.html$" /snatch.php?id=$1 last;
|
||||
rewrite "^/group_buy-([0-9]+)\.html$" /group_buy.php?act=view&id=$1 last;
|
||||
rewrite "^/auction-([0-9]+)\.html$" /auction.php?act=view&id=$1 last;
|
||||
rewrite "^/exchange-id([0-9]+)(.*)\.html$" /exchange.php?id=$1&act=view last;
|
||||
rewrite "^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;
|
||||
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;
|
||||
rewrite "^/exchange-([0-9]+)-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2 last;
|
||||
rewrite "^/exchange-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1 last;
|
||||
if (!-e $request_filename) {
|
||||
rewrite "^/index\.html" /index.php last;
|
||||
rewrite "^/category$" /index.php last;
|
||||
rewrite "^/feed-c([0-9]+)\.xml$" /feed.php?cat=$1 last;
|
||||
rewrite "^/feed-b([0-9]+)\.xml$" /feed.php?brand=$1 last;
|
||||
rewrite "^/feed\.xml$" /feed.php last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3 last;
|
||||
rewrite "^/category-([0-9]+)-b([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2 last;
|
||||
rewrite "^/category-([0-9]+)(.*)\.html$" /category.php?id=$1 last;
|
||||
rewrite "^/goods-([0-9]+)(.*)\.html" /goods.php?id=$1 last;
|
||||
rewrite "^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;
|
||||
rewrite "^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$" /article_cat.php?id=$1&page=$2 last;
|
||||
rewrite "^/article_cat-([0-9]+)(.*)\.html$" /article_cat.php?id=$1 last;
|
||||
rewrite "^/article-([0-9]+)(.*)\.html$" /article.php?id=$1 last;
|
||||
rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html" /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;
|
||||
rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2&page=$3 last;
|
||||
rewrite "^/brand-([0-9]+)-c([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2 last;
|
||||
rewrite "^/brand-([0-9]+)(.*)\.html" /brand.php?id=$1 last;
|
||||
rewrite "^/tag-(.*)\.html" /search.php?keywords=$1 last;
|
||||
rewrite "^/snatch-([0-9]+)\.html$" /snatch.php?id=$1 last;
|
||||
rewrite "^/group_buy-([0-9]+)\.html$" /group_buy.php?act=view&id=$1 last;
|
||||
rewrite "^/auction-([0-9]+)\.html$" /auction.php?act=view&id=$1 last;
|
||||
rewrite "^/exchange-id([0-9]+)(.*)\.html$" /exchange.php?id=$1&act=view last;
|
||||
rewrite "^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;
|
||||
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;
|
||||
rewrite "^/exchange-([0-9]+)-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2 last;
|
||||
rewrite "^/exchange-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1 last;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
location /{
|
||||
location / {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /index.php/$1 last;
|
||||
break;
|
||||
|
||||
@@ -3,3 +3,11 @@ location / {
|
||||
rewrite ^(.*)$ /index.php$1 last;
|
||||
}
|
||||
}
|
||||
|
||||
# 不需要,可以删除
|
||||
location /typecho/ {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /typecho/index.php$1 last;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
location /typecho/ {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /typecho/index.php$1 last;
|
||||
}
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
location / {
|
||||
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^/contact/$ /./contact.php last;
|
||||
rewrite ^/status$ /./pages.php?cate=$1&page=status last;
|
||||
rewrite ^/act$ /./pages.php?cate=$1&page=actindex last;
|
||||
rewrite ^/(\w+)/(\w+)/$ /./pages.php?cate=$1&page=$2 last;
|
||||
rewrite ^/cart/(\w+)$ /./cart.php?a=$1 last;
|
||||
rewrite ^/console$ /./clientarea.php last;
|
||||
rewrite ^/sitemap.xml$ /./sitemap.php last;
|
||||
rewrite ^/console/(\w+)$ /./clientarea.php?action=services&group=$1 last;
|
||||
rewrite ^/console/ec/([0-9]+)$ /./clientarea.php?action=productdetails&id=$1 last;
|
||||
rewrite ^/console/ec/(\w+)$ /./clientarea.php?action=services&group=ec&page=$1 last;
|
||||
rewrite ^ /index.php last;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
location / {
|
||||
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
|
||||
if (!-e $request_filename){
|
||||
rewrite ^.+?(/wp-.*) $1 last;
|
||||
rewrite ^.+?(/.*\.php)$ $1 last;
|
||||
rewrite ^ /index.php last;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
@@ -38,6 +38,9 @@ elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
|
||||
Executable
+166
@@ -0,0 +1,166 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
LANG=en_US.UTF-8
|
||||
|
||||
if [ ! -f /usr/bin/applydeltarpm ];then
|
||||
yum -y provides '*/applydeltarpm'
|
||||
yum -y install deltarpm
|
||||
fi
|
||||
|
||||
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
|
||||
setenforce 0
|
||||
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
||||
|
||||
yum install -y wget lsof crontabs
|
||||
yum install -y python3-devel
|
||||
yum install -y python3-pip
|
||||
yum install -y python-devel
|
||||
yum install -y curl-devel libmcrypt libmcrypt-devel
|
||||
yum install -y mysql-devel
|
||||
yum install -y expect
|
||||
|
||||
|
||||
|
||||
#https need
|
||||
if [ ! -d /root/.acme.sh ];then
|
||||
curl https://get.acme.sh | sh
|
||||
fi
|
||||
|
||||
if [ -f /etc/init.d/iptables ];then
|
||||
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
|
||||
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 30000:40000 -j ACCEPT
|
||||
service iptables save
|
||||
|
||||
iptables_status=`service iptables status | grep 'not running'`
|
||||
if [ "${iptables_status}" == '' ];then
|
||||
service iptables restart
|
||||
fi
|
||||
|
||||
#安装时不开启
|
||||
service iptables stop
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f /etc/init.d/iptables ];then
|
||||
yum install firewalld -y
|
||||
systemctl enable firewalld
|
||||
#取消服务锁定
|
||||
systemctl unmask firewalld
|
||||
systemctl start firewalld
|
||||
|
||||
firewall-cmd --permanent --zone=public --add-port=22/tcp
|
||||
firewall-cmd --permanent --zone=public --add-port=80/tcp
|
||||
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=30000-40000/tcp
|
||||
|
||||
|
||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||
firewall-cmd --reload
|
||||
#安装时不开启
|
||||
systemctl stop firewalld
|
||||
fi
|
||||
|
||||
yum groupinstall -y "Development Tools"
|
||||
yum install -y epel-release
|
||||
|
||||
yum install -y oniguruma oniguruma-devel
|
||||
#centos8 stream | use dnf
|
||||
if [ "$?" != "0" ];then
|
||||
yum install -y dnf dnf-plugins-core
|
||||
dnf config-manager --set-enabled powertools
|
||||
yum install -y oniguruma oniguruma-devel
|
||||
dnf upgrade -y libmodulemd
|
||||
fi
|
||||
|
||||
|
||||
yum install -y libtirpc libtirpc-devel
|
||||
yum install -y rpcgen
|
||||
yum install -y openldap openldap-devel
|
||||
yum install -y bison re2c
|
||||
yum install -y cmake3
|
||||
yum install -y autoconf
|
||||
yum install -y make cmake gcc gcc-c++
|
||||
|
||||
yum install -y libmemcached libmemcached-devel
|
||||
yum install -y curl curl-devel
|
||||
yum install -y zlib zlib-devel
|
||||
yum install -y libzip libzip-devel
|
||||
yum install -y pcre pcre-devel
|
||||
yum install -y icu libicu-devel
|
||||
yum install -y freetype freetype-devel
|
||||
yum install -y openssl openssl-devel
|
||||
yum install -y graphviz libxml2 libxml2-devel
|
||||
yum install -y sqlite-devel
|
||||
yum install -y oniguruma oniguruma-devel
|
||||
yum install -y ImageMagick ImageMagick-devel
|
||||
|
||||
|
||||
yum install -y libzstd-devel
|
||||
yum install -y libevent libevent-devel unzip zip
|
||||
yum install -y python-imaging libicu-devel bzip2-devel pcre pcre-devel
|
||||
|
||||
yum install -y gd gd-devel
|
||||
yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel
|
||||
|
||||
yum install -y net-tools
|
||||
yum install -y ncurses-devel
|
||||
|
||||
|
||||
for yumPack in flex file libtool libtool-libs kernel-devel patch wget glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel libcap diffutils ca-certificates net-tools psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper expat-devel readline-devel;
|
||||
do yum -y install $yumPack;done
|
||||
|
||||
|
||||
if [ "$VERSION_ID" -eq "8" ];then
|
||||
dnf upgrade -y libmodulemd
|
||||
fi
|
||||
|
||||
if [ "$VERSION_ID" -eq "9" ];then
|
||||
yum install -y patchelf
|
||||
dnf --enablerepo=crb install -y libtirpc-devel
|
||||
dnf --enablerepo=crb install -y libmemcached libmemcached-devel
|
||||
dnf --enablerepo=crb install -y libtool libtool-libs
|
||||
dnf --enablerepo=crb install -y gnutls-devel
|
||||
dnf --enablerepo=crb install -y mysql-devel
|
||||
|
||||
dnf --enablerepo=crb install -y libvpx-devel libXpm-devel libwebp libwebp-devel
|
||||
dnf --enablerepo=crb install -y oniguruma oniguruma-devel
|
||||
dnf --enablerepo=crb install -y libzip libzip-devel
|
||||
# yum remove -y chardet
|
||||
fi
|
||||
|
||||
|
||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||
chmod 755 /www/server/mdserver-web/data
|
||||
|
||||
|
||||
cd /www/server/mdserver-web && ./cli.sh start
|
||||
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
|
||||
n=0
|
||||
while [[ ! -f /etc/init.d/mw ]];
|
||||
do
|
||||
echo -e ".\c"
|
||||
sleep 1
|
||||
let n+=1
|
||||
if [ $n -gt 20 ];then
|
||||
echo -e "start mw fail"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
cd /www/server/mdserver-web && /etc/init.d/mw stop
|
||||
cd /www/server/mdserver-web && /etc/init.d/mw start
|
||||
cd /www/server/mdserver-web && /etc/init.d/mw default
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,6 @@ yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel
|
||||
|
||||
yum install -y net-tools
|
||||
yum install -y ncurses-devel
|
||||
yum install -y vixie-cron
|
||||
|
||||
|
||||
for yumPack in flex file libtool libtool-libs kernel-devel patch wget glib2 glib2-devel tar bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel libidn libidn-devel vim-minimal gettext gettext-devel ncurses-devel gmp-devel libcap diffutils ca-certificates net-tools psmisc libXpm-devel git-core c-ares-devel libicu-devel libxslt libxslt-devel zip unzip glibc.i686 libstdc++.so.6 cairo-devel ncurses-devel libaio-devel perl perl-devel perl-Data-Dumper expat-devel readline-devel;
|
||||
|
||||
@@ -19,7 +19,6 @@ if [ "$EUID" -ne 0 ]
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
@@ -27,10 +26,6 @@ elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
zypper refresh
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
pkg install -y wget unzip
|
||||
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
|
||||
OSNAME='arch'
|
||||
echo y | pacman -Sy unzip
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
yum install -y wget zip unzip
|
||||
@@ -43,6 +38,9 @@ elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
|
||||
@@ -34,6 +34,9 @@ elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt install -y wget zip unzip
|
||||
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
LANG=en_US.UTF-8
|
||||
|
||||
|
||||
if [ -f /etc/motd ];then
|
||||
echo "welcome to mdserver-web panel" > /etc/motd
|
||||
fi
|
||||
|
||||
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
||||
|
||||
yum install -y curl-devel libmcrypt libmcrypt-devel python3-devel
|
||||
|
||||
|
||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||
chmod 755 /www/server/mdserver-web/data
|
||||
|
||||
|
||||
if [ -f /etc/init.d/mw ]; then
|
||||
sh /etc/init.d/mw stop && rm -rf /www/server/mdserver-web/scripts/init.d/mw && rm -rf /etc/init.d/mw
|
||||
fi
|
||||
|
||||
echo -e "stop mw"
|
||||
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
|
||||
|
||||
port=7200
|
||||
if [ -f /www/server/mdserver-web/data/port.pl ]; then
|
||||
port=$(cat /www/server/mdserver-web/data/port.pl)
|
||||
fi
|
||||
|
||||
n=0
|
||||
while [[ "$isStart" != "" ]];
|
||||
do
|
||||
echo -e ".\c"
|
||||
sleep 0.5
|
||||
isStart=$(lsof -n -P -i:$port|grep LISTEN|grep -v grep|awk '{print $2}'|xargs)
|
||||
let n+=1
|
||||
if [ $n -gt 15 ];then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
echo -e "start mw"
|
||||
cd /www/server/mdserver-web && sh cli.sh start
|
||||
isStart=`ps -ef|grep 'gunicorn -c setting.py app:app' |grep -v grep|awk '{print $2}'`
|
||||
n=0
|
||||
while [[ ! -f /etc/init.d/mw ]];
|
||||
do
|
||||
echo -e ".\c"
|
||||
sleep 0.5
|
||||
let n+=1
|
||||
if [ $n -gt 15 ];then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
echo -e "start mw success"
|
||||
|
||||
bash /etc/init.d/mw default
|
||||
+11
-3
@@ -22,8 +22,6 @@ elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
zypper refresh
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
elif grep -Eqi "Arch" /etc/issue || grep -Eq "Arch" /etc/*-release; then
|
||||
OSNAME='arch'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
yum install -y wget zip unzip
|
||||
@@ -36,6 +34,9 @@ elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Amazon Linux" /etc/issue || grep -Eq "Amazon Linux" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt install -y wget zip unzip
|
||||
@@ -48,7 +49,14 @@ else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
|
||||
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
|
||||
if [ ! -z "$cn" ];then
|
||||
wget -O /tmp/dev.zip https://gitee.com/midoks/mdserver-web/repository/archive/dev.zip
|
||||
else
|
||||
wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
|
||||
fi
|
||||
|
||||
# wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
|
||||
cd /tmp && unzip /tmp/dev.zip
|
||||
cp -rf /tmp/mdserver-web-dev/* /www/server/mdserver-web
|
||||
rm -rf /tmp/dev.zip
|
||||
|
||||
Reference in New Issue
Block a user