mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-11 16:39:26 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c44305a01 | ||
|
|
9c4d482471 | ||
|
|
713f77c1ad | ||
|
|
db2b71582b | ||
|
|
ccc750cce3 | ||
|
|
0dc26232b6 | ||
|
|
fa0fc8eefe | ||
|
|
1cadcde740 | ||
|
|
a602cad2db | ||
|
|
0a400aeda9 | ||
|
|
aaca85bc7e | ||
|
|
fcba8a9269 | ||
|
|
8931a28286 | ||
|
|
8d4d72e14d | ||
|
|
fa40d1dc92 | ||
|
|
4007d14517 | ||
|
|
389db5404c | ||
|
|
763065e7ab | ||
|
|
c697f016aa | ||
|
|
1df3b8efd0 | ||
|
|
bfce862180 | ||
|
|
3f0cc58bdc | ||
|
|
710482e9ed | ||
|
|
49dc230feb | ||
|
|
bf6cca7b95 | ||
|
|
6281e7ae2d | ||
|
|
4f488ba75f | ||
|
|
1fa59d0a08 | ||
|
|
ccc9bd26c5 | ||
|
|
1436a508a5 | ||
|
|
a9aabdfa0c | ||
|
|
a6d2081d22 | ||
|
|
88dba0e876 | ||
|
|
88c9680682 | ||
|
|
1e1157159a | ||
|
|
b2fe48e1f2 | ||
|
|
e1b5d6f8b1 | ||
|
|
003a0bfacc | ||
|
|
08b73394ee | ||
|
|
ec9d4c050f | ||
|
|
6460a0d7db | ||
|
|
f709a033a5 | ||
|
|
851d6829ee | ||
|
|
8b5f2aec6b | ||
|
|
32f911c3cf | ||
|
|
ef74376c21 | ||
|
|
2752d758b5 | ||
|
|
296d4fb96d | ||
|
|
69f8a492c8 | ||
|
|
21cf32852b | ||
|
|
5eff5e7b1a | ||
|
|
9edd79e5f1 | ||
|
|
4c2a42fc48 | ||
|
|
10446a1934 | ||
|
|
3aeb2b0959 | ||
|
|
e9807280d5 | ||
|
|
395f8b456a | ||
|
|
ef7c9d4e47 | ||
|
|
f8bea1c812 | ||
|
|
4a83cfba83 | ||
|
|
199aec01ca | ||
|
|
65d6b5e360 | ||
|
|
dac412ad4e | ||
|
|
0f3aaf015a | ||
|
|
d48be332ca | ||
|
|
c943034145 | ||
|
|
e453a8fa79 | ||
|
|
b84b7ec0d0 | ||
|
|
22b3b1e90f | ||
|
|
d1eb61bb84 | ||
|
|
aba61490d4 | ||
|
|
298023f283 | ||
|
|
e5e55431ed | ||
|
|
13c3a20e84 | ||
|
|
b5a15244b3 | ||
|
|
cb446ae89c | ||
|
|
83ccf6ff24 | ||
|
|
1eb20f7cb6 | ||
|
|
34574a36f1 | ||
|
|
91c8d1f47a | ||
|
|
0e5760eaa2 | ||
|
|
81a25eeedf | ||
|
|
627c9efb44 | ||
|
|
e76db6c669 | ||
|
|
c44e901992 | ||
|
|
b88d03f316 | ||
|
|
ede3872627 | ||
|
|
29b50e057c | ||
|
|
ff75e0440f | ||
|
|
4ab8d5854b | ||
|
|
d555cdacb8 | ||
|
|
c704184884 | ||
|
|
9e58352fad | ||
|
|
0c7a32f372 | ||
|
|
604c5bc8a0 | ||
|
|
87c97694f7 | ||
|
|
aee7c53729 | ||
|
|
22e0ba7043 | ||
|
|
280de58a54 | ||
|
|
b6774d8656 | ||
|
|
268eb0eb2d | ||
|
|
fac0e1179b | ||
|
|
985c6f0a67 | ||
|
|
db1d9320bd | ||
|
|
0a110c4afa | ||
|
|
e436375090 | ||
|
|
8723ad9577 | ||
|
|
f8693c8cc3 | ||
|
|
1a1b0a59ee | ||
|
|
af22a68540 | ||
|
|
696df06794 | ||
|
|
9886e43335 | ||
|
|
3bd5886a6c | ||
|
|
aa071bfb15 | ||
|
|
98d3001861 | ||
|
|
36b55cc73c | ||
|
|
80f64066a7 | ||
|
|
a5ce95d831 | ||
|
|
b07409050a | ||
|
|
a2ee7c9092 | ||
|
|
f9c9c91490 | ||
|
|
dca43f812d | ||
|
|
d93329478d | ||
|
|
3d296e4099 | ||
|
|
b7f9485ff6 | ||
|
|
65bd3fefa9 | ||
|
|
5a4c831809 | ||
|
|
3c6ce19b3a | ||
|
|
cdb6966455 | ||
|
|
27c8142602 | ||
|
|
c04779efe2 | ||
|
|
be5a9f7b4b | ||
|
|
1564047a26 | ||
|
|
e561a909e7 | ||
|
|
3e06062784 | ||
|
|
65a2af748b | ||
|
|
febd9de71b | ||
|
|
870808b31b | ||
|
|
debfdabde9 | ||
|
|
6cf7152478 | ||
|
|
f75d121a59 | ||
|
|
407b5a619a | ||
|
|
b46bc89cb9 | ||
|
|
cb587b18bd | ||
|
|
8b67421c0c | ||
|
|
64f882c6b8 | ||
|
|
eb6590a275 | ||
|
|
595c238fb5 | ||
|
|
80d1e4efe7 | ||
|
|
8ee6f9d190 | ||
|
|
94a2f88633 | ||
|
|
605cf36e9c | ||
|
|
21194aa285 | ||
|
|
e3876de3d2 | ||
|
|
1e054f9801 | ||
|
|
df048c6bd6 | ||
|
|
3056fb9ceb | ||
|
|
bb655b55e5 | ||
|
|
97ab18a771 | ||
|
|
26760502d0 | ||
|
|
126c7e08e3 | ||
|
|
5e55cf753e | ||
|
|
da8b0ccbfc | ||
|
|
c746e8e139 | ||
|
|
0e2df5620e | ||
|
|
b1b43120ea | ||
|
|
e854cc083f | ||
|
|
791f2b8ec9 | ||
|
|
0c6b293337 | ||
|
|
da9b3bf435 | ||
|
|
301086faa1 | ||
|
|
3b6b54103b | ||
|
|
6dda90b64f | ||
|
|
d28fcce8b6 | ||
|
|
ba2da974c9 | ||
|
|
024f8bd62f | ||
|
|
fe7853781b | ||
|
|
d92010bfe0 | ||
|
|
2631f1771c | ||
|
|
4cf7a6b8fe | ||
|
|
af460ffed6 | ||
|
|
a7982c4df3 | ||
|
|
0850654da8 | ||
|
|
086e050914 | ||
|
|
4c57b9a2e6 | ||
|
|
ca7095c65a | ||
|
|
2c3f2e797d | ||
|
|
cccd3ff7fc | ||
|
|
effc3ba296 | ||
|
|
e96fdea003 | ||
|
|
00a43549a2 | ||
|
|
ebd09842a2 | ||
|
|
1eccc9cb7c | ||
|
|
a44df8dd9a | ||
|
|
58d78d5c5d | ||
|
|
9babeb4373 | ||
|
|
8345bd8bb5 | ||
|
|
9106246891 | ||
|
|
21209a75d8 | ||
|
|
3b6d50661b | ||
|
|
295cc70e0a | ||
|
|
c7fa266ae1 | ||
|
|
8788afc35f | ||
|
|
44c55ee923 | ||
|
|
2073fbd680 | ||
|
|
1b876d4cac | ||
|
|
0961b233e0 | ||
|
|
184bcf88d7 | ||
|
|
3f07a11b53 | ||
|
|
aa3a66cf01 | ||
|
|
0bc8f670f5 | ||
|
|
63cb8f0e84 | ||
|
|
5a17df7c5c | ||
|
|
3ce9735ff8 | ||
|
|
1819b814a3 | ||
|
|
f5c5bd03e6 | ||
|
|
04c6d4b3cc | ||
|
|
7e5116ba59 | ||
|
|
44d254415e | ||
|
|
0efba47c53 | ||
|
|
c7be9b7230 | ||
|
|
311310e04c | ||
|
|
59ca997372 | ||
|
|
27a96495ae | ||
|
|
cd1662761b | ||
|
|
4995131e24 | ||
|
|
ae9989a13f | ||
|
|
db143ea39f | ||
|
|
7582b0e6ba | ||
|
|
1ce6cbef51 | ||
|
|
e136330e36 | ||
|
|
346f09dabd | ||
|
|
0d56f1ab5f | ||
|
|
2f771b1f05 | ||
|
|
1862e68c52 | ||
|
|
aaca9cc654 | ||
|
|
bda83eb434 | ||
|
|
6f5838306d | ||
|
|
615e1b60b7 | ||
|
|
4300a532ba | ||
|
|
52c92183f5 | ||
|
|
feda58b8c4 | ||
|
|
a41d0b4553 | ||
|
|
68e9fa157d | ||
|
|
81f79582b5 | ||
|
|
552aa85eb6 | ||
|
|
5119e522d4 | ||
|
|
46f112fe7f | ||
|
|
2215c1bd38 | ||
|
|
aa38037087 | ||
|
|
b48efb4607 | ||
|
|
3c22dd6380 | ||
|
|
9127ed5220 | ||
|
|
a04c6b46af | ||
|
|
ed7bc1cdf3 | ||
|
|
6d191fc162 | ||
|
|
b14f22a0cf | ||
|
|
bb9fe44a0f | ||
|
|
ee6adfa83c | ||
|
|
8d990b3f96 | ||
|
|
9b0b5d1504 | ||
|
|
aac1cc30a5 | ||
|
|
e8f1cb4e02 | ||
|
|
f973794e4a | ||
|
|
062a8917cb | ||
|
|
3c412c91f7 | ||
|
|
b3f338e4e0 | ||
|
|
78f422c64a | ||
|
|
6f76846497 | ||
|
|
638426b81b | ||
|
|
a982e8a0e2 | ||
|
|
79a2954486 | ||
|
|
3e73314cb1 | ||
|
|
92e94ab4e9 | ||
|
|
1e0ec8e17e | ||
|
|
a1e0e95925 | ||
|
|
ceb1a7828a | ||
|
|
02beb55896 | ||
|
|
f53377cc7d | ||
|
|
02fbb7cdcf | ||
|
|
58059111c1 | ||
|
|
f51cc16500 | ||
|
|
1d6fa13a94 | ||
|
|
6924adbda3 | ||
|
|
983dde38d2 | ||
|
|
bda0753b77 | ||
|
|
93d9dbfd20 | ||
|
|
0a277b7e52 | ||
|
|
4825a1ca09 | ||
|
|
21dd6f39a8 | ||
|
|
261b85dbda | ||
|
|
4716cff256 | ||
|
|
d86c6ad6ee | ||
|
|
bd7906595a | ||
|
|
f00478cf17 | ||
|
|
1a24d11137 | ||
|
|
b8185e042f | ||
|
|
318cc79b8e | ||
|
|
389abf794f | ||
|
|
1d37ec38ee | ||
|
|
fd2a9223ff | ||
|
|
84e7da76b5 | ||
|
|
90d30df686 | ||
|
|
9fa9ed9f6e | ||
|
|
c26867c80b | ||
|
|
221a005fc7 | ||
|
|
7fb61a5121 | ||
|
|
6eadbcd53e | ||
|
|
b43da4eea8 | ||
|
|
1590e1061c | ||
|
|
3ac32665b8 | ||
|
|
97f01aeb74 | ||
|
|
92e3bd82ef | ||
|
|
ad2ce68a49 | ||
|
|
75f212bec7 | ||
|
|
13f6ee18f9 | ||
|
|
571d2056fb | ||
|
|
08ef87c77e | ||
|
|
5d2e7acc95 | ||
|
|
58e18e3ebb | ||
|
|
a4731e0053 | ||
|
|
db22749219 | ||
|
|
942c0023fb | ||
|
|
0b4fa3ea5c | ||
|
|
e23b15ccd1 | ||
|
|
0f515829fe |
@@ -1,4 +1,4 @@
|
||||
### mdserver-web 0.8.5
|
||||
### mdserver-web 0.8.6
|
||||
简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
|
||||
复制了后台管理界面,按照自己想要的方式写了一版。
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
### 主要插件介绍
|
||||
* OpenResty - 轻量级,占有内存少,并发能力强。
|
||||
* PHP[53-74] - PHP是世界上最好的编程语言。
|
||||
* PHP[52-80] - PHP是世界上最好的编程语言。
|
||||
* MySQL - MySQL是一种关系数据库管理系统。
|
||||
* phpMyAdmin - 著名Web端MySQL管理工具。
|
||||
* Memcached - 一个高性能的分布式内存对象缓存系统。
|
||||
@@ -23,11 +23,9 @@
|
||||
* Gogs - 一款极易搭建的自助Git服务。
|
||||
* Rsyncd - 通用同步服务。
|
||||
|
||||
### 版本更新 0.8.5
|
||||
* 添加PHP80版本-Alpha。
|
||||
* 优化PHP及扩展安装脚本。
|
||||
* 自动识别IP地址。
|
||||
* 增加xhprof插件。
|
||||
### 版本更新 0.8.6
|
||||
* mysql主从配置。
|
||||
* swap插件[虚拟内存]。
|
||||
|
||||
### 自动安装
|
||||
```
|
||||
|
||||
@@ -17,7 +17,8 @@ class config_api:
|
||||
|
||||
# 本版解决自启动问题
|
||||
# 文件管理重命名
|
||||
__version = '0.8.5'
|
||||
# 优化计划任务管理
|
||||
__version = '0.8.6'
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
+25
-15
@@ -21,8 +21,14 @@ class crontab_api:
|
||||
|
||||
##### ----- start ----- ###
|
||||
def listApi(self):
|
||||
_list = mw.M('crontab').where('', ()).field(self.field).limit(
|
||||
'0,30').order('id desc').select()
|
||||
p = request.args.get('p', 1)
|
||||
psize = 10
|
||||
|
||||
startPage = (int(p) - 1) * psize
|
||||
pageInfo = str(startPage) + ',' + str(psize)
|
||||
|
||||
_list = mw.M('crontab').where('', ()).field(
|
||||
self.field).limit(pageInfo).order('id desc').select()
|
||||
|
||||
data = []
|
||||
for i in range(len(_list)):
|
||||
@@ -68,9 +74,12 @@ class crontab_api:
|
||||
count = mw.M('crontab').where('', ()).count()
|
||||
_page = {}
|
||||
_page['count'] = count
|
||||
_page['tojs'] = 'remind'
|
||||
_page['p'] = p
|
||||
_page['row'] = psize
|
||||
_page['tojs'] = "getCronData"
|
||||
|
||||
_ret['page'] = mw.getPage(_page)
|
||||
_ret['list'] = mw.getPage(_page)
|
||||
_ret['p'] = p
|
||||
return mw.getJson(_ret)
|
||||
|
||||
# 设置计划任务状态
|
||||
@@ -158,7 +167,7 @@ class crontab_api:
|
||||
logFile = mw.getServerDir() + '/cron/' + echo['echo'] + '.log'
|
||||
if not os.path.exists(logFile):
|
||||
return mw.returnJson(False, '当前日志为空!')
|
||||
log = mw.getNumLines(logFile, 2000)
|
||||
log = mw.getNumLines(logFile, 500)
|
||||
return mw.returnJson(True, log)
|
||||
|
||||
def addApi(self):
|
||||
@@ -194,25 +203,26 @@ class crontab_api:
|
||||
}
|
||||
|
||||
# print params
|
||||
cuonConfig, get, name = self.getCrondCycle(params)
|
||||
cronConfig, get, name = self.getCrondCycle(params)
|
||||
cronPath = mw.getServerDir() + '/cron'
|
||||
|
||||
cronName = self.getShell(params)
|
||||
# print cuonConfig, _params, name
|
||||
# print cronPath, cronName
|
||||
# print stype
|
||||
# print cronConfig, _params, name
|
||||
# print 'vv', cronPath, cronName
|
||||
# print 'stype', stype
|
||||
|
||||
if type(cronName) == dict:
|
||||
return cronName
|
||||
|
||||
cuonConfig += ' ' + cronPath + '/' + cronName + \
|
||||
cronConfig += ' ' + cronPath + '/' + cronName + \
|
||||
' >> ' + cronPath + '/' + cronName + '.log 2>&1'
|
||||
wRes = self.writeShell(cuonConfig)
|
||||
|
||||
if type(wRes) != bool:
|
||||
return wRes
|
||||
if not mw.isAppleSystem():
|
||||
wRes = self.writeShell(cronConfig)
|
||||
if type(wRes) != bool:
|
||||
return wRes
|
||||
self.crondReload()
|
||||
|
||||
self.crondReload()
|
||||
addData = mw.M('crontab').add('name,type,where1,where_hour,where_minute,echo,addtime,status,save,backup_to,stype,sname,sbody,urladdress', (iname, field_type, where1, hour, minute, cronName, time.strftime(
|
||||
'%Y-%m-%d %X', time.localtime()), 1, save, backup_to, stype, sname, sbody, urladdress))
|
||||
|
||||
@@ -451,7 +461,7 @@ echo "--------------------------------------------------------------------------
|
||||
if not os.path.exists(file):
|
||||
mw.writeFile(file, '')
|
||||
conf = mw.readFile(file)
|
||||
conf += config + "\n"
|
||||
conf += str(config) + "\n"
|
||||
if mw.writeFile(file, conf):
|
||||
if not os.path.exists(u_file):
|
||||
mw.execShell("chmod 600 '" + file +
|
||||
|
||||
+1
-1
@@ -882,7 +882,7 @@ def get_string_arr(t):
|
||||
def getSSHPort():
|
||||
try:
|
||||
file = '/etc/ssh/sshd_config'
|
||||
conf = ReadFile(file)
|
||||
conf = readFile(file)
|
||||
rep = "#*Port\s+([0-9]+)\s*\n"
|
||||
port = re.search(rep, conf).groups(0)[0]
|
||||
return int(port)
|
||||
|
||||
+14
-18
@@ -12,6 +12,7 @@ from flask import request
|
||||
|
||||
import db
|
||||
import mw
|
||||
import requests
|
||||
import config_api
|
||||
|
||||
|
||||
@@ -102,10 +103,10 @@ class system_api:
|
||||
|
||||
@async
|
||||
def restartMw(self):
|
||||
sleep(1)
|
||||
cmd = mw.getRunDir() + '/scripts/init.d/mw restart'
|
||||
sleep(0.3)
|
||||
# cmd = mw.getRunDir() + '/scripts/init.d/mw restart'
|
||||
# print cmd
|
||||
mw.execShell(cmd)
|
||||
mw.execShell('service mw restart')
|
||||
|
||||
@async
|
||||
def restartServer(self):
|
||||
@@ -604,13 +605,9 @@ class system_api:
|
||||
old_list = old.split('.')
|
||||
ret = 'none'
|
||||
|
||||
# t = [0] * 3
|
||||
isHasNew = True
|
||||
for i in range(3):
|
||||
if int(new_list[i]) > int(old_list[i]):
|
||||
pass
|
||||
else:
|
||||
isHasNew = False
|
||||
if int(new_list[0]) == int(old_list[0]) and int(new_list[1]) == int(old_list[1]) and int(new_list[2]) == int(old_list[2]):
|
||||
isHasNew = False
|
||||
|
||||
if isHasNew:
|
||||
return 'new'
|
||||
@@ -619,8 +616,9 @@ class system_api:
|
||||
def getServerInfo(self):
|
||||
upAddr = 'https://raw.githubusercontent.com/midoks/mdserver-web/master/version/info.json'
|
||||
try:
|
||||
version = mw.httpGet(upAddr)
|
||||
version = json.loads(version)
|
||||
requests.adapters.DEFAULT_RETRIES = 2
|
||||
r = requests.get(upAddr, verify=False)
|
||||
version = json.loads(r.content)
|
||||
return version[0]
|
||||
except Exception as e:
|
||||
print 'getServerInfo', e
|
||||
@@ -636,11 +634,10 @@ class system_api:
|
||||
version_now = config_api.config_api().getVersion()
|
||||
version_new_info = self.getServerInfo()
|
||||
if not 'version' in version_new_info:
|
||||
return mw.returnJson(False, '服务器数据有问题!')
|
||||
return mw.returnJson(False, '服务器数据或网络有问题!')
|
||||
|
||||
diff = self.versionDiff(
|
||||
version_now, version_new_info['version'])
|
||||
print diff
|
||||
if diff == 'new':
|
||||
return mw.returnJson(True, '有新版本!', version_new_info['version'])
|
||||
elif diff == 'test':
|
||||
@@ -674,13 +671,12 @@ class system_api:
|
||||
if not os.path.exists(toPath):
|
||||
mw.execShell('mkdir -p ' + toPath)
|
||||
|
||||
if not os.path.exists(toPath + '/mw.zip'):
|
||||
mw.execShell('wget -O ' + toPath + '/mw.zip ' + newUrl)
|
||||
mw.execShell('wget -O ' + toPath + '/mw.zip ' + newUrl)
|
||||
|
||||
mw.execShell('unzip -o ' + toPath + '/mw.zip' + ' -d ./')
|
||||
mw.execShell('unzip -o mdserver-web.zip -d ./')
|
||||
mw.execShell('rm -f mdserver-web.zip')
|
||||
return mw.returnJson(True, '安装更新成功!')
|
||||
mw.execShell('unzip -o mw.zip -d ./')
|
||||
mw.execShell('rm -f mw.zip')
|
||||
return mw.returnJson(True, '安装更新成功,需自己重启!')
|
||||
|
||||
return mw.returnJson(False, '已经是最新,无需更新!')
|
||||
except Exception as ex:
|
||||
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
## 文件保存相关 ##
|
||||
|
||||
# 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置
|
||||
dir=/tmp/aria2
|
||||
# 设置日志等级
|
||||
log-level=error
|
||||
# 日志保存路径
|
||||
log={$SERVER_PATH}/aria2.log
|
||||
# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M
|
||||
disk-cache=32M
|
||||
# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
|
||||
# 预分配所需时间: none < falloc ? trunc < prealloc
|
||||
# falloc和trunc则需要文件系统和内核支持
|
||||
# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项
|
||||
#file-allocation=none
|
||||
# 断点续传
|
||||
continue=true
|
||||
|
||||
## 下载连接相关 ##
|
||||
|
||||
# 最大同时下载任务数, 运行时可修改, 默认:5
|
||||
max-concurrent-downloads=5
|
||||
# 同一服务器连接数, 添加时可指定, 默认:1
|
||||
max-connection-per-server=10
|
||||
# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M
|
||||
# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载
|
||||
min-split-size=10M
|
||||
# 单个任务最大线程数, 添加时可指定, 默认:5
|
||||
split=128
|
||||
# 整体下载速度限制, 运行时可修改, 默认:0
|
||||
#max-overall-download-limit=0
|
||||
# 单个任务下载速度限制, 默认:0
|
||||
#max-download-limit=0
|
||||
# 整体上传速度限制, 运行时可修改, 默认:0
|
||||
#max-overall-upload-limit=0
|
||||
# 单个任务上传速度限制, 默认:0
|
||||
#max-upload-limit=0
|
||||
# 禁用IPv6, 默认:false
|
||||
disable-ipv6=true
|
||||
|
||||
## 进度保存相关 ##
|
||||
|
||||
# 从会话文件中读取下载任务
|
||||
input-file={$SERVER_PATH}/aria2.session
|
||||
# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件
|
||||
save-session={$SERVER_PATH}/aria2.session
|
||||
# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0
|
||||
#save-session-interval=60
|
||||
|
||||
## RPC相关设置 ##
|
||||
|
||||
# 启用RPC, 默认:false
|
||||
enable-rpc=true
|
||||
# 允许所有来源, 默认:false
|
||||
rpc-allow-origin-all=true
|
||||
# 允许非外部访问, 默认:false
|
||||
rpc-listen-all=true
|
||||
# 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同
|
||||
#event-poll=select
|
||||
# RPC监听端口, 端口被占用时可以修改, 默认:6800
|
||||
rpc-listen-port=6800
|
||||
# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项
|
||||
#rpc-secret=sark
|
||||
# 设置的RPC访问用户名, 此选项新版已废弃, 建议改用 --rpc-secret 选项
|
||||
#rpc-user=<USER>
|
||||
# 设置的RPC访问密码, 此选项新版已废弃, 建议改用 --rpc-secret 选项
|
||||
#rpc-passwd=<PASSWD>
|
||||
|
||||
## BT/PT下载相关 ##
|
||||
|
||||
# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true
|
||||
#follow-torrent=true
|
||||
# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999
|
||||
listen-port=51413
|
||||
# 单个种子最大连接数, 默认:55
|
||||
#bt-max-peers=55
|
||||
# 打开DHT功能, PT需要禁用, 默认:true
|
||||
enable-dht=false
|
||||
# 打开IPv6 DHT功能, PT需要禁用
|
||||
#enable-dht6=false
|
||||
# DHT网络监听端口, 默认:6881-6999
|
||||
#dht-listen-port=6881-6999
|
||||
# 本地节点查找, PT需要禁用, 默认:false
|
||||
#bt-enable-lpd=false
|
||||
# 种子交换, PT需要禁用, 默认:true
|
||||
enable-peer-exchange=false
|
||||
# 每个种子限速, 对少种的PT很有用, 默认:50K
|
||||
#bt-request-peer-speed-limit=50K
|
||||
# 客户端伪装, PT需要
|
||||
peer-id-prefix=-TR2770-
|
||||
user-agent=Transmission/2.77
|
||||
# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0
|
||||
seed-ratio=0
|
||||
# 强制保存会话, 即使任务已经完成, 默认:false
|
||||
# 较新的版本开启后会在任务完成后依然保留.aria2文件
|
||||
#force-save=false
|
||||
# BT校验相关, 默认:true
|
||||
#bt-hash-check-seed=true
|
||||
# 继续之前的BT任务时, 无需再次校验, 默认:false
|
||||
bt-seed-unverified=true
|
||||
# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false
|
||||
bt-save-metadata=true
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Executable
+19
@@ -0,0 +1,19 @@
|
||||
<div class="bt-form">
|
||||
<div class="bt-w-main">
|
||||
<div class="bt-w-menu">
|
||||
<p class="bgw" onclick="pluginService('aria2');">服务</p>
|
||||
<p onclick="pluginInitD('aria2');">自启动</p>
|
||||
<p onclick="pluginConfig('aria2');">配置修改</p>
|
||||
<p onclick="pluginLogs('aria2','','run_log');">运行日志</p>
|
||||
<p onclick="readme();">说明</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$.getScript( "/plugins/file?name=aria2&f=js/aria2.js", function(){
|
||||
pluginService('aria2');
|
||||
});
|
||||
</script>
|
||||
Executable
+211
@@ -0,0 +1,211 @@
|
||||
# coding:utf-8
|
||||
|
||||
import sys
|
||||
import io
|
||||
import os
|
||||
import time
|
||||
import shutil
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
|
||||
app_debug = False
|
||||
if mw.isAppleSystem():
|
||||
app_debug = True
|
||||
|
||||
|
||||
def getPluginName():
|
||||
return 'aria2'
|
||||
|
||||
|
||||
def getPluginDir():
|
||||
return mw.getPluginDir() + '/' + getPluginName()
|
||||
|
||||
|
||||
def getServerDir():
|
||||
return mw.getServerDir() + '/' + getPluginName()
|
||||
|
||||
|
||||
def getInitDTpl():
|
||||
path = getPluginDir() + "/init.d/aria2.tpl"
|
||||
return path
|
||||
|
||||
|
||||
def getArgs():
|
||||
args = sys.argv[2:]
|
||||
tmp = {}
|
||||
args_len = len(args)
|
||||
|
||||
if args_len == 1:
|
||||
t = args[0].strip('{').strip('}')
|
||||
t = t.split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
elif args_len > 1:
|
||||
for i in range(len(args)):
|
||||
t = args[i].split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
|
||||
return tmp
|
||||
|
||||
|
||||
def initDreplace():
|
||||
|
||||
file_tpl = getInitDTpl()
|
||||
service_path = os.path.dirname(os.getcwd())
|
||||
|
||||
initD_path = getServerDir() + '/init.d'
|
||||
|
||||
file_bin = initD_path + '/' + getPluginName()
|
||||
if not os.path.exists(initD_path):
|
||||
os.mkdir(initD_path)
|
||||
|
||||
# initd replace
|
||||
content = mw.readFile(file_tpl)
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
mw.writeFile(file_bin, content)
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
|
||||
aria2_path = getServerDir() + '/aria2'
|
||||
mw.execShell('mkdir -p /tmp/download')
|
||||
if not os.path.exists(aria2_path):
|
||||
|
||||
mw.execShell('mkdir -p ' + aria2_path)
|
||||
mw.execShell('touch ' + aria2_path + '/aria2.session')
|
||||
|
||||
path = getPluginDir() + "/conf/aria2.conf"
|
||||
content = mw.readFile(path)
|
||||
content = content.replace('{$SERVER_PATH}', aria2_path)
|
||||
|
||||
mw.writeFile(aria2_path + '/aria2.conf', content)
|
||||
|
||||
return file_bin
|
||||
|
||||
|
||||
def checkArgs(data, ck=[]):
|
||||
for i in range(len(ck)):
|
||||
if not ck[i] in data:
|
||||
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
|
||||
return (True, mw.returnJson(True, 'ok'))
|
||||
|
||||
|
||||
def status():
|
||||
cmd = "ps -ef|grep aria2 |grep -v grep | grep -v 'mdserver-web'| awk '{print $2}'"
|
||||
data = mw.execShell(cmd)
|
||||
if data[0] == '':
|
||||
return 'stop'
|
||||
return 'start'
|
||||
|
||||
|
||||
def start():
|
||||
|
||||
file = initDreplace()
|
||||
data = mw.execShell(file + ' start')
|
||||
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return data[1]
|
||||
|
||||
|
||||
def stop():
|
||||
file = initDreplace()
|
||||
data = mw.execShell(file + ' stop')
|
||||
# print data
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return data[1]
|
||||
|
||||
|
||||
def restart():
|
||||
file = initDreplace()
|
||||
data = mw.execShell(file + ' reload')
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return data[1]
|
||||
|
||||
|
||||
def reload():
|
||||
file = initDreplace()
|
||||
data = mw.execShell(file + ' reload')
|
||||
if data[1] == '':
|
||||
return 'ok'
|
||||
return data[1]
|
||||
|
||||
|
||||
def getPathFile():
|
||||
if mw.isAppleSystem():
|
||||
user = mw.execShell(
|
||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return '/Users/' + user + '/.aria2/aria2.conf'
|
||||
return getServerDir() + '/aria2/aria2.conf'
|
||||
|
||||
|
||||
def getInitDFile():
|
||||
if app_debug:
|
||||
return '/tmp/' + getPluginName()
|
||||
return '/etc/init.d/' + getPluginName()
|
||||
|
||||
|
||||
def initdStatus():
|
||||
if not app_debug:
|
||||
if mw.isAppleSystem():
|
||||
return "Apple Computer does not support"
|
||||
initd_bin = getInitDFile()
|
||||
if os.path.exists(initd_bin):
|
||||
return 'ok'
|
||||
return 'fail'
|
||||
|
||||
|
||||
def initdInstall():
|
||||
source_bin = initDreplace()
|
||||
initd_bin = getInitDFile()
|
||||
shutil.copyfile(source_bin, initd_bin)
|
||||
mw.execShell('chmod +x ' + initd_bin)
|
||||
|
||||
if not app_debug:
|
||||
mw.execShell('chkconfig --add ' + getPluginName())
|
||||
return 'ok'
|
||||
|
||||
|
||||
def initdUinstall():
|
||||
if not app_debug:
|
||||
mw.execShell('chkconfig --del ' + getPluginName())
|
||||
|
||||
initd_bin = getInitDFile()
|
||||
|
||||
if os.path.exists(initd_bin):
|
||||
os.remove(initd_bin)
|
||||
return 'ok'
|
||||
|
||||
|
||||
def getLog():
|
||||
if mw.isAppleSystem():
|
||||
user = mw.execShell(
|
||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||
return '/Users/' + user + '/.aria2/aria2.log'
|
||||
return getServerDir() + '/aria2/aria2.log'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
print status()
|
||||
elif func == 'start':
|
||||
print start()
|
||||
elif func == 'stop':
|
||||
print stop()
|
||||
elif func == 'restart':
|
||||
print restart()
|
||||
elif func == 'reload':
|
||||
print reload()
|
||||
elif func == 'conf':
|
||||
print getPathFile()
|
||||
elif func == 'initd_status':
|
||||
print initdStatus()
|
||||
elif func == 'initd_install':
|
||||
print initdInstall()
|
||||
elif func == 'initd_uninstall':
|
||||
print initdUinstall()
|
||||
elif func == 'run_log':
|
||||
print getLog()
|
||||
else:
|
||||
print 'error'
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"title":"aria2",
|
||||
"tip":"soft",
|
||||
"name":"aria2",
|
||||
"type":"其他插件",
|
||||
"ps":"一款下载神器",
|
||||
"versions":"1.0",
|
||||
"shell":"install.sh",
|
||||
"checks":"server/aria2",
|
||||
"path": "server/aria2",
|
||||
"author":"midoks",
|
||||
"home":"https://github.com/aria2/aria2",
|
||||
"date":"2020-06-08",
|
||||
"pid": "5"
|
||||
}
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
# chkconfig: 2345 55 25
|
||||
# description: aria2 Service
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: aria2
|
||||
# Required-Start: $all
|
||||
# Required-Stop: $all
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: starts aria2
|
||||
# Description: starts the MDW-Web
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
app_start(){
|
||||
# aria2c -D
|
||||
aria2c --daemon --enable-rpc --rpc-listen-all -c -D --conf-path={$SERVER_PATH}/aria2/aria2/aria2.conf
|
||||
echo "aria2 started"
|
||||
}
|
||||
app_stop(){
|
||||
echo "Stopping ..."
|
||||
arr=`ps -ef | grep "aria2" | grep -v 'grep' | grep -v '/bin/sh'|grep -v 'index.py' | awk '{print $2}'`
|
||||
echo $arr
|
||||
for p in ${arr[@]}
|
||||
do
|
||||
kill -9 $p &>/dev/null
|
||||
done
|
||||
echo "aria2 stopped"
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
app_start
|
||||
;;
|
||||
stop)
|
||||
app_stop
|
||||
;;
|
||||
restart|reload)
|
||||
app_stop
|
||||
sleep 0.3
|
||||
app_start
|
||||
;;
|
||||
*)
|
||||
echo "Please use start or stop as first argument"
|
||||
;;
|
||||
esac
|
||||
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/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")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
SYSOS=`uname`
|
||||
|
||||
Install_aria2()
|
||||
{
|
||||
isStart=""
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
mkdir -p $serverPath/aria2
|
||||
echo '1.0' > $serverPath/aria2/version.pl
|
||||
|
||||
if [ "Darwin" == "$SYSOS" ];then
|
||||
echo 'macosx unavailable' > $install_tmp
|
||||
find_sh=`which aria2c`
|
||||
if [ "$?" != "0" ];then
|
||||
brew install aria2
|
||||
fi
|
||||
else
|
||||
find_sh=`which aria2c`
|
||||
if [ "$?" != "0" ];then
|
||||
yum install aria2 -y
|
||||
fi
|
||||
fi
|
||||
|
||||
echo 'Install complete' > $install_tmp
|
||||
}
|
||||
|
||||
Uninstall_aria2()
|
||||
{
|
||||
rm -rf $serverPath/aria2
|
||||
echo "Uninstall completed" > $install_tmp
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_aria2
|
||||
else
|
||||
Uninstall_aria2
|
||||
fi
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
function str2Obj(str){
|
||||
var data = {};
|
||||
kv = str.split('&');
|
||||
for(i in kv){
|
||||
v = kv[i].split('=');
|
||||
data[v[0]] = v[1];
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function lpPost(method,args,callback, title){
|
||||
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
_args = JSON.stringify(str2Obj(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
|
||||
var _title = '正在获取...';
|
||||
if (typeof(title) != 'undefined'){
|
||||
_title = title;
|
||||
}
|
||||
|
||||
var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 });
|
||||
$.post('/plugins/run', {name:'aria2', func:method, args:_args}, function(data) {
|
||||
layer.close(loadT);
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof(callback) == 'function'){
|
||||
callback(data);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function lpAsyncPost(method,args){
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
_args = JSON.stringify(str2Obj(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
|
||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
||||
return syncPost('/plugins/run', {name:'l2tp', func:method, args:_args});
|
||||
}
|
||||
|
||||
function userList(){
|
||||
lpPost('user_list', '' ,function(data){
|
||||
var rdata = $.parseJSON(data['data']);
|
||||
|
||||
if (!rdata['status']){
|
||||
layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var list = rdata['data'];
|
||||
|
||||
var con = '';
|
||||
con += '<div class="divtable" style="margin-top:5px;"><table class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0">';
|
||||
con += '<thead><tr>';
|
||||
con += '<th>用户</th>';
|
||||
con += '<th>密码</th>';
|
||||
con += '<th>操作(<a class="btlink" onclick="addUser()">添加</a>)</th>';
|
||||
con += '</tr></thead>';
|
||||
|
||||
con += '<tbody>';
|
||||
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
con += '<tr>'+
|
||||
'<td>' + list[i]['user']+'</td>' +
|
||||
'<td>' + list[i]['pwd']+'</td>' +
|
||||
'<td><a class="btlink" onclick="modUser(\''+list[i]['user']+'\')">改密</a>|<a class="btlink" onclick="delUser(\''+list[i]['user']+'\')">删除</a></td></tr>';
|
||||
}
|
||||
|
||||
con += '</tbody>';
|
||||
con += '</table></div>';
|
||||
|
||||
$(".soft-man-con").html(con);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function readme(){
|
||||
var readme = '<ul class="help-info-text c7">';
|
||||
readme += '<li>使用时,查看对应的端口</li>';
|
||||
readme += '</ul>';
|
||||
$('.soft-man-con').html(readme);
|
||||
}
|
||||
@@ -12,5 +12,5 @@
|
||||
"author":"Google",
|
||||
"home":"https://github.com/google/bbr",
|
||||
"date":"2019-03-29",
|
||||
"pid":"4"
|
||||
"pid":"5"
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import sys
|
||||
sys.path.append("/usr/local/lib/python2.7/site-packages")
|
||||
|
||||
|
||||
class mysql:
|
||||
class mysqlDb:
|
||||
__DB_PASS = None
|
||||
__DB_USER = 'root'
|
||||
__DB_PORT = 3306
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo `date`
|
||||
|
||||
GITADDR="{$GITROOTURL}/{$USERNAME}/{$PROJECT}"
|
||||
GIT_SDIR="{$CODE_DIR}"
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ def getPluginDir():
|
||||
return mw.getPluginDir() + '/' + getPluginName()
|
||||
|
||||
sys.path.append(getPluginDir() + "/class")
|
||||
import mysql
|
||||
import mysqlDb
|
||||
|
||||
|
||||
def getServerDir():
|
||||
@@ -197,7 +197,7 @@ def pMysqlDb():
|
||||
conf = getDbConfValue()
|
||||
|
||||
host = conf['HOST'].split(':')
|
||||
conn = mysql.mysql()
|
||||
conn = mysqlDb.mysqlDb()
|
||||
|
||||
conn.setHost(host[0])
|
||||
conn.setUser(conf['USER'])
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"name": "memcached",
|
||||
"title": "Memcached",
|
||||
"shell": "install.sh",
|
||||
"versions":["1.5"],
|
||||
"updates":["1.5.12"],
|
||||
"versions":["1.6"],
|
||||
"updates":["1.6.9"],
|
||||
"tip": "soft",
|
||||
"checks": "server/memcached",
|
||||
"path":"server/memcached",
|
||||
|
||||
@@ -16,7 +16,7 @@ Install_mem(){
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
if [ ! -f $serverPath/source/memcached.tar.gz ];then
|
||||
wget -O $serverPath/source/memcached.tar.gz http://www.memcached.org/files/memcached-1.5.12.tar.gz
|
||||
wget -O $serverPath/source/memcached.tar.gz http://www.memcached.org/files/memcached-1.6.9.tar.gz
|
||||
fi
|
||||
|
||||
cd $serverPath/source && tar -zxvf memcached.tar.gz
|
||||
@@ -25,7 +25,7 @@ Install_mem(){
|
||||
cd $serverPath/source/memcached*
|
||||
./configure --prefix=$serverPath/memcached && make && make install
|
||||
|
||||
echo '1.5' > $serverPath/memcached/version.pl
|
||||
echo '1.6' > $serverPath/memcached/version.pl
|
||||
echo 'install ok' > $install_tmp
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import sys
|
||||
sys.path.append("/usr/local/lib/python2.7/site-packages")
|
||||
|
||||
|
||||
class mysql:
|
||||
class mysqlDb:
|
||||
__DB_PASS = None
|
||||
__DB_USER = 'root'
|
||||
__DB_PORT = 3306
|
||||
@@ -48,6 +48,9 @@ class mysql:
|
||||
self.__DB_ERR = e
|
||||
return False
|
||||
|
||||
def setDbConf(self, conf):
|
||||
self.__DB_CNF = conf
|
||||
|
||||
def setPwd(self, pwd):
|
||||
self.__DB_PASS = pwd
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
[client]
|
||||
user = root
|
||||
#password = your_password
|
||||
port = 3306
|
||||
socket = /tmp/mysql.sock
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
|
||||
[mysqld]
|
||||
# 5.6
|
||||
#default-authentication-plugin=sha256_password
|
||||
port = 3306
|
||||
socket = /tmp/mysql.sock
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
datadir = {$SERVER_APP_PATH}/data
|
||||
log-error = {$SERVER_APP_PATH}/data/error.log
|
||||
default_storage_engine = MyISAM
|
||||
#skip-external-locking
|
||||
#loose-skip-innodb
|
||||
key_buffer_size = 8M
|
||||
max_allowed_packet = 100G
|
||||
max_allowed_packet = 100M
|
||||
table_open_cache = 32
|
||||
sort_buffer_size = 256K
|
||||
net_buffer_length = 4K
|
||||
@@ -20,15 +21,21 @@ read_buffer_size = 128K
|
||||
read_rnd_buffer_size = 256K
|
||||
myisam_sort_buffer_size = 4M
|
||||
thread_cache_size = 4
|
||||
lower_case_table_names=2
|
||||
query_cache_size = 4M
|
||||
tmp_table_size = 8M
|
||||
|
||||
#skip-networking
|
||||
#skip-name-resolve
|
||||
max_connections = 500
|
||||
max_connect_errors = 100
|
||||
open_files_limit = 65535
|
||||
|
||||
#skip-networking
|
||||
#skip-name-resolve
|
||||
#skip-external-locking
|
||||
#loose-skip-innodb
|
||||
#skip-grant-tables
|
||||
|
||||
|
||||
log-bin=mysql-bin
|
||||
binlog_format=mixed
|
||||
server-id = 1
|
||||
@@ -38,6 +45,24 @@ slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
|
||||
long_query_time=3
|
||||
#log_queries_not_using_indexes=on
|
||||
|
||||
relay-log=mdserver
|
||||
relay-log-index=mdserver
|
||||
|
||||
#master
|
||||
#binlog-do-db
|
||||
binlog-ignore-db = test
|
||||
binlog-ignore-db = mysql
|
||||
binlog-ignore-db = information_schema
|
||||
binlog-ignore-db = performance_schema
|
||||
|
||||
#slave
|
||||
log-slave-updates
|
||||
#replicate-do-db
|
||||
replicate-ignore-db = information_schema
|
||||
replicate-ignore-db = performance_schema
|
||||
replicate-ignore-db = mysql
|
||||
replicate-ignore-db = test
|
||||
|
||||
default_storage_engine = InnoDB
|
||||
innodb_data_home_dir = {$SERVER_APP_PATH}/data
|
||||
innodb_data_file_path = ibdata1:10M:autoextend
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
[client]
|
||||
user = root
|
||||
#password = your_password
|
||||
port = 3306
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
default-character-set = UTF8MB4
|
||||
|
||||
[mysqld]
|
||||
port = 3306
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
datadir = {$SERVER_APP_PATH}/data
|
||||
log-error = {$SERVER_APP_PATH}/data/error.log
|
||||
default_storage_engine = MyISAM
|
||||
|
||||
key_buffer_size = 8M
|
||||
table_open_cache = 32
|
||||
sort_buffer_size = 256K
|
||||
net_buffer_length = 4K
|
||||
read_buffer_size = 128K
|
||||
read_rnd_buffer_size = 256K
|
||||
myisam_sort_buffer_size = 4M
|
||||
thread_cache_size = 4
|
||||
lower_case_table_names=2
|
||||
tmp_table_size = 8M
|
||||
character-set-server = UTF8MB4
|
||||
|
||||
max_connections = 500
|
||||
max_connect_errors = 100
|
||||
open_files_limit = 2560
|
||||
max_allowed_packet = 128M
|
||||
|
||||
#skip-external-locking
|
||||
#skip-grant-tables
|
||||
#loose-skip-innodb
|
||||
#skip-networking
|
||||
#skip-name-resolve
|
||||
|
||||
log-bin=mysql-bin
|
||||
binlog_format=mixed
|
||||
server-id = 1
|
||||
slow_query_log=1
|
||||
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
|
||||
long_query_time=3
|
||||
#log_queries_not_using_indexes=on
|
||||
|
||||
relay-log=mdserver
|
||||
relay-log-index=mdserver
|
||||
|
||||
#master
|
||||
#binlog-do-db
|
||||
binlog-ignore-db = test
|
||||
binlog-ignore-db = mysql
|
||||
binlog-ignore-db = information_schema
|
||||
binlog-ignore-db = performance_schema
|
||||
|
||||
#slave
|
||||
log-slave-updates
|
||||
#replicate-do-db
|
||||
replicate-ignore-db = information_schema
|
||||
replicate-ignore-db = performance_schema
|
||||
replicate-ignore-db = mysql
|
||||
replicate-ignore-db = test
|
||||
|
||||
default_storage_engine = InnoDB
|
||||
innodb_data_home_dir = {$SERVER_APP_PATH}/data
|
||||
innodb_data_file_path = ibdata1:10M:autoextend
|
||||
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
|
||||
innodb_buffer_pool_size = 16M
|
||||
innodb_log_file_size = 5M
|
||||
innodb_log_buffer_size = 8M
|
||||
innodb_flush_log_at_trx_commit = 1
|
||||
innodb_lock_wait_timeout = 120
|
||||
innodb_max_dirty_pages_pct = 90
|
||||
innodb_read_io_threads = 1
|
||||
innodb_write_io_threads = 1
|
||||
innodb_file_per_table=1
|
||||
binlog_expire_logs_seconds=2592000
|
||||
|
||||
[mysqldump]
|
||||
quick
|
||||
|
||||
[mysql]
|
||||
no-auto-rehash
|
||||
|
||||
[myisamchk]
|
||||
key_buffer_size = 20M
|
||||
sort_buffer_size = 20M
|
||||
read_buffer = 2M
|
||||
write_buffer = 2M
|
||||
|
||||
[mysqlhotcopy]
|
||||
interactive-timeout
|
||||
@@ -15,3 +15,14 @@ CREATE TABLE IF NOT EXISTS `databases` (
|
||||
`ps` TEXT,
|
||||
`addtime` TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `master_replication_user` (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`username` TEXT,
|
||||
`password` TEXT,
|
||||
`accept` TEXT,
|
||||
`ps` TEXT,
|
||||
`addtime` TEXT
|
||||
);
|
||||
|
||||
|
||||
|
||||
+28
-23
@@ -1,3 +1,28 @@
|
||||
<div class="bt-form">
|
||||
<div class='plugin_version'></div>
|
||||
<div class="bt-w-main">
|
||||
<div class="bt-w-menu">
|
||||
<script type="text/javascript">console.log($('.plugin_version').attr('version'));</script>
|
||||
<p class="bgw" onclick="pluginService('mysql', $('.plugin_version').attr('version'));">服务</p>
|
||||
<p onclick="pluginInitD('mysql', $('.plugin_version').attr('version'));">自启动</p>
|
||||
<p onclick="pluginConfig('mysql', $('.plugin_version').attr('version'));">配置文件</p>
|
||||
<p onclick="myDbPos();">存储位置</p>
|
||||
<p onclick="myPort();">端口</p>
|
||||
<p onclick="runInfo();">当前状态</p>
|
||||
<p onclick="myPerfOpt();">性能优化</p>
|
||||
<p onclick="myLogs();">日志</p>
|
||||
<p onclick="pluginLogs('mysql',$('.plugin_version').attr('version'),'show_log');">慢日志</p>
|
||||
<p onclick="dbList()">管理列表</p>
|
||||
<p onclick="masterOrSlaveConf($('.plugin_version').attr('version'))">主从配置</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
.db_list{
|
||||
padding: 0px 0 10px 0;
|
||||
@@ -25,29 +50,9 @@
|
||||
margin-right: 0;
|
||||
}
|
||||
</style>
|
||||
<div class="bt-form">
|
||||
<div class="bt-w-main">
|
||||
<div class="bt-w-menu">
|
||||
<p class="bgw" onclick="pluginService('mysql');">服务</p>
|
||||
<p onclick="pluginInitD('mysql');">自启动</p>
|
||||
<p onclick="pluginConfig('mysql');">配置文件</p>
|
||||
<p onclick="myDbPos();">存储位置</p>
|
||||
<p onclick="myPort();">端口</p>
|
||||
<p onclick="runInfo();">当前状态</p>
|
||||
<p onclick="myPerfOpt();">性能优化</p>
|
||||
<p onclick="myLogs();">日志</p>
|
||||
<p onclick="pluginLogs('mysql','','show_log');">慢日志</p>
|
||||
<p onclick="dbList()">管理列表</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
resetPluginWinWidth(800);
|
||||
pluginService('mysql');
|
||||
$.getScript( "/plugins/file?name=mysql&f=js/mysql.js");
|
||||
$.getScript( "/plugins/file?name=mysql&f=js/mysql.js", function(){
|
||||
pluginService('mysql',$('.plugin_version').attr('version'));
|
||||
});
|
||||
</script>
|
||||
+883
-64
File diff suppressed because it is too large
Load Diff
@@ -4,9 +4,12 @@
|
||||
"name":"mysql",
|
||||
"type":"运行环境",
|
||||
"ps":"一种关系数据库管理系统!",
|
||||
"coexist": false,
|
||||
"checks": "server/mysql/VERSION/bin/mysql",
|
||||
"path": "server/mysql/VERSION",
|
||||
"todo_versions":["5.6","5.7","8.0"],
|
||||
"versions":["5.5", "5.6", "5.7"],
|
||||
"updates":["5.5.62","5.6.46", "5.7.28"],
|
||||
"versions":["5.5", "5.6", "5.7","8.0"],
|
||||
"updates":["5.5.62","5.6.50", "5.7.32","8.0.22"],
|
||||
"shell":"install.sh",
|
||||
"checks":"server/mysql",
|
||||
"path":"server/mysql",
|
||||
|
||||
Executable
+376
@@ -0,0 +1,376 @@
|
||||
#!/bin/sh
|
||||
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
|
||||
# This file is public domain and comes with NO WARRANTY of any kind
|
||||
|
||||
# MySQL daemon start/stop script.
|
||||
|
||||
# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
|
||||
# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
|
||||
# When this is done the mysql server will be started when the machine is
|
||||
# started and shut down when the systems goes down.
|
||||
|
||||
# Comments to support chkconfig on RedHat Linux
|
||||
# chkconfig: 2345 64 36
|
||||
# description: A very fast and reliable SQL database engine.
|
||||
|
||||
# Comments to support LSB init script conventions
|
||||
### BEGIN INIT INFO
|
||||
# Provides: mysql
|
||||
# Required-Start: $local_fs $network $remote_fs
|
||||
# Should-Start: ypbind nscd ldap ntpd xntpd
|
||||
# Required-Stop: $local_fs $network $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: start and stop MySQL
|
||||
# Description: MySQL is a very fast and reliable SQL database engine.
|
||||
### END INIT INFO
|
||||
|
||||
# If you install MySQL on some other places than /Users/midoks/Desktop/fwww/server/mysql, then you
|
||||
# have to do one of the following things for this script to work:
|
||||
#
|
||||
# - Run this script from within the MySQL installation directory
|
||||
# - Create a /etc/my.cnf file with the following information:
|
||||
# [mysqld]
|
||||
# basedir=<path-to-mysql-installation-directory>
|
||||
# - Add the above to any other configuration file (for example ~/.my.ini)
|
||||
# and copy my_print_defaults to /usr/bin
|
||||
# - Add the path to the mysql-installation-directory to the basedir variable
|
||||
# below.
|
||||
#
|
||||
# If you want to affect other MySQL variables, you should make your changes
|
||||
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
|
||||
|
||||
# If you change base dir, you must also change datadir. These may get
|
||||
# overwritten by settings in the MySQL configuration files.
|
||||
|
||||
basedir=
|
||||
datadir=
|
||||
|
||||
# Default value, in seconds, afterwhich the script should timeout waiting
|
||||
# for server start.
|
||||
# Value here is overriden by value in my.cnf.
|
||||
# 0 means don't wait at all
|
||||
# Negative numbers mean to wait indefinitely
|
||||
service_startup_timeout=900
|
||||
|
||||
# Lock directory for RedHat / SuSE.
|
||||
lockdir='/var/lock/subsys'
|
||||
lock_file_path="$lockdir/mysql"
|
||||
|
||||
# The following variables are only set for letting mysql.server find things.
|
||||
|
||||
# Set some defaults
|
||||
mysqld_pid_file_path=
|
||||
if test -z "$basedir"
|
||||
then
|
||||
basedir=/Users/midoks/Desktop/fwww/server/mysql
|
||||
bindir=/Users/midoks/Desktop/fwww/server/mysql/bin
|
||||
if test -z "$datadir"
|
||||
then
|
||||
datadir=/Users/midoks/Desktop/fwww/server/mysql/data
|
||||
fi
|
||||
sbindir=/Users/midoks/Desktop/fwww/server/mysql/bin
|
||||
libexecdir=/Users/midoks/Desktop/fwww/server/mysql/bin
|
||||
else
|
||||
bindir="$basedir/bin"
|
||||
if test -z "$datadir"
|
||||
then
|
||||
datadir="$basedir/data"
|
||||
fi
|
||||
sbindir="$basedir/sbin"
|
||||
libexecdir="$basedir/libexec"
|
||||
fi
|
||||
|
||||
# datadir_set is used to determine if datadir was set (and so should be
|
||||
# *not* set inside of the --basedir= handler.)
|
||||
datadir_set=
|
||||
|
||||
#
|
||||
# Use LSB init script functions for printing messages, if possible
|
||||
#
|
||||
lsb_functions="/lib/lsb/init-functions"
|
||||
if test -f $lsb_functions ; then
|
||||
. $lsb_functions
|
||||
else
|
||||
log_success_msg()
|
||||
{
|
||||
echo " SUCCESS! $@"
|
||||
}
|
||||
log_failure_msg()
|
||||
{
|
||||
echo " ERROR! $@"
|
||||
}
|
||||
fi
|
||||
|
||||
PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
|
||||
export PATH
|
||||
|
||||
mode=$1 # start or stop
|
||||
|
||||
[ $# -ge 1 ] && shift
|
||||
|
||||
|
||||
other_args="$*" # uncommon, but needed when called from an RPM upgrade action
|
||||
# Expected: "--skip-networking --skip-grant-tables"
|
||||
# They are not checked here, intentionally, as it is the resposibility
|
||||
# of the "spec" file author to give correct arguments only.
|
||||
|
||||
case `echo "testing\c"`,`echo -n testing` in
|
||||
*c*,-n*) echo_n= echo_c= ;;
|
||||
*c*,*) echo_n=-n echo_c= ;;
|
||||
*) echo_n= echo_c='\c' ;;
|
||||
esac
|
||||
|
||||
parse_server_arguments() {
|
||||
for arg do
|
||||
case "$arg" in
|
||||
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`
|
||||
bindir="$basedir/bin"
|
||||
if test -z "$datadir_set"; then
|
||||
datadir="$basedir/data"
|
||||
fi
|
||||
sbindir="$basedir/sbin"
|
||||
libexecdir="$basedir/libexec"
|
||||
;;
|
||||
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
|
||||
datadir_set=1
|
||||
;;
|
||||
--pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
wait_for_pid () {
|
||||
verb="$1" # created | removed
|
||||
pid="$2" # process ID of the program operating on the pid-file
|
||||
pid_file_path="$3" # path to the PID file.
|
||||
|
||||
i=0
|
||||
avoid_race_condition="by checking again"
|
||||
|
||||
while test $i -ne $service_startup_timeout ; do
|
||||
|
||||
case "$verb" in
|
||||
'created')
|
||||
# wait for a PID-file to pop into existence.
|
||||
test -s "$pid_file_path" && i='' && break
|
||||
;;
|
||||
'removed')
|
||||
# wait for this PID-file to disappear
|
||||
test ! -s "$pid_file_path" && i='' && break
|
||||
;;
|
||||
*)
|
||||
echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# if server isn't running, then pid-file will never be updated
|
||||
if test -n "$pid"; then
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
: # the server still runs
|
||||
else
|
||||
# The server may have exited between the last pid-file check and now.
|
||||
if test -n "$avoid_race_condition"; then
|
||||
avoid_race_condition=""
|
||||
continue # Check again.
|
||||
fi
|
||||
|
||||
# there's nothing that will affect the file.
|
||||
log_failure_msg "The server quit without updating PID file ($pid_file_path)."
|
||||
return 1 # not waiting any more.
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $echo_n ".$echo_c"
|
||||
i=`expr $i + 1`
|
||||
sleep 1
|
||||
|
||||
done
|
||||
|
||||
if test -z "$i" ; then
|
||||
log_success_msg
|
||||
return 0
|
||||
else
|
||||
log_failure_msg
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Get arguments from the my.cnf file,
|
||||
# the only group, which is read from now on is [mysqld]
|
||||
if test -x "$bindir/my_print_defaults"; then
|
||||
print_defaults="$bindir/my_print_defaults"
|
||||
else
|
||||
# Try to find basedir in /etc/my.cnf
|
||||
conf=/etc/my.cnf
|
||||
print_defaults=
|
||||
if test -r $conf
|
||||
then
|
||||
subpat='^[^=]*basedir[^=]*=\(.*\)$'
|
||||
dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
|
||||
for d in $dirs
|
||||
do
|
||||
d=`echo $d | sed -e 's/[ ]//g'`
|
||||
if test -x "$d/bin/my_print_defaults"
|
||||
then
|
||||
print_defaults="$d/bin/my_print_defaults"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Hope it's in the PATH ... but I doubt it
|
||||
test -z "$print_defaults" && print_defaults="my_print_defaults"
|
||||
fi
|
||||
|
||||
#
|
||||
# Read defaults file from 'basedir'. If there is no defaults file there
|
||||
# check if it's in the old (depricated) place (datadir) and read it from there
|
||||
#
|
||||
|
||||
extra_args=""
|
||||
if test -r "$basedir/my.cnf"
|
||||
then
|
||||
extra_args="-e $basedir/my.cnf"
|
||||
fi
|
||||
|
||||
parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
|
||||
|
||||
#
|
||||
# Set pid file if not given
|
||||
#
|
||||
if test -z "$mysqld_pid_file_path"
|
||||
then
|
||||
mysqld_pid_file_path=$datadir/`hostname`.pid
|
||||
else
|
||||
case "$mysqld_pid_file_path" in
|
||||
/* ) ;;
|
||||
* ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case "$mode" in
|
||||
'start')
|
||||
# Start daemon
|
||||
|
||||
# Safeguard (relative paths, core dumps..)
|
||||
cd $basedir
|
||||
|
||||
echo $echo_n "Starting MySQL"
|
||||
if test -x $bindir/mysqld_safe
|
||||
then
|
||||
# Give extra arguments to mysqld with the my.cnf file. This script
|
||||
# may be overwritten at next upgrade.
|
||||
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
|
||||
wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
|
||||
|
||||
# Make lock for RedHat / SuSE
|
||||
if test -w "$lockdir"
|
||||
then
|
||||
touch "$lock_file_path"
|
||||
fi
|
||||
|
||||
exit $return_value
|
||||
else
|
||||
log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
|
||||
fi
|
||||
;;
|
||||
|
||||
'stop')
|
||||
# Stop daemon. We use a signal here to avoid having to know the
|
||||
# root password.
|
||||
|
||||
if test -s "$mysqld_pid_file_path"
|
||||
then
|
||||
# signal mysqld_safe that it needs to stop
|
||||
touch "$mysqld_pid_file_path.shutdown"
|
||||
|
||||
mysqld_pid=`cat "$mysqld_pid_file_path"`
|
||||
|
||||
if (kill -0 $mysqld_pid 2>/dev/null)
|
||||
then
|
||||
echo $echo_n "Shutting down MySQL"
|
||||
kill $mysqld_pid
|
||||
# mysqld should remove the pid file when it exits, so wait for it.
|
||||
wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$?
|
||||
else
|
||||
log_failure_msg "MySQL server process #$mysqld_pid is not running!"
|
||||
rm "$mysqld_pid_file_path"
|
||||
fi
|
||||
|
||||
# Delete lock for RedHat / SuSE
|
||||
if test -f "$lock_file_path"
|
||||
then
|
||||
rm -f "$lock_file_path"
|
||||
fi
|
||||
exit $return_value
|
||||
else
|
||||
log_failure_msg "MySQL server PID file could not be found!"
|
||||
fi
|
||||
;;
|
||||
|
||||
'restart')
|
||||
# Stop the service and regardless of whether it was
|
||||
# running or not, start it again.
|
||||
if $0 stop $other_args; then
|
||||
$0 start $other_args
|
||||
else
|
||||
log_failure_msg "Failed to stop running server, so refusing to try to start."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
'reload'|'force-reload')
|
||||
if test -s "$mysqld_pid_file_path" ; then
|
||||
read mysqld_pid < "$mysqld_pid_file_path"
|
||||
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
|
||||
touch "$mysqld_pid_file_path"
|
||||
else
|
||||
log_failure_msg "MySQL PID file could not be found!"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
'status')
|
||||
# First, check to see if pid file exists
|
||||
if test -s "$mysqld_pid_file_path" ; then
|
||||
read mysqld_pid < "$mysqld_pid_file_path"
|
||||
if kill -0 $mysqld_pid 2>/dev/null ; then
|
||||
log_success_msg "MySQL running ($mysqld_pid)"
|
||||
exit 0
|
||||
else
|
||||
log_failure_msg "MySQL is not running, but PID file exists"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Try to find appropriate mysqld process
|
||||
mysqld_pid=`pgrep -d' ' -f $libexecdir/mysqld`
|
||||
|
||||
# test if multiple pids exist
|
||||
pid_count=`echo $mysqld_pid | wc -w`
|
||||
if test $pid_count -gt 1 ; then
|
||||
log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
|
||||
exit 5
|
||||
elif test -z $mysqld_pid ; then
|
||||
if test -f "$lock_file_path" ; then
|
||||
log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists"
|
||||
exit 2
|
||||
fi
|
||||
log_failure_msg "MySQL is not running"
|
||||
exit 3
|
||||
else
|
||||
log_failure_msg "MySQL is running but PID file could not be found"
|
||||
exit 4
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# usage
|
||||
basename=`basename "$0"`
|
||||
echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
+624
-3
@@ -36,6 +36,26 @@ function myPost(method,args,callback, title){
|
||||
},'json');
|
||||
}
|
||||
|
||||
function myPostN(method,args,callback, title){
|
||||
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
_args = JSON.stringify(str2Obj(args));
|
||||
} else {
|
||||
_args = JSON.stringify(args);
|
||||
}
|
||||
|
||||
var _title = '正在获取...';
|
||||
if (typeof(title) != 'undefined'){
|
||||
_title = title;
|
||||
}
|
||||
$.post('/plugins/run', {name:'mysql', func:method, args:_args}, function(data) {
|
||||
if(typeof(callback) == 'function'){
|
||||
callback(data);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function myAsyncPost(method,args){
|
||||
var _args = null;
|
||||
if (typeof(args) == 'string'){
|
||||
@@ -822,6 +842,86 @@ function openPhpmyadmin(name,username,password){
|
||||
},200);
|
||||
}
|
||||
|
||||
function delBackup(filename,name){
|
||||
myPost('delete_db_backup',{filename:filename},function(){
|
||||
layer.msg('执行成功!');
|
||||
setTimeout(function(){
|
||||
$('.layui-layer-close2').click();
|
||||
setBackup(name);
|
||||
},2000);
|
||||
});
|
||||
}
|
||||
|
||||
function downloadBackup(file){
|
||||
window.open('/files/download?filename='+encodeURIComponent(file));
|
||||
}
|
||||
|
||||
function importBackup(file,name){
|
||||
myPost('import_db_backup',{file:file,name:name}, function(data){
|
||||
// console.log(data);
|
||||
layer.msg('执行成功!');
|
||||
});
|
||||
}
|
||||
|
||||
function setBackup(db_name,obj){
|
||||
myPost('get_db_backup_list', {name:db_name}, function(data){
|
||||
|
||||
var rdata = $.parseJSON(data.data);
|
||||
var tbody = '';
|
||||
for (var i = 0; i < rdata.data.length; i++) {
|
||||
tbody += '<tr>\
|
||||
<td><span> ' + rdata.data[i]['name'] + '</span></td>\
|
||||
<td><span> ' + rdata.data[i]['size'] + '</span></td>\
|
||||
<td><span> ' + rdata.data[i]['time'] + '</span></td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" onclick="importBackup(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">导入</a> | \
|
||||
<a class="btlink" onclick="downloadBackup(\'' + rdata.data[i]['file'] + '\')">下载</a> | \
|
||||
<a class="btlink" onclick="delBackup(\'' + rdata.data[i]['name'] + '\',\'' +db_name+ '\')">删除</a>\
|
||||
</td>\
|
||||
</tr> ';
|
||||
}
|
||||
|
||||
var s = layer.open({
|
||||
type: 1,
|
||||
title: "数据库备份详情",
|
||||
area: ['600px', '280px'],
|
||||
closeBtn: 2,
|
||||
shadeClose: false,
|
||||
content: '<div class="pd15">\
|
||||
<div class="db_list">\
|
||||
<button id="btn_backup" class="btn btn-success btn-sm" type="button">备份</button>\
|
||||
</div >\
|
||||
<div class="divtable">\
|
||||
<div id="database_fix" style="height:150px;overflow:auto;border:#ddd 1px solid">\
|
||||
<table class="table table-hover "style="border:none">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th>文件名称</th>\
|
||||
<th>文件大小</th>\
|
||||
<th>备份时间</th>\
|
||||
<th style="text-align: right;">操作</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody class="gztr">' + tbody + '</tbody>\
|
||||
</table>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>'
|
||||
});
|
||||
|
||||
$('#btn_backup').click(function(){
|
||||
myPost('set_db_backup',{name:db_name}, function(data){
|
||||
layer.msg('执行成功!');
|
||||
|
||||
setTimeout(function(){
|
||||
layer.close(s);
|
||||
setBackup(db_name,obj);
|
||||
},2000);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function dbList(page, search){
|
||||
var _data = {};
|
||||
@@ -847,10 +947,14 @@ function dbList(page, search){
|
||||
'<span onclick="showHidePass(this)" class="glyphicon glyphicon-eye-open cursor pw-ico" style="margin-left:10px"></span>'+
|
||||
'<span class="ico-copy cursor btcopy" style="margin-left:10px" title="复制密码" onclick="copyPass(\''+rdata.data[i]['password']+'\')"></span>'+
|
||||
'</td>';
|
||||
// list += '<td>备份</td>';
|
||||
|
||||
|
||||
list += '<td><span class="c9 input-edit" onclick="setDbPs(\''+rdata.data[i]['id']+'\',\''+rdata.data[i]['name']+'\',this)" style="display: inline-block;">'+rdata.data[i]['ps']+'</span></td>';
|
||||
list += '<td style="text-align:right">' +
|
||||
'<a href="javascript:;" class="btlink" onclick="openPhpmyadmin(\''+rdata.data[i]['name']+'\',\''+rdata.data[i]['username']+'\',\''+rdata.data[i]['password']+'\')" title="数据库管理">管理</a> | ' +
|
||||
list += '<td style="text-align:right">';
|
||||
|
||||
list += '<a href="javascript:;" class="btlink" class="btlink" onclick="setBackup(\''+rdata.data[i]['name']+'\',this)" title="数据库备份">'+(rdata.data[i]['is_backup']?'备份':'未备份') +'</a> | ';
|
||||
|
||||
list += '<a href="javascript:;" class="btlink" onclick="openPhpmyadmin(\''+rdata.data[i]['name']+'\',\''+rdata.data[i]['username']+'\',\''+rdata.data[i]['password']+'\')" title="数据库管理">管理</a> | ' +
|
||||
'<a href="javascript:;" class="btlink" onclick="repTools(\''+rdata.data[i]['name']+'\')" title="MySQL优化修复工具">工具</a> | ' +
|
||||
'<a href="javascript:;" class="btlink" onclick="setDbAccess(\''+rdata.data[i]['username']+'\')" title="设置数据库权限">权限</a> | ' +
|
||||
'<a href="javascript:;" class="btlink" onclick="setDbPass('+rdata.data[i]['id']+',\''+ rdata.data[i]['username'] +'\',\'' + rdata.data[i]['password'] + '\')">改密</a> | ' +
|
||||
@@ -864,6 +968,7 @@ function dbList(page, search){
|
||||
<button onclick="addDatabase()" title="添加数据库" class="btn btn-success btn-sm" type="button" style="margin-right: 5px;">添加数据库</button>\
|
||||
<button onclick="setRootPwd(0,\''+rdata.info['root_pwd']+'\')" title="设置MySQL管理员密码" class="btn btn-default btn-sm" type="button" style="margin-right: 5px;">root密码</button>\
|
||||
<button onclick="openPhpmyadmin(\'\',\'root\',\''+rdata.info['root_pwd']+'\')" title="打开phpMyadmin" class="btn btn-default btn-sm" type="button" style="margin-right: 5px;">phpMyAdmin</button>\
|
||||
<button onclick="setDbAccess(\'root\')" title="ROOT权限" class="btn btn-default btn-sm" type="button" style="margin-right: 5px;">ROOT权限</button>\
|
||||
<span style="float:right"> \
|
||||
<button batch="true" style="float: right;display: none;margin-left:10px;" onclick="delDbBatch();" title="删除选中项" class="btn btn-default btn-sm">删除选中</button>\
|
||||
</span>\
|
||||
@@ -1099,3 +1204,519 @@ function repTools(db_name, res){
|
||||
tableFixed('database_fix');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function setDbMaster(name){
|
||||
myPost('set_db_master', {name:name}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 });
|
||||
setTimeout(function(){
|
||||
masterOrSlaveConf();
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function setDbSlave(name){
|
||||
myPost('set_db_slave', {name:name}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 });
|
||||
setTimeout(function(){
|
||||
masterOrSlaveConf();
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function addMasterRepSlaveUser(){
|
||||
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
skin: 'demo-class',
|
||||
area: '500px',
|
||||
title: '添加同步账户',
|
||||
closeBtn: 1,
|
||||
shift: 5,
|
||||
shadeClose: true,
|
||||
content: "<form class='bt-form pd20 pb70' id='add_master'>\
|
||||
<div class='line'><span class='tname'>用户名</span><div class='info-r'><input name='username' class='bt-input-text mr5' placeholder='用户名' type='text' style='width:330px;' value='"+(randomStrPwd(6))+"'></div></div>\
|
||||
<div class='line'>\
|
||||
<span class='tname'>密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+(randomStrPwd(16))+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
</div>\
|
||||
<input type='hidden' name='ps' value='' />\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button id='my_mod_close' type='button' class='btn btn-danger btn-sm btn-title'>关闭</button>\
|
||||
<button type='button' class='btn btn-success btn-sm btn-title' id='submit_add_master' >提交</button>\
|
||||
</div>\
|
||||
</form>",
|
||||
});
|
||||
|
||||
// <div class='line'>\
|
||||
// <span class='tname'>访问权限</span>\
|
||||
// <div class='info-r '>\
|
||||
// <select class='bt-input-text mr5' name='dataAccess' style='width:100px'>\
|
||||
// <option value='127.0.0.1'>本地服务器</option>\
|
||||
// <option value=\"%\">所有人</option>\
|
||||
// <option value='ip'>指定IP</option>\
|
||||
// </select>\
|
||||
// </div>\
|
||||
// </div>\
|
||||
|
||||
$("input[name='name']").keyup(function(){
|
||||
var v = $(this).val();
|
||||
$("input[name='db_user']").val(v);
|
||||
$("input[name='ps']").val(v);
|
||||
});
|
||||
|
||||
$('#my_mod_close').click(function(){
|
||||
$('.layui-layer-close1').click();
|
||||
});
|
||||
$('select[name="dataAccess"]').change(function(){
|
||||
var v = $(this).val();
|
||||
if (v == 'ip'){
|
||||
$(this).after("<input id='dataAccess_subid' class='bt-input-text mr5' type='text' name='address' placeholder='多个IP使用逗号(,)分隔' style='width: 230px; display: inline-block;'>");
|
||||
} else {
|
||||
$('#dataAccess_subid').remove();
|
||||
}
|
||||
});
|
||||
|
||||
$('#submit_add_master').click(function(){
|
||||
|
||||
var data = $("#add_master").serialize();
|
||||
data = decodeURIComponent(data);
|
||||
var dataObj = str2Obj(data);
|
||||
if(!dataObj['address']){
|
||||
dataObj['address'] = dataObj['dataAccess'];
|
||||
}
|
||||
// console.log(dataObj);
|
||||
myPost('add_master_rep_slave_user', dataObj, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
showMsg(rdata.msg,function(){
|
||||
if (rdata.status){
|
||||
getMasterRepSlaveList();
|
||||
}
|
||||
$('.layui-layer-close1').click();
|
||||
},{icon: rdata.status ? 1 : 2},600);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateMasterRepSlaveUser(username){
|
||||
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
skin: 'demo-class',
|
||||
area: '500px',
|
||||
title: '更新账户',
|
||||
closeBtn: 1,
|
||||
shift: 5,
|
||||
shadeClose: true,
|
||||
content: "<form class='bt-form pd20 pb70' id='update_master'>\
|
||||
<div class='line'><span class='tname'>用户名</span><div class='info-r'><input name='username' readonly='readonly' class='bt-input-text mr5' placeholder='用户名' type='text' style='width:330px;' value='"+username+"'></div></div>\
|
||||
<div class='line'>\
|
||||
<span class='tname'>密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+(randomStrPwd(16))+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
</div>\
|
||||
<input type='hidden' name='ps' value='' />\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button type='button' class='btn btn-success btn-sm btn-title' id='submit_update_master' >提交</button>\
|
||||
</div>\
|
||||
</form>",
|
||||
});
|
||||
|
||||
$('#submit_update_master').click(function(){
|
||||
var data = $("#update_master").serialize();
|
||||
data = decodeURIComponent(data);
|
||||
var dataObj = str2Obj(data);
|
||||
// console.log(dataObj);
|
||||
myPost('update_master_rep_slave_user', data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
showMsg(rdata.msg,function(){
|
||||
if (rdata.status){
|
||||
getMasterRepSlaveList();
|
||||
}
|
||||
$('.layui-layer-close1').click();
|
||||
},{icon: rdata.status ? 1 : 2},600);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getMasterRepSlaveUserCmd(username, db=''){
|
||||
myPost('get_master_rep_slave_user_cmd', {username:username,db:db}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
if (!rdata['status']){
|
||||
layer.msg(rdata['msg']);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '同步命令',
|
||||
area: '500px',
|
||||
content:"<form class='bt-form pd20 pb70' id='add_master'>\
|
||||
<div class='line'>"+rdata.data+"</div>\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button type='button' class='btn btn-success btn-sm btn-title class-copy-cmd'>复制</button>\
|
||||
</div>\
|
||||
</form>",
|
||||
});
|
||||
|
||||
copyPass(rdata.data);
|
||||
$('.class-copy-cmd').click(function(){
|
||||
copyPass(rdata.data);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function delMasterRepSlaveUser(username){
|
||||
myPost('del_master_rep_slave_user', {username:username}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg);
|
||||
|
||||
$('.layui-layer-close1').click();
|
||||
|
||||
setTimeout(function(){
|
||||
getMasterRepSlaveList();
|
||||
},1000);
|
||||
});
|
||||
}
|
||||
|
||||
function getMasterRepSlaveList(){
|
||||
var _data = {};
|
||||
if (typeof(page) =='undefined'){
|
||||
var page = 1;
|
||||
}
|
||||
|
||||
_data['page'] = page;
|
||||
_data['page_size'] = 10;
|
||||
myPost('get_master_rep_slave_list', _data, function(data){
|
||||
// console.log(data);
|
||||
var rdata = [];
|
||||
try {
|
||||
rdata = $.parseJSON(data.data);
|
||||
} catch(e){
|
||||
console.log(e);
|
||||
}
|
||||
var list = '';
|
||||
// console.log(rdata['data']);
|
||||
var user_list = rdata['data'];
|
||||
for (i in user_list) {
|
||||
// console.log(i);
|
||||
var name = user_list[i]['username'];
|
||||
list += '<tr><td>'+name+'</td>\
|
||||
<td>'+user_list[i]['password']+'</td>\
|
||||
<td>\
|
||||
<a class="btlink" onclick="updateMasterRepSlaveUser(\''+name+'\');">修改</a> | \
|
||||
<a class="btlink" onclick="delMasterRepSlaveUser(\''+name+'\');">删除</a> | \
|
||||
<a class="btlink" onclick="getMasterRepSlaveUserCmd(\''+name+'\');">从库同步命令</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
}
|
||||
|
||||
var page = '<div class="dataTables_paginate_4 dataTables_paginate paging_bootstrap page" style="margin-top:0px;"></div>';
|
||||
page += '<div class="table_toolbar"><span class="sync btn btn-default btn-sm" onclick="addMasterRepSlaveUser()" title="">添加同步账户</span></div>';
|
||||
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '同步账户列表',
|
||||
area: '500px',
|
||||
content:"<div class='bt-form pd20 c6'>\
|
||||
<div class='divtable mtb10'>\
|
||||
<div><table class='table table-hover'>\
|
||||
<thead><tr><th>用户民</th><th>密码</th><th>操作</th></tr></thead>\
|
||||
<tbody>" + list + "</tbody>\
|
||||
</table></div>\
|
||||
"+page +"\
|
||||
</div>\
|
||||
</div>"
|
||||
});
|
||||
|
||||
$('.dataTables_paginate_4').html(rdata['page']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function deleteSlave(){
|
||||
myPost('delete_slave', {}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata['msg']);
|
||||
setTimeout(function(){
|
||||
masterOrSlaveConf();
|
||||
}, 3000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getFullSyncStatus(db){
|
||||
|
||||
var btn = '<div class="table_toolbar"><span class="sync btn btn-default btn-sm" id="begin_full_sync" title="">开始</span></div>';
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '全量同步['+db+']',
|
||||
area: '500px',
|
||||
content:"<div class='bt-form pd20 c6'>\
|
||||
<div class='divtable mtb10'>\
|
||||
<span id='full_msg'></span>\
|
||||
<div class='progress'>\
|
||||
<div class='progress-bar' role='progressbar' aria-valuenow='0' aria-valuemin='0' aria-valuemax='100' style='min-width: 2em;'>0%</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
"+btn+"\
|
||||
</div>"
|
||||
});
|
||||
|
||||
var timeId = setInterval(function(){
|
||||
fullSync(db,0);
|
||||
}, 1000);
|
||||
|
||||
function fullSync(db,begin){
|
||||
|
||||
myPostN('full_sync', {db:db,begin:begin}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
$('#full_msg').text(rdata['msg']);
|
||||
$('.progress-bar').css('width',rdata['progress']+'%');
|
||||
$('.progress-bar').text(rdata['progress']+'%');
|
||||
|
||||
if (rdata['code']==6 ||rdata['code']<0){
|
||||
layer.msg(rdata['msg']);
|
||||
clearInterval(timeId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fullSync(db,0);
|
||||
$('#begin_full_sync').click(function(){
|
||||
fullSync(db,1);
|
||||
|
||||
timeId= setTimeout(function(){
|
||||
fullSync(db,0);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
$('.layui-layer-close1').click(function(){
|
||||
clearInterval(timeId);
|
||||
});
|
||||
}
|
||||
|
||||
function handlerRun(){
|
||||
cmd = 'cd /www/server/mdserver-web && python /www/server/mdserver-web/plugins/mysql/index.py do_full_sync {"db":"all"}';
|
||||
var loadOpen = layer.open({
|
||||
type: 1,
|
||||
title: '手动执行',
|
||||
area: '500px',
|
||||
content:"<form class='bt-form pd20 pb70' id='add_master'>\
|
||||
<div class='line'>"+cmd+"</div>\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button type='button' class='btn btn-success btn-sm btn-title class-copy-cmd'>复制</button>\
|
||||
</div>\
|
||||
</form>",
|
||||
});
|
||||
copyPass(cmd);
|
||||
$('.class-copy-cmd').click(function(){
|
||||
copyPass(cmd);
|
||||
});
|
||||
}
|
||||
|
||||
function masterOrSlaveConf(version=''){
|
||||
|
||||
function getMasterDbList(){
|
||||
var _data = {};
|
||||
if (typeof(page) =='undefined'){
|
||||
var page = 1;
|
||||
}
|
||||
|
||||
_data['page'] = page;
|
||||
_data['page_size'] = 10;
|
||||
|
||||
myPost('get_masterdb_list', _data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
var list = '';
|
||||
for(i in rdata.data){
|
||||
list += '<tr>';
|
||||
list += '<td>' + rdata.data[i]['name'] +'</td>';
|
||||
list += '<td>' + (rdata.data[i]['master']?'是':'否') +'</td>';
|
||||
list += '<td style="text-align:right">' +
|
||||
'<a href="javascript:;" class="btlink" onclick="setDbMaster(\''+rdata.data[i]['name']+'\')" title="加入或退出">'+(rdata.data[i]['master']?'退出':'加入')+'</a> | ' +
|
||||
'<a href="javascript:;" class="btlink" onclick="getMasterRepSlaveUserCmd(\'\',\''+rdata.data[i]['name']+'\')" title="同步命令">同步命令</a>' +
|
||||
'</td>';
|
||||
list += '</tr>';
|
||||
}
|
||||
|
||||
var con = '<div class="divtable mtb10">\
|
||||
<div class="tablescroll">\
|
||||
<table id="DataBody" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">\
|
||||
<thead><tr>\
|
||||
<th>数据库名</th>\
|
||||
<th>同步</th>\
|
||||
<th style="text-align:right;">操作</th></tr></thead>\
|
||||
<tbody>\
|
||||
'+ list +'\
|
||||
</tbody></table>\
|
||||
</div>\
|
||||
<div id="databasePage" class="dataTables_paginate paging_bootstrap page"></div>\
|
||||
<div class="table_toolbar">\
|
||||
<span class="sync btn btn-default btn-sm" onclick="getMasterRepSlaveList()" title="">同步账户列表</span>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
$(".table_master_list").html(con);
|
||||
$('#databasePage').html(rdata.page);
|
||||
});
|
||||
}
|
||||
|
||||
function getAsyncMasterDbList(){
|
||||
var _data = {};
|
||||
if (typeof(page) =='undefined'){
|
||||
var page = 1;
|
||||
}
|
||||
|
||||
_data['page'] = page;
|
||||
_data['page_size'] = 10;
|
||||
|
||||
myPost('get_slave_list', _data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
var list = '';
|
||||
for(i in rdata.data){
|
||||
list += '<tr>';
|
||||
list += '<td>' + rdata.data[i]['Master_Host'] +'</td>';
|
||||
list += '<td>' + rdata.data[i]['Master_Port'] +'</td>';
|
||||
list += '<td>' + rdata.data[i]['Master_User'] +'</td>';
|
||||
list += '<td>' + rdata.data[i]['Master_Log_File'] +'</td>';
|
||||
list += '<td>' + rdata.data[i]['Slave_IO_Running'] +'</td>';
|
||||
list += '<td>' + rdata.data[i]['Slave_SQL_Running'] +'</td>';
|
||||
list += '<td style="text-align:right">' +
|
||||
'<a href="javascript:;" class="btlink" onclick="deleteSlave()" title="删除">删除</a>' +
|
||||
'</td>';
|
||||
list += '</tr>';
|
||||
}
|
||||
|
||||
var con = '<div class="divtable mtb10">\
|
||||
<div class="tablescroll">\
|
||||
<table id="DataBody" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">\
|
||||
<thead><tr>\
|
||||
<th>主[服务]</th>\
|
||||
<th>端口</th>\
|
||||
<th>用户</th>\
|
||||
<th>日志</th>\
|
||||
<th>IO</th>\
|
||||
<th>SQL</th>\
|
||||
<th style="text-align:right;">操作</th></tr></thead>\
|
||||
<tbody>\
|
||||
'+ list +'\
|
||||
</tbody></table>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
// <div id="databasePage_slave" class="dataTables_paginate paging_bootstrap page"></div>\
|
||||
// <div class="table_toolbar">\
|
||||
// <span class="sync btn btn-default btn-sm" onclick="getMasterRepSlaveList()" title="">添加</span>\
|
||||
// </div>
|
||||
$(".table_slave_status_list").html(con);
|
||||
});
|
||||
}
|
||||
|
||||
function getAsyncDataList(){
|
||||
var _data = {};
|
||||
if (typeof(page) =='undefined'){
|
||||
var page = 1;
|
||||
}
|
||||
|
||||
_data['page'] = page;
|
||||
_data['page_size'] = 10;
|
||||
myPost('get_masterdb_list', _data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
var list = '';
|
||||
for(i in rdata.data){
|
||||
list += '<tr>';
|
||||
list += '<td>' + rdata.data[i]['name'] +'</td>';
|
||||
list += '<td style="text-align:right">' +
|
||||
'<a href="javascript:;" class="btlink" onclick="setDbSlave(\''+rdata.data[i]['name']+'\')" title="加入|退出">'+(rdata.data[i]['slave']?'退出':'加入')+'</a> | ' +
|
||||
'<a href="javascript:;" class="btlink" onclick="getFullSyncStatus(\''+rdata.data[i]['name']+'\')" title="修复">修复</a>' +
|
||||
'</td>';
|
||||
list += '</tr>';
|
||||
}
|
||||
|
||||
var con = '<div class="divtable mtb10">\
|
||||
<div class="tablescroll">\
|
||||
<table id="DataBody" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">\
|
||||
<thead><tr>\
|
||||
<th>本地库名</th>\
|
||||
<th style="text-align:right;">操作</th></tr></thead>\
|
||||
<tbody>\
|
||||
'+ list +'\
|
||||
</tbody></table>\
|
||||
</div>\
|
||||
<div id="databasePage" class="dataTables_paginate paging_bootstrap page"></div>\
|
||||
<div class="table_toolbar">\
|
||||
<span class="sync btn btn-default btn-sm" onclick="handlerRun()" title="免登录设置后,需要手动执行一下!">手动命令</span>\
|
||||
<span class="sync btn btn-default btn-sm" onclick="getFullSyncStatus(\'ALL\')" title="全量同步">全量同步</span>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
$(".table_slave_list").html(con);
|
||||
$('#databasePage').html(rdata.page);
|
||||
});
|
||||
}
|
||||
|
||||
function getMasterStatus(){
|
||||
myPost('get_master_status', '', function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
var limitCon = '<p class="conf_p">\
|
||||
<span class="f14 c6 mr20">Master[主]配置</span><span class="f14 c6 mr20"></span>\
|
||||
<button class="btn '+(!rdata.status ? 'btn-danger' : 'btn-success')+' btn-xs btn-master va0">'+(!rdata.status ? '未开启' : '已开启') +'</button><hr/>\
|
||||
</p>\
|
||||
<!-- master list -->\
|
||||
<div class="safe bgw table_master_list"></div>\
|
||||
<hr/>\
|
||||
<p class="conf_p">\
|
||||
<span class="f14 c6 mr20">Slave[从]配置</span><span class="f14 c6 mr20"></span>\
|
||||
<button class="btn '+(!rdata.data.slave_status ? 'btn-danger' : 'btn-success')+' btn-xs btn-slave va0">'+(!rdata.data.slave_status ? '未启动' : '已启动') +'</button><hr/>\
|
||||
</p>\
|
||||
<!-- slave status list -->\
|
||||
<div class="safe bgw table_slave_status_list"></div>\
|
||||
<!-- slave list -->\
|
||||
<div class="safe bgw table_slave_list"></div>\
|
||||
';
|
||||
$(".soft-man-con").html(limitCon);
|
||||
|
||||
//设置主服务器配置
|
||||
$(".btn-master").click(function () {
|
||||
myPost('set_master_status', 'close=change', function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 });
|
||||
setTimeout(function(){
|
||||
getMasterStatus();
|
||||
}, 3000);
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-slave").click(function () {
|
||||
myPost('set_slave_status', 'close=change', function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 });
|
||||
setTimeout(function(){
|
||||
getMasterStatus();
|
||||
}, 3000);
|
||||
});
|
||||
});
|
||||
|
||||
if (rdata.status){
|
||||
getMasterDbList();
|
||||
}
|
||||
|
||||
if (rdata.data.slave_status){
|
||||
getAsyncMasterDbList();
|
||||
getAsyncDataList()
|
||||
}
|
||||
});
|
||||
}
|
||||
getMasterStatus();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
|
||||
sysName=`uname`
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mysqlDir=${serverPath}/source/mysql
|
||||
@@ -19,11 +19,12 @@ Install_mysql()
|
||||
mkdir -p ${mysqlDir}
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
mkdir -p /var/log/mariadb
|
||||
touch /var/log/mariadb/mariadb.log
|
||||
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
mkdir -p /var/log/mariadb
|
||||
touch /var/log/mariadb/mariadb.log
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
fi
|
||||
|
||||
if [ ! -f ${mysqlDir}/mysql-5.5.62.tar.gz ];then
|
||||
wget -O ${mysqlDir}/mysql-5.5.62.tar.gz https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.62.tar.gz
|
||||
|
||||
@@ -11,6 +11,7 @@ curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sysName=`uname`
|
||||
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
@@ -21,23 +22,25 @@ Install_mysql()
|
||||
mkdir -p ${mysqlDir}
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
mkdir -p /var/log/mariadb
|
||||
touch /var/log/mariadb/mariadb.log
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
mkdir -p /var/log/mariadb
|
||||
touch /var/log/mariadb/mariadb.log
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
fi
|
||||
|
||||
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
|
||||
if [ ! -f ${mysqlDir}/mysql-5.6.46.tar.gz ];then
|
||||
wget -O ${mysqlDir}/mysql-5.6.46.tar.gz https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.46.tar.gz
|
||||
if [ ! -f ${mysqlDir}/mysql-5.6.50.tar.gz ];then
|
||||
wget -O ${mysqlDir}/mysql-5.6.50.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.50.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${mysqlDir}/mysql-5.6.46 ];then
|
||||
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-5.6.46.tar.gz
|
||||
if [ ! -d ${mysqlDir}/mysql-5.6.50 ];then
|
||||
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-5.6.50.tar.gz
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -d $serverPath/mysql ];then
|
||||
cd ${mysqlDir}/mysql-5.6.46 && cmake \
|
||||
cd ${mysqlDir}/mysql-5.6.50 && cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
|
||||
-DMYSQL_USER=mysql \
|
||||
-DMYSQL_TCP_PORT=3306 \
|
||||
|
||||
@@ -11,7 +11,7 @@ curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
# sysName=`uname`
|
||||
sysName=`uname`
|
||||
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
@@ -22,22 +22,23 @@ Install_mysql()
|
||||
mkdir -p ${mysqlDir}
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
mkdir -p /var/log/mariadb
|
||||
touch /var/log/mariadb/mariadb.log
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
mkdir -p /var/log/mariadb
|
||||
touch /var/log/mariadb/mariadb.log
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
fi
|
||||
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
|
||||
if [ ! -f ${mysqlDir}/mysql-boost-5.7.28.tar.gz ];then
|
||||
wget -O ${mysqlDir}/mysql-boost-5.7.28.tar.gz https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.28.tar.gz
|
||||
if [ ! -f ${mysqlDir}/mysql-boost-5.7.32.tar.gz ];then
|
||||
wget -O ${mysqlDir}/mysql-boost-5.7.32.tar.gz https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.32.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${mysqlDir}/mysql-5.7.28 ];then
|
||||
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-5.7.28.tar.gz
|
||||
if [ ! -d ${mysqlDir}/mysql-5.7.32 ];then
|
||||
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-5.7.32.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mysql ];then
|
||||
cd ${mysqlDir}/mysql-5.7.28 && cmake \
|
||||
cd ${mysqlDir}/mysql-5.7.32 && cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
|
||||
-DMYSQL_USER=mysql \
|
||||
-DMYSQL_TCP_PORT=3306 \
|
||||
|
||||
Executable
+78
@@ -0,0 +1,78 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/bin/bash
|
||||
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
#https://dev.mysql.com/downloads/mysql/5.7.html
|
||||
#https://dev.mysql.com/downloads/file/?id=489855
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sysName=`uname`
|
||||
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mysqlDir=${serverPath}/source/mysql
|
||||
|
||||
Install_mysql()
|
||||
{
|
||||
mkdir -p ${mysqlDir}
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
INSTALL_CMD=cmake
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
mkdir -p /var/log/mariadb
|
||||
touch /var/log/mariadb/mariadb.log
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
|
||||
yum install -y cmake3
|
||||
INSTALL_CMD=cmake3
|
||||
fi
|
||||
|
||||
if [ ! -f ${mysqlDir}/mysql-boost-8.0.22.tar.gz ];then
|
||||
wget -O ${mysqlDir}/mysql-boost-8.0.22.tar.gz https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.22.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d ${mysqlDir}/mysql-8.0.22 ];then
|
||||
cd ${mysqlDir} && tar -zxvf ${mysqlDir}/mysql-boost-8.0.22.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mysql ];then
|
||||
cd ${mysqlDir}/mysql-8.0.22 && ${INSTALL_CMD} \
|
||||
-DCMAKE_INSTALL_PREFIX=$serverPath/mysql \
|
||||
-DMYSQL_USER=mysql \
|
||||
-DMYSQL_TCP_PORT=3306 \
|
||||
-DMYSQL_UNIX_ADDR=/var/tmp/mysql.sock \
|
||||
-DWITH_MYISAM_STORAGE_ENGINE=1 \
|
||||
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
|
||||
-DWITH_MEMORY_STORAGE_ENGINE=1 \
|
||||
-DENABLED_LOCAL_INFILE=1 \
|
||||
-DWITH_PARTITION_STORAGE_ENGINE=1 \
|
||||
-DEXTRA_CHARSETS=all \
|
||||
-DDEFAULT_CHARSET=utf8 \
|
||||
-DDEFAULT_COLLATION=utf8_general_ci \
|
||||
-DDOWNLOAD_BOOST=1 \
|
||||
-DFORCE_INSOURCE_BUILD=1 \
|
||||
-DWITH_BOOST=${mysqlDir}/mysql-8.0.22/boost/
|
||||
make && make install && make clean
|
||||
echo '8.0' > $serverPath/mysql/version.pl
|
||||
echo '安装完成' > $install_tmp
|
||||
fi
|
||||
}
|
||||
|
||||
Uninstall_mysql()
|
||||
{
|
||||
rm -rf $serverPath/mysql
|
||||
echo '卸载完成' > $install_tmp
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_mysql
|
||||
else
|
||||
Uninstall_mysql
|
||||
fi
|
||||
@@ -1,7 +1,7 @@
|
||||
lua_shared_dict limit 30m;
|
||||
lua_shared_dict drop_ip 30m;
|
||||
lua_shared_dict drop_sum 30m;
|
||||
lua_package_path "{$WAF_PATH}/lua/?.lua";
|
||||
lua_package_path "{$WAF_PATH}/lua/?.lua;{$ROOT_PATH}/openresty/lualib/?.lua;;";
|
||||
access_by_lua_file {$WAF_PATH}/lua/init.lua;
|
||||
|
||||
#init_by_lua_file {$WAF_PATH}/lua/init.lua;
|
||||
|
||||
+13
-13
@@ -172,10 +172,6 @@ def initTotalInfo():
|
||||
|
||||
|
||||
def status():
|
||||
initDomainInfo()
|
||||
initSiteInfo()
|
||||
initTotalInfo()
|
||||
|
||||
path = getConf()
|
||||
if not os.path.exists(path):
|
||||
return 'stop'
|
||||
@@ -199,19 +195,19 @@ def contentReplace(content):
|
||||
|
||||
def initDreplace():
|
||||
|
||||
config = getPluginDir() + '/waf/config.json'
|
||||
content = mw.readFile(config)
|
||||
content = json.loads(content)
|
||||
content['reqfile_path'] = mw.getServerDir(
|
||||
) + "/openresty/nginx/conf/waf/html"
|
||||
mw.writeFile(config, mw.getJson(content))
|
||||
|
||||
path = mw.getServerDir() + "/openresty/nginx/conf"
|
||||
if not os.path.exists(path + '/waf'):
|
||||
sdir = getPluginDir() + '/waf'
|
||||
cmd = 'cp -rf ' + sdir + ' ' + path
|
||||
mw.execShell(cmd)
|
||||
|
||||
config = mw.getServerDir() + '/openresty/nginx/conf/waf/config.json'
|
||||
content = mw.readFile(config)
|
||||
content = json.loads(content)
|
||||
content['reqfile_path'] = mw.getServerDir(
|
||||
) + "/openresty/nginx/conf/waf/html"
|
||||
mw.writeFile(config, mw.getJson(content))
|
||||
|
||||
config = mw.getServerDir() + "/openresty/nginx/conf/waf/lua/init.lua"
|
||||
content = mw.readFile(config)
|
||||
content = contentReplace(content)
|
||||
@@ -223,6 +219,10 @@ def initDreplace():
|
||||
content = contentReplace(content)
|
||||
mw.writeFile(waf_conf, content)
|
||||
|
||||
initDomainInfo()
|
||||
initSiteInfo()
|
||||
initTotalInfo()
|
||||
|
||||
|
||||
def start():
|
||||
initDreplace()
|
||||
@@ -669,7 +669,7 @@ def setCcConf():
|
||||
|
||||
|
||||
def setSiteCcConf():
|
||||
return mw.returnJson(True, '设置成功-?!', [])
|
||||
return mw.returnJson(False, '暂未开发!', [])
|
||||
|
||||
|
||||
def saveScanRule():
|
||||
@@ -986,4 +986,4 @@ if __name__ == "__main__":
|
||||
elif func == 'waf_site':
|
||||
print getWafSite()
|
||||
else:
|
||||
print 'error'
|
||||
print('error')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"OP防火墙[DEV]",
|
||||
"title":"OP防火墙",
|
||||
"tip":"soft",
|
||||
"name":"op_waf",
|
||||
"type":"其他插件",
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"reqfile_path":"/Users/midoks/Desktop/fwww/server/openresty/nginx/conf/waf/html","retry":{"retry_time":180,"is_open_global":0,"retry":6,"retry_cycle":60},"log":true,"scan":{"status":444,"ps":"过滤常见扫描测试工具的渗透测试","open":true,"reqfile":""},"cc":{"status":444,"ps":"过虑CC攻击","limit":120,"endtime":300,"open":true,"reqfile":"","cycle":60},"get":{"status":403,"ps":"过滤uri、uri参数中常见sql注入、xss等攻击","open":true,"reqfile":"get.html"},"log_save":30,"user-agent":{"status":403,"ps":"通常用于过滤浏览器、蜘蛛及一些自动扫描器","open":true,"reqfile":"user_agent.html"},"other":{"status":403,"ps":"其它非通用过滤","reqfile":"other.html"},"cookie":{"status":403,"ps":"过滤利用Cookie发起的渗透攻击","open":true,"reqfile":"cookie.html"},"logs_path":"/www/wwwlogs/btwaf","post":{"status":403,"ps":"过滤POST参数中常见sql注入、xss等攻击","open":true,"reqfile":"post.html"},"open":true}
|
||||
{"reqfile_path": "{$WAF_PATH}/html", "retry": {"retry_time": 180, "is_open_global": 0, "retry": 6, "retry_cycle": 60}, "log": true, "scan": {"status": 444, "ps": "\u8fc7\u6ee4\u5e38\u89c1\u626b\u63cf\u6d4b\u8bd5\u5de5\u5177\u7684\u6e17\u900f\u6d4b\u8bd5", "open": true, "reqfile": ""}, "cc": {"status": 444, "ps": "\u8fc7\u8651CC\u653b\u51fb", "limit": 120, "endtime": 300, "open": true, "reqfile": "", "cycle": 60}, "get": {"status": 403, "ps": "\u8fc7\u6ee4uri\u3001uri\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "get.html"}, "log_save": 30, "user-agent": {"status": 403, "ps": "\u901a\u5e38\u7528\u4e8e\u8fc7\u6ee4\u6d4f\u89c8\u5668\u3001\u8718\u86db\u53ca\u4e00\u4e9b\u81ea\u52a8\u626b\u63cf\u5668", "open": true, "reqfile": "user_agent.html"}, "other": {"status": 403, "ps": "\u5176\u5b83\u975e\u901a\u7528\u8fc7\u6ee4", "reqfile": "other.html"}, "cookie": {"status": 403, "ps": "\u8fc7\u6ee4\u5229\u7528Cookie\u53d1\u8d77\u7684\u6e17\u900f\u653b\u51fb", "open": true, "reqfile": "cookie.html"}, "logs_path": "/www/wwwlogs/btwaf", "post": {"status": 403, "ps": "\u8fc7\u6ee4POST\u53c2\u6570\u4e2d\u5e38\u89c1sql\u6ce8\u5165\u3001xss\u7b49\u653b\u51fb", "open": true, "reqfile": "post.html"}, "open": true}
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
local cpath = "/Users/midoks/Desktop/fwww/server/openresty/nginx/conf/waf/"
|
||||
local rpath = "/Users/midoks/Desktop/fwww/server/openresty/nginx/conf/waf/rule/"
|
||||
local logdir = "/Users/midoks/Desktop/fwww/wwwlogs/waf/"
|
||||
local cpath = "{$WAF_PATH}/"
|
||||
local rpath = "{$WAF_PATH}/rule/"
|
||||
local logdir = "{$ROOT_PATH}/wwwlogs/waf/"
|
||||
local json = require "cjson"
|
||||
local ngx_match = ngx.re.find
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
"home":"http://openresty.org",
|
||||
"date":"2017-11-24",
|
||||
"pid": "1",
|
||||
"versions": ["1.11.2.5", "1.13.6.2","1.15.8.3"],
|
||||
"updates": ["1.11.2.5", "1.13.6.2","1.15.8.3 "]
|
||||
"versions": ["1.11.2.5", "1.13.6.2","1.15.8.3","1.19.3.1"],
|
||||
"updates": ["1.11.2.5", "1.13.6.2","1.15.8.3","1.19.3.1"]
|
||||
}
|
||||
@@ -20,7 +20,8 @@ if id www &> /dev/null ;then
|
||||
echo "www Shell is `grep "^www:" /etc/passwd |cut -d':' -f7 `"
|
||||
else
|
||||
groupadd www
|
||||
useradd -g www -s /sbin/nologin www
|
||||
# useradd -g www -s /sbin/nologin www
|
||||
useradd -g www -s /bin/bash www
|
||||
fi
|
||||
|
||||
Install_openresty()
|
||||
@@ -39,6 +40,7 @@ Install_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
|
||||
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" ?>
|
||||
<configuration>
|
||||
|
||||
All relative paths in this config are relative to php's install prefix
|
||||
|
||||
<section name="global_options">
|
||||
|
||||
Pid file
|
||||
<value name="pid_file">/www/server/php/52/logs/php-fpm.pid</value>
|
||||
|
||||
Error log file
|
||||
<value name="error_log">/www/server/php/52/logs/php-fpm.log</value>
|
||||
|
||||
Log level
|
||||
<value name="log_level">notice</value>
|
||||
|
||||
When this amount of php processes exited with SIGSEGV or SIGBUS ...
|
||||
<value name="emergency_restart_threshold">10</value>
|
||||
|
||||
... in a less than this interval of time, a graceful restart will be initiated.
|
||||
Useful to work around accidental curruptions in accelerator's shared memory.
|
||||
<value name="emergency_restart_interval">1m</value>
|
||||
|
||||
Time limit on waiting child's reaction on signals from master
|
||||
<value name="process_control_timeout">5s</value>
|
||||
|
||||
Set to 'no' to debug fpm
|
||||
<value name="daemonize">yes</value>
|
||||
|
||||
</section>
|
||||
|
||||
<workers>
|
||||
|
||||
<section name="pool">
|
||||
|
||||
Name of pool. Used in logs and stats.
|
||||
<value name="name">default</value>
|
||||
|
||||
Address to accept fastcgi requests on.
|
||||
Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
|
||||
<value name="listen_address">/tmp/php-cgi-52.sock</value>
|
||||
|
||||
<value name="listen_options">
|
||||
|
||||
Set listen(2) backlog
|
||||
<value name="backlog">-1</value>
|
||||
|
||||
Set permissions for unix socket, if one used.
|
||||
In Linux read/write permissions must be set in order to allow connections from web server.
|
||||
Many BSD-derrived systems allow connections regardless of permissions.
|
||||
<value name="owner">www</value>
|
||||
<value name="group">www</value>
|
||||
<value name="mode">0666</value>
|
||||
</value>
|
||||
|
||||
Additional php.ini defines, specific to this pool of workers.
|
||||
<value name="php_defines">
|
||||
<!-- <value name="sendmail_path">/usr/sbin/sendmail -t -i</value> -->
|
||||
<!-- <value name="display_errors">0</value> -->
|
||||
</value>
|
||||
|
||||
Unix user of processes
|
||||
<value name="user">www</value>
|
||||
|
||||
Unix group of processes
|
||||
<value name="group">www</value>
|
||||
|
||||
Process manager settings
|
||||
<value name="pm">
|
||||
|
||||
Sets style of controling worker process count.
|
||||
Valid values are 'static' and 'apache-like'
|
||||
<value name="style">static</value>
|
||||
|
||||
Sets the limit on the number of simultaneous requests that will be served.
|
||||
Equivalent to Apache MaxClients directive.
|
||||
Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
|
||||
Used with any pm_style.
|
||||
<value name="max_children">5</value>
|
||||
|
||||
Settings group for 'apache-like' pm style
|
||||
<value name="apache_like">
|
||||
|
||||
Sets the number of server processes created on startup.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="StartServers">20</value>
|
||||
|
||||
Sets the desired minimum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="MinSpareServers">5</value>
|
||||
|
||||
Sets the desired maximum number of idle server processes.
|
||||
Used only when 'apache-like' pm_style is selected
|
||||
<value name="MaxSpareServers">35</value>
|
||||
|
||||
</value>
|
||||
|
||||
</value>
|
||||
|
||||
The timeout (in seconds) for serving a single request after which the worker process will be terminated
|
||||
Should be used when 'max_execution_time' ini option does not stop script execution for some reason
|
||||
'0s' means 'off'
|
||||
<value name="request_terminate_timeout">0s</value>
|
||||
|
||||
The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
|
||||
'0s' means 'off'
|
||||
<value name="request_slowlog_timeout">0s</value>
|
||||
|
||||
The log file for slow requests
|
||||
<value name="slowlog">logs/slow.log</value>
|
||||
|
||||
Set open file desc rlimit
|
||||
<value name="rlimit_files">1024</value>
|
||||
|
||||
Set max core size rlimit
|
||||
<value name="rlimit_core">0</value>
|
||||
|
||||
Chroot to this directory at the start, absolute path
|
||||
<value name="chroot"></value>
|
||||
|
||||
Chdir to this directory at the start, absolute path
|
||||
<value name="chdir"></value>
|
||||
|
||||
Redirect workers' stdout and stderr into main error log.
|
||||
If not set, they will be redirected to /dev/null, according to FastCGI specs
|
||||
<value name="catch_workers_output">yes</value>
|
||||
|
||||
How much requests each process should execute before respawn.
|
||||
Useful to work around memory leaks in 3rd party libraries.
|
||||
For endless request processing please specify 0
|
||||
Equivalent to PHP_FCGI_MAX_REQUESTS
|
||||
<value name="max_requests">500</value>
|
||||
|
||||
Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
|
||||
Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
|
||||
Makes sense only with AF_INET listening socket.
|
||||
<value name="allowed_clients">127.0.0.1</value>
|
||||
|
||||
Pass environment variables like LD_LIBRARY_PATH
|
||||
All $VARIABLEs are taken from current environment
|
||||
<value name="environment">
|
||||
<value name="HOSTNAME">$HOSTNAME</value>
|
||||
<value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
|
||||
<value name="TMP">/tmp</value>
|
||||
<value name="TMPDIR">/tmp</value>
|
||||
<value name="TEMP">/tmp</value>
|
||||
<value name="OSTYPE">$OSTYPE</value>
|
||||
<value name="MACHTYPE">$MACHTYPE</value>
|
||||
<value name="MALLOC_CHECK_">2</value>
|
||||
</value>
|
||||
|
||||
</section>
|
||||
|
||||
</workers>
|
||||
|
||||
</configuration>
|
||||
@@ -38,7 +38,7 @@ always_populate_raw_post_data=-1
|
||||
|
||||
|
||||
file_uploads = On
|
||||
upload_tmp_dir = "/tmp"
|
||||
upload_tmp_dir = "/tmp/upload"
|
||||
upload_max_filesize = 2M
|
||||
max_file_uploads = 20
|
||||
|
||||
|
||||
+20
-2
@@ -113,7 +113,7 @@ def contentReplace(content, version):
|
||||
|
||||
|
||||
def makeOpenrestyConf():
|
||||
phpversions = ['00', '53', '54', '55', '56',
|
||||
phpversions = ['00', '52', '53', '54', '55', '56',
|
||||
'70', '71', '72', '73', '74', '80']
|
||||
if mw.isInstalledWeb():
|
||||
sdir = mw.getServerDir()
|
||||
@@ -164,6 +164,11 @@ def phpFpmReplace(version):
|
||||
content = mw.readFile(tpl_php_fpm)
|
||||
content = contentReplace(content, version)
|
||||
mw.writeFile(desc_php_fpm, content)
|
||||
else:
|
||||
if version == '52':
|
||||
tpl_php_fpm = tpl_php_fpm = getPluginDir() + '/conf/php-fpm-52.conf'
|
||||
content = mw.readFile(tpl_php_fpm)
|
||||
mw.writeFile(desc_php_fpm, content)
|
||||
|
||||
|
||||
def phpFpmWwwReplace(version):
|
||||
@@ -184,7 +189,11 @@ def makePhpIni(version):
|
||||
d_ini = mw.getServerDir() + '/php/' + version + '/etc/php.ini'
|
||||
if not os.path.exists(d_ini):
|
||||
s_ini = getPluginDir() + '/conf/php' + version[0:1] + '.ini'
|
||||
shutil.copyfile(s_ini, d_ini)
|
||||
# shutil.copyfile(s_ini, d_ini)
|
||||
content = mw.readFile(s_ini)
|
||||
if version == '52':
|
||||
content = content + "auto_prepend_file=/www/server/php/app_start.php"
|
||||
mw.writeFile(d_ini, content)
|
||||
|
||||
|
||||
def initReplace(version):
|
||||
@@ -199,6 +208,9 @@ def initReplace(version):
|
||||
if not os.path.exists(file_bin):
|
||||
file_tpl = getPluginDir() + '/init.d/php.tpl'
|
||||
|
||||
if version == '52':
|
||||
file_tpl = getPluginDir() + '/init.d/php52.tpl'
|
||||
|
||||
content = mw.readFile(file_tpl)
|
||||
content = contentReplace(content, version)
|
||||
|
||||
@@ -214,6 +226,12 @@ def initReplace(version):
|
||||
os.mkdir(session_path)
|
||||
if not mw.isAppleSystem():
|
||||
mw.execShell('chown -R www:www ' + session_path)
|
||||
|
||||
upload_path = '/tmp/upload'
|
||||
if not os.path.exists(upload_path):
|
||||
os.mkdir(upload_path)
|
||||
if not mw.isAppleSystem():
|
||||
mw.execShell('chown -R www:www ' + upload_path)
|
||||
return file_bin
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"name": "php",
|
||||
"title": "PHP",
|
||||
"coexist": true,
|
||||
"versions": ["53","54","55","56","70","71","72","73","74","80"],
|
||||
"updates": ["5.3.17","5.4.45","5.6.36","7.0.30","7.1.33","7.2.32","7.3.20","7.4.8","8.0.0"],
|
||||
"versions": ["52","53","54","55","56","70","71","72","73","74","80"],
|
||||
"updates": ["5.2.17","5.3.29","5.4.45","5.6.36","7.0.30","7.1.33","7.2.32","7.3.20","7.4.8","8.0.0"],
|
||||
"tip": "soft",
|
||||
"checks": "server/php/VERSION/bin/php",
|
||||
"path": "server/php/VERSION",
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
#! /bin/sh
|
||||
|
||||
php_fpm_BIN=/www/server/php/52/bin/php-cgi
|
||||
php_fpm_CONF=/www/server/php/52/etc/php-fpm.conf
|
||||
php_fpm_PID=/www/server/php/52/logs/php-fpm.pid
|
||||
|
||||
|
||||
php_opts="--fpm-config $php_fpm_CONF"
|
||||
|
||||
|
||||
wait_for_pid () {
|
||||
try=0
|
||||
|
||||
while test $try -lt 35 ; do
|
||||
|
||||
case "$1" in
|
||||
'created')
|
||||
if [ -f "$2" ] ; then
|
||||
try=''
|
||||
break
|
||||
fi
|
||||
;;
|
||||
|
||||
'removed')
|
||||
if [ ! -f "$2" ] ; then
|
||||
try=''
|
||||
break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
echo -n .
|
||||
try=`expr $try + 1`
|
||||
sleep 1
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting php_fpm "
|
||||
|
||||
$php_fpm_BIN --fpm $php_opts
|
||||
|
||||
if [ "$?" != 0 ] ; then
|
||||
echo " failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wait_for_pid created $php_fpm_PID
|
||||
|
||||
if [ -n "$try" ] ; then
|
||||
echo " failed"
|
||||
exit 1
|
||||
else
|
||||
echo " done"
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo -n "Shutting down php_fpm "
|
||||
|
||||
if [ ! -r $php_fpm_PID ] ; then
|
||||
echo "warning, no pid file found - php-fpm is not running ?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kill -TERM `cat $php_fpm_PID`
|
||||
|
||||
wait_for_pid removed $php_fpm_PID
|
||||
|
||||
if [ -n "$try" ] ; then
|
||||
echo " failed"
|
||||
exit 1
|
||||
else
|
||||
echo " done"
|
||||
fi
|
||||
;;
|
||||
|
||||
quit)
|
||||
echo -n "Gracefully shutting down php_fpm "
|
||||
|
||||
if [ ! -r $php_fpm_PID ] ; then
|
||||
echo "warning, no pid file found - php-fpm is not running ?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kill -QUIT `cat $php_fpm_PID`
|
||||
|
||||
wait_for_pid removed $php_fpm_PID
|
||||
|
||||
if [ -n "$try" ] ; then
|
||||
echo " failed"
|
||||
exit 1
|
||||
else
|
||||
echo " done"
|
||||
fi
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
|
||||
reload)
|
||||
|
||||
echo -n "Reload service php-fpm "
|
||||
|
||||
if [ ! -r $php_fpm_PID ] ; then
|
||||
echo "warning, no pid file found - php-fpm is not running ?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kill -USR2 `cat $php_fpm_PID`
|
||||
|
||||
echo " done"
|
||||
;;
|
||||
|
||||
logrotate)
|
||||
|
||||
echo -n "Re-opening php-fpm log file "
|
||||
|
||||
if [ ! -r $php_fpm_PID ] ; then
|
||||
echo "warning, no pid file found - php-fpm is not running ?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
kill -USR1 `cat $php_fpm_PID`
|
||||
|
||||
echo " done"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|quit|restart|reload|logrotate}"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
Executable
+110
@@ -0,0 +1,110 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
# php 5.2.17 + eaccelerator 0.9.5.3
|
||||
# php 5.3.24 + eaccelerator 0.9.6.1
|
||||
# php 5.4.14 + eaccelerator 1.0 dev
|
||||
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source/php
|
||||
|
||||
LIBNAME=eaccelerator
|
||||
LIBV=0.9.6
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20060613/${LIBNAME}.so
|
||||
|
||||
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 [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then
|
||||
wget -O $php_lib/${LIBNAME}-${LIBV}.tar.gz https://github.com/eaccelerator/eaccelerator/archive/${LIBV}.tar.gz
|
||||
# wget -O $php_lib/${LIBNAME}-${LIBV}.tar.bz2 http://dl.wdlinux.cn:5180/soft/eaccelerator-0.9.6.1.tar.bz2
|
||||
cd $php_lib && tar -zxvf ${LIBNAME}-${LIBV}.tar.gz
|
||||
fi
|
||||
cd $php_lib/${LIBNAME}-${LIBV}
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
|
||||
--enable-eaccelerator=shared
|
||||
make && make install && make clean
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return
|
||||
fi
|
||||
|
||||
EA_DIR=/tmp/eaccelerator
|
||||
mkdir -p $EA_DIR
|
||||
chmod 777 -R $EA_DIR
|
||||
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
|
||||
echo "${LIBNAME}.enable=1" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "${LIBNAME}.optimizer=1" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "${LIBNAME}.shm_size=64" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "${LIBNAME}.cache_dir=${EA_DIR}" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "${LIBNAME}.allowed_admin_path=/www/wwwroot/you_project_dir" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+143
@@ -0,0 +1,143 @@
|
||||
#!/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")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source
|
||||
sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
version=5.2.17
|
||||
PHP_VER=52
|
||||
Install_php()
|
||||
{
|
||||
#------------------------ install start ------------------------------------#
|
||||
echo "安装php-${version} ..." > $install_tmp
|
||||
mkdir -p $sourcePath/php
|
||||
mkdir -p $serverPath/php
|
||||
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -f $sourcePath/php/php-5.2.17-fpm-0.5.14.diff.gz ]; then
|
||||
wget -O $sourcePath/php/php-5.2.17-fpm-0.5.14.diff.gz http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f $sourcePath/php/php-5.2.17-max-input-vars.patch ]; then
|
||||
wget -O $sourcePath/php/php-5.2.17-max-input-vars.patch https://raw.github.com/laruence/laruence.github.com/master/php-5.2-max-input-vars/php-5.2.17-max-input-vars.patch
|
||||
fi
|
||||
|
||||
if [ ! -f $sourcePath/php/php-5.x.x.patch ]; then
|
||||
wget -O $sourcePath/php/php-5.x.x.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
|
||||
fi
|
||||
|
||||
|
||||
cd $sourcePath/php && tar -zxvf $sourcePath/php/php-${version}.tar.gz
|
||||
mv $sourcePath/php/php-${version} $sourcePath/php/php${PHP_VER}
|
||||
|
||||
|
||||
cd $sourcePath/php
|
||||
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php${PHP_VER} -p1
|
||||
cd $sourcePath/php/php${PHP_VER}
|
||||
patch -p1 < ../php-5.2.17-max-input-vars.patch
|
||||
patch -p0 -b < ../php-5.x.x.patch
|
||||
sed -i "s/\!png_check_sig (sig, 8)/png_sig_cmp (sig, 0, 8)/" ext/gd/libgd/gd_png.c
|
||||
fi
|
||||
|
||||
|
||||
if [ -f $serverPath/php/${PHP_VER}/bin/php.dSYM ];then
|
||||
mv $serverPath/php/${PHP_VER}/bin/php.dSYM $serverPath/php/${PHP_VER}/bin/php
|
||||
fi
|
||||
|
||||
if [ -f $serverPath/php/${PHP_VER}/sbin/php-fpm.dSYM ];then
|
||||
mv $serverPath/php/${PHP_VER}/sbin/php-fpm.dSYM $serverPath/php/${PHP_VER}/sbin/php-fpm
|
||||
fi
|
||||
|
||||
|
||||
if [ -f $serverPath/php/${PHP_VER}/bin/php ];then
|
||||
return
|
||||
fi
|
||||
|
||||
OPTIONS=''
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
OPTIONS='--without-iconv'
|
||||
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype"
|
||||
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
|
||||
else
|
||||
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
|
||||
OPTIONS="${OPTIONS} --with-freetype-dir=${serverPath}/lib/freetype"
|
||||
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
|
||||
OPTIONS="${OPTIONS} --with-curl"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
|
||||
ln -s /usr/lib64/libpng.so /usr/lib/
|
||||
cp -frp /usr/lib64/libldap* /usr/lib/
|
||||
export MYSQL_LIB_DIR=/usr/lib64/mysql
|
||||
|
||||
cd $sourcePath/php/php${PHP_VER} && ./configure \
|
||||
--prefix=$serverPath/php/${PHP_VER} \
|
||||
--exec-prefix=$serverPath/php/${PHP_VER} \
|
||||
--with-config-file-path=$serverPath/php/${PHP_VER}/etc \
|
||||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--enable-xml \
|
||||
--enable-mysqlnd \
|
||||
--enable-shared \
|
||||
--with-mysql=mysqlnd \
|
||||
--enable-embedded-mysqli=shared \
|
||||
--enable-sysvmsg \
|
||||
--enable-sysvsem \
|
||||
--enable-sysvshm \
|
||||
--disable-fileinfo \
|
||||
$OPTIONS \
|
||||
--enable-fastcgi \
|
||||
--enable-fpm
|
||||
make ZEND_EXTRA_LIBS='-liconv' && make install && make clean
|
||||
fi
|
||||
|
||||
if [ "$?" != "0" ];then
|
||||
echo "install fail!!"
|
||||
rm -rf $sourcePath/php/php${PHP_VER}
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
if [ -f $serverPath/php/${PHP_VER}/bin/php.dSYM ];then
|
||||
mv $serverPath/php/${PHP_VER}/bin/php.dSYM $serverPath/php/${PHP_VER}/bin/php
|
||||
fi
|
||||
|
||||
if [ -f $serverPath/php/${PHP_VER}/sbin/php-fpm.dSYM ];then
|
||||
mv $serverPath/php/${PHP_VER}/sbin/php-fpm.dSYM $serverPath/php/${PHP_VER}/sbin/php-fpm
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/php/${PHP_VER}/lib/php/extensions/no-debug-non-zts-20060613 ]; then
|
||||
mkdir -p $serverPath/php/${PHP_VER}/lib/php/extensions/no-debug-non-zts-20060613
|
||||
fi
|
||||
|
||||
#------------------------ install end ------------------------------------#
|
||||
}
|
||||
|
||||
|
||||
|
||||
Uninstall_php()
|
||||
{
|
||||
$serverPath/php/init.d/php${PHP_VER} stop
|
||||
rm -rf $serverPath/php/${PHP_VER}
|
||||
echo "uninstall php-${version} ..." > $install_tmp
|
||||
}
|
||||
|
||||
action=${1}
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_php
|
||||
else
|
||||
Uninstall_php
|
||||
fi
|
||||
Executable
+93
@@ -0,0 +1,93 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=intl
|
||||
LIBV=3.0.0
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20060613/${LIBNAME}.so
|
||||
|
||||
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
|
||||
|
||||
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
|
||||
|
||||
cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz
|
||||
cd ${LIBNAME}-${LIBV}
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+91
@@ -0,0 +1,91 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=memcache
|
||||
LIBV=2.2.7
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20060613/${LIBNAME}.so
|
||||
|
||||
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
|
||||
|
||||
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
|
||||
|
||||
cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz
|
||||
cd ${LIBNAME}-${LIBV}
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config --enable-memcache --with-zlib-dir
|
||||
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
|
||||
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$version not install memcache, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=redis
|
||||
LIBV=2.2.7
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20060613/
|
||||
|
||||
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
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
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 && make install && make clean
|
||||
|
||||
fi
|
||||
sleep 1
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==========================================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
Uninstall_lib()
|
||||
{
|
||||
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
|
||||
echo "php$version 未安装,请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$vphp not install memcache, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=xhprof
|
||||
LIBV=0.9.4
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20060613/${LIBNAME}.so
|
||||
|
||||
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 [ ! -d $php_lib/${LIBNAME}-${LIBV} ];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}/extension
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --enable-xhprof \
|
||||
--with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make && make install && make clean
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -f /tmp/xhprof ];then
|
||||
mkdir -p /tmp/xhprof
|
||||
chown -R www:www /tmp/xhprof
|
||||
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
|
||||
echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=ZendGuardLoader
|
||||
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
BAK='_bak'
|
||||
else
|
||||
BAK=''
|
||||
fi
|
||||
|
||||
Install_lib()
|
||||
{
|
||||
|
||||
|
||||
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "ZendOptimizer.so"`
|
||||
if [ "${isInstall}" != "" ];then
|
||||
echo "php-$version 已安装${LIBNAME},请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
php_lib=$sourcePath/php_lib
|
||||
mkdir -p $php_lib
|
||||
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
wget -O $php_lib/zend-loader-php5.3.tar.gz http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-darwin-i386.tar.gz
|
||||
else
|
||||
wget -O $php_lib/ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz
|
||||
fi
|
||||
|
||||
cd $php_lib && tar zxvf ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz
|
||||
cd $php_lib/ZendOptimizer-3.3.3-linux-glibc23-x86_64
|
||||
cp $php_lib/ZendOptimizer-3.3.3-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so $serverPath/php/$version/lib/php/extensions/no-debug-non-zts-20060613/
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "[Zend ZendGuard Loader]" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_extension=$serverPath/php/$version/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_loader.enable=1" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_loader.disable_licensing=0" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_loader.obfuscation_level_support=3" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_loader.license_path=" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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
|
||||
|
||||
sed -i $BAK "/ZendOptimizer.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/zend_loader/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/\[Zend ZendGuard Loader\]/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -62,6 +62,10 @@ if [ ! -d $serverPath/php/53 ];then
|
||||
--exec-prefix=$serverPath/php/53 \
|
||||
--with-config-file-path=$serverPath/php/53/etc \
|
||||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--enable-mysqlnd \
|
||||
--with-mysql=mysqlnd \
|
||||
--with-pdo-mysql=mysqlnd \
|
||||
--with-mysqli=mysqlnd \
|
||||
--enable-zip \
|
||||
--enable-exif \
|
||||
--enable-hash \
|
||||
@@ -97,6 +101,11 @@ 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 [ ! -d $serverPath/php/53/lib/php/extensions/no-debug-non-zts-20090626 ]; then
|
||||
mkdir -p $serverPath/php/53/lib/php/extensions/no-debug-non-zts-20090626
|
||||
fi
|
||||
|
||||
#------------------------ install end ------------------------------------#
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ Install_lib()
|
||||
|
||||
echo "" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "[Zend ZendGuard Loader]" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_extension=ZendGuardLoader.so" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_extension=$serverPath/php/$version/lib/php/extensions/no-debug-non-zts-20090626/ZendGuardLoader.so" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_loader.enable=1" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_loader.disable_licensing=0" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "zend_loader.obfuscation_level_support=3" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
@@ -48,6 +48,9 @@ if [ ! -d $serverPath/php/${PHP_VER} ];then
|
||||
--with-config-file-path=$serverPath/php/${PHP_VER}/etc \
|
||||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--enable-mysqlnd \
|
||||
--with-mysql=mysqlnd \
|
||||
--with-pdo-mysql=mysqlnd \
|
||||
--with-mysqli=mysqlnd \
|
||||
--enable-zip \
|
||||
--enable-mbstring \
|
||||
--enable-sockets \
|
||||
|
||||
@@ -47,6 +47,9 @@ if [ ! -d $serverPath/php/55 ];then
|
||||
--with-config-file-path=$serverPath/php/55/etc \
|
||||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--enable-mysqlnd \
|
||||
--with-mysql=mysqlnd \
|
||||
--with-pdo-mysql=mysqlnd \
|
||||
--with-mysqli=mysqlnd \
|
||||
--enable-zip \
|
||||
--enable-simplexml \
|
||||
--enable-intl \
|
||||
|
||||
@@ -46,6 +46,7 @@ if [ ! -d $serverPath/php/56 ];then
|
||||
--exec-prefix=$serverPath/php/56 \
|
||||
--with-config-file-path=$serverPath/php/56/etc \
|
||||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--enable-mysqlnd \
|
||||
--with-mysql=mysqlnd \
|
||||
--with-pdo-mysql=mysqlnd \
|
||||
--with-mysqli=mysqlnd \
|
||||
|
||||
Executable
+90
@@ -0,0 +1,90 @@
|
||||
#!/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=openssl
|
||||
LIBV=0
|
||||
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${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
|
||||
|
||||
cd $sourcePath/php${version}/ext/${LIBNAME}
|
||||
|
||||
if [ ! -f "config.m4" ];then
|
||||
mv config0.m4 config.m4
|
||||
fi
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make clean && make && make install && make clean
|
||||
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -12,13 +12,12 @@ serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source/php
|
||||
|
||||
|
||||
|
||||
actionType=$1
|
||||
version=$2
|
||||
sysName=`uname`
|
||||
|
||||
LIBNAME=yac
|
||||
LIBV=2.0.2
|
||||
LIBV=2.2.1
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20151012/${LIBNAME}.so
|
||||
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
|
||||
@@ -13,7 +13,7 @@ sourcePath=${serverPath}/source/php
|
||||
|
||||
|
||||
LIBNAME=yar
|
||||
LIBV=1.2.5
|
||||
LIBV=2.1.2
|
||||
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
Executable
+87
@@ -0,0 +1,87 @@
|
||||
#!/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=mcrypt
|
||||
LIBV=0
|
||||
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${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
|
||||
|
||||
cd $sourcePath/php${version}/ext/${LIBNAME}
|
||||
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make clean && make && make install && make clean
|
||||
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+90
@@ -0,0 +1,90 @@
|
||||
#!/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=openssl
|
||||
LIBV=0
|
||||
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${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
|
||||
|
||||
cd $sourcePath/php${version}/ext/${LIBNAME}
|
||||
|
||||
if [ ! -f "config.m4" ];then
|
||||
mv config0.m4 config.m4
|
||||
fi
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make clean && make && make install && make clean
|
||||
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -80,7 +80,7 @@ Uninstall_lib()
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$vphp not install memcache, Plese select other version!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ sourcePath=${serverPath}/source/php
|
||||
actionType=$1
|
||||
version=$2
|
||||
LIBNAME=swoole
|
||||
LIBV=4.5.1
|
||||
LIBV=4.5.2
|
||||
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${LIBNAME}.so
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ actionType=$1
|
||||
version=$2
|
||||
|
||||
LIBNAME=yac
|
||||
LIBV=2.0.2
|
||||
LIBV=2.2.1
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${LIBNAME}.so
|
||||
|
||||
sysName=`uname`
|
||||
|
||||
@@ -15,7 +15,7 @@ actionType=$1
|
||||
version=$2
|
||||
|
||||
LIBNAME=yaf
|
||||
LIBV=3.2.5
|
||||
LIBV=3.0.7
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20160303/${LIBNAME}.so
|
||||
|
||||
sysName=`uname`
|
||||
|
||||
@@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source/php
|
||||
|
||||
LIBNAME=yar
|
||||
LIBV=1.2.5
|
||||
LIBV=2.1.2
|
||||
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
@@ -11,7 +11,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
version=7.2.32
|
||||
version=7.2.34
|
||||
PHP_VER=72
|
||||
Install_php()
|
||||
{
|
||||
|
||||
Executable
+87
@@ -0,0 +1,87 @@
|
||||
#!/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=mcrypt
|
||||
LIBV=0
|
||||
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${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
|
||||
|
||||
cd $sourcePath/php${version}/ext/${LIBNAME}
|
||||
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make clean && make && make install && make clean
|
||||
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+90
@@ -0,0 +1,90 @@
|
||||
#!/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=openssl
|
||||
LIBV=0
|
||||
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${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
|
||||
|
||||
cd $sourcePath/php${version}/ext/${LIBNAME}
|
||||
|
||||
if [ ! -f "config.m4" ];then
|
||||
mv config0.m4 config.m4
|
||||
fi
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make clean && make && make install && make clean
|
||||
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -80,7 +80,7 @@ Uninstall_lib()
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$vphp not install memcache, Plese select other version!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ version=$2
|
||||
|
||||
|
||||
LIBNAME=swoole
|
||||
LIBV=4.5.1
|
||||
LIBV=4.5.2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${LIBNAME}.so
|
||||
|
||||
sysName=`uname`
|
||||
|
||||
@@ -17,7 +17,7 @@ actionType=$1
|
||||
version=$2
|
||||
|
||||
LIBNAME=yac
|
||||
LIBV=2.0.2
|
||||
LIBV=2.2.1
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/${LIBNAME}.so
|
||||
sysName=`uname`
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
|
||||
@@ -13,7 +13,7 @@ sourcePath=${serverPath}/source/php
|
||||
|
||||
|
||||
LIBNAME=yar
|
||||
LIBV=1.2.5
|
||||
LIBV=2.1.2
|
||||
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
@@ -11,7 +11,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
version=7.3.20
|
||||
version=7.3.27
|
||||
PHP_VER=73
|
||||
Install_php()
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ Uninstall_lib()
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$vphp not install memcache, Plese select other version!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ version=$2
|
||||
|
||||
|
||||
LIBNAME=swoole
|
||||
LIBV=4.5.1
|
||||
LIBV=4.5.2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20180731/${LIBNAME}.so
|
||||
|
||||
sysName=`uname`
|
||||
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
#!/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=yac
|
||||
LIBV=2.2.1
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20180731/${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} ];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 && make install && make clean
|
||||
cd ..
|
||||
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
|
||||
echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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 未安装yaf,请选择其它版本!"
|
||||
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}\]/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -13,7 +13,7 @@ sourcePath=${serverPath}/source/php
|
||||
|
||||
|
||||
LIBNAME=yar
|
||||
LIBV=2.0.5
|
||||
LIBV=2.1.2
|
||||
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
@@ -11,7 +11,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
version=7.4.8
|
||||
version=7.4.16
|
||||
PHP_VER=74
|
||||
Install_php()
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ Install_lib()
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
cd $sourcePath/php74/ext/${LIBNAME}
|
||||
cd $sourcePath/php${version}/ext/${LIBNAME}
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config
|
||||
|
||||
Executable
+104
@@ -0,0 +1,104 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=SeasLog
|
||||
_LIBNAME=$(echo $LIBNAME | tr '[A-Z]' '[a-z]')
|
||||
LIBV=2.1.0
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190902/
|
||||
|
||||
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
|
||||
|
||||
extFile=$extDir${_LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
OPTIONS=''
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
|
||||
fi
|
||||
|
||||
php_lib=$sourcePath/php_lib
|
||||
mkdir -p $php_lib
|
||||
if [ ! -d $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 && make install && make clean
|
||||
|
||||
fi
|
||||
sleep 1
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return
|
||||
fi
|
||||
|
||||
_LIBNAME=$(echo $LIBNAME | tr '[A-Z]' '[a-z]')
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==========================================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
Uninstall_lib()
|
||||
{
|
||||
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
|
||||
echo "php$version 未安装,请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
extFile=$extDir${_LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php-$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
_LIBNAME=$(echo $LIBNAME | tr '[A-Z]' '[a-z]')
|
||||
sed -i $BAK "/${_LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=solr
|
||||
LIBV=2.5.1
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190902/
|
||||
|
||||
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
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
OPTIONS=''
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
|
||||
fi
|
||||
|
||||
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 $OPTIONS
|
||||
make && make install && make clean
|
||||
fi
|
||||
sleep 1
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==========================================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
Uninstall_lib()
|
||||
{
|
||||
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
|
||||
echo "php$version 未安装,请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -16,7 +16,7 @@ version=$2
|
||||
|
||||
|
||||
LIBNAME=swoole
|
||||
LIBV=4.5.1
|
||||
LIBV=4.5.2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190902/${LIBNAME}.so
|
||||
|
||||
sysName=`uname`
|
||||
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
#!/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=yac
|
||||
LIBV=2.2.1
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190902/${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} ];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 && make install && make clean
|
||||
cd ..
|
||||
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
|
||||
echo "${LIBNAME}.use_namespace=1" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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 未安装yaf,请选择其它版本!"
|
||||
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}\]/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+100
@@ -0,0 +1,100 @@
|
||||
#!/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
|
||||
|
||||
|
||||
LIBNAME=yar
|
||||
LIBV=2.1.2
|
||||
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190902/${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 [ ! -d $php_lib/${LIBNAME}-${LIBV} ];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 \
|
||||
--with-curl=$serverPath/lib/curl
|
||||
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
|
||||
echo "${LIBNAME}.expose_info=false" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
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
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -11,7 +11,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
version=8.0.0alpha2
|
||||
version=8.0.3
|
||||
PHP_VER=80
|
||||
Install_php()
|
||||
{
|
||||
@@ -23,7 +23,7 @@ mkdir -p $serverPath/php
|
||||
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
|
||||
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://downloads.php.net/~carusogabriel/php-${version}.tar.xz
|
||||
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
|
||||
fi
|
||||
|
||||
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-${version}.tar.xz
|
||||
|
||||
Executable
+99
@@ -0,0 +1,99 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=memcached
|
||||
LIBV=3.1.5
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/${LIBNAME}.so
|
||||
|
||||
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
|
||||
|
||||
rm -rf $php_lib/${LIBNAME}-${LIBV}
|
||||
|
||||
if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];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}
|
||||
|
||||
sed -i '_bak' "3237,3238s#ulong#zend_ulong#g" $php_lib/${LIBNAME}-${LIBV}/php_memcached.c
|
||||
$serverPath/php/$version/bin/phpize
|
||||
|
||||
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
|
||||
--enable-memcached \
|
||||
--disable-memcached-sasl && \
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=mongodb
|
||||
LIBV=1.9.0
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/${LIBNAME}.so
|
||||
|
||||
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 [ ! -d $php_lib/${LIBNAME}-${LIBV} ];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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+97
@@ -0,0 +1,97 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=redis
|
||||
LIBV=5.3.3
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/
|
||||
|
||||
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
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
php_lib=$sourcePath/php_lib
|
||||
mkdir -p $php_lib
|
||||
|
||||
if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];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 && make install && make clean
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini
|
||||
echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==========================================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
Uninstall_lib()
|
||||
{
|
||||
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
|
||||
echo "php-$version 未安装,请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php-$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+104
@@ -0,0 +1,104 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=SeasLog
|
||||
_LIBNAME=$(echo $LIBNAME | tr '[A-Z]' '[a-z]')
|
||||
LIBV=2.2.0
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/
|
||||
|
||||
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
|
||||
|
||||
extFile=$extDir${_LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
OPTIONS=''
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
|
||||
fi
|
||||
|
||||
php_lib=$sourcePath/php_lib
|
||||
mkdir -p $php_lib
|
||||
if [ ! -d $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 && make install && make clean
|
||||
|
||||
fi
|
||||
sleep 1
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return
|
||||
fi
|
||||
|
||||
_LIBNAME=$(echo $LIBNAME | tr '[A-Z]' '[a-z]')
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==========================================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
Uninstall_lib()
|
||||
{
|
||||
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
|
||||
echo "php$version 未安装,请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
extFile=$extDir${_LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php-$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
_LIBNAME=$(echo $LIBNAME | tr '[A-Z]' '[a-z]')
|
||||
sed -i $BAK "/${_LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${_LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=solr
|
||||
LIBV=2.5.1
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/
|
||||
|
||||
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
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
|
||||
OPTIONS=''
|
||||
if [ $sysName == 'Darwin' ]; then
|
||||
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
|
||||
fi
|
||||
|
||||
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 $OPTIONS
|
||||
make && make install && make clean
|
||||
fi
|
||||
sleep 1
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==========================================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
Uninstall_lib()
|
||||
{
|
||||
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
|
||||
echo "php$version 未安装,请选择其它版本!"
|
||||
return
|
||||
fi
|
||||
|
||||
extFile=$extDir${LIBNAME}.so
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "php$version 未安装${LIBNAME},请选择其它版本!"
|
||||
echo "php-$vphp not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
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=swoole
|
||||
LIBV=4.6.3
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/${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 \
|
||||
--enable-openssl --with-openssl-dir=$serverPath/lib/openssl \
|
||||
--enable-sockets
|
||||
make clean && make && make install && make clean
|
||||
|
||||
fi
|
||||
|
||||
while [[ ! -f "$extFile" ]];
|
||||
do
|
||||
echo -e ".\c"
|
||||
sleep 0.5
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
fi
|
||||
let n+=1
|
||||
if [ $n -gt 8 ];then
|
||||
echo "WAIT " $n "TIMES FAIL!"
|
||||
return;
|
||||
fi
|
||||
done
|
||||
|
||||
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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=xdebug
|
||||
LIBV=3.0.2
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/${LIBNAME}.so
|
||||
|
||||
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 [ ! -d $php_lib/${LIBNAME}-${LIBV} ];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 && 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
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
Executable
+100
@@ -0,0 +1,100 @@
|
||||
#!/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
|
||||
|
||||
LIBNAME=xhprof
|
||||
LIBV=2.2.3
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/${LIBNAME}.so
|
||||
|
||||
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 [ ! -d $php_lib/${LIBNAME}-${LIBV} ];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}/extension
|
||||
|
||||
$serverPath/php/$version/bin/phpize
|
||||
./configure --enable-xhprof \
|
||||
--with-php-config=$serverPath/php/$version/bin/php-config
|
||||
make && make install && make clean
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -f "$extFile" ];then
|
||||
echo "ERROR!"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ ! -f /tmp/xhprof ];then
|
||||
mkdir -p /tmp/xhprof
|
||||
chown -R www:www /tmp/xhprof
|
||||
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
|
||||
echo "${LIBNAME}.output_dir=/tmp/xhprof" >> $serverPath/php/$version/etc/php.ini
|
||||
|
||||
$serverPath/php/init.d/php$version reload
|
||||
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},请选择其它版本!"
|
||||
echo "php-$version not install ${LIBNAME}, Plese select other version!"
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
|
||||
sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
|
||||
|
||||
rm -f $extFile
|
||||
$serverPath/php/init.d/php$version reload
|
||||
echo '==============================================='
|
||||
echo 'successful!'
|
||||
}
|
||||
|
||||
|
||||
if [ "$actionType" == 'install' ];then
|
||||
Install_lib
|
||||
elif [ "$actionType" == 'uninstall' ];then
|
||||
Uninstall_lib
|
||||
fi
|
||||
@@ -15,8 +15,8 @@ actionType=$1
|
||||
version=$2
|
||||
|
||||
LIBNAME=yaf
|
||||
LIBV=3.2.5
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190128/${LIBNAME}.so
|
||||
LIBV=3.3.0
|
||||
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20200930/${LIBNAME}.so
|
||||
|
||||
sysName=`uname`
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
|
||||
@@ -48,6 +48,29 @@
|
||||
"shell": "opcache.sh",
|
||||
"check": "opcache.so"
|
||||
},
|
||||
{
|
||||
"name": "openssl",
|
||||
"versions": [
|
||||
"56",
|
||||
"71",
|
||||
"72"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "SSL!",
|
||||
"shell": "openssl.sh",
|
||||
"check": "openssl.so"
|
||||
},
|
||||
{
|
||||
"name": "mcrypt",
|
||||
"versions": [
|
||||
"71",
|
||||
"72"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "加密软件!",
|
||||
"shell": "mcrypt.sh",
|
||||
"check": "mcrypt.so"
|
||||
},
|
||||
{
|
||||
"name": "pcntl",
|
||||
"versions": [
|
||||
@@ -61,6 +84,7 @@
|
||||
{
|
||||
"name": "intl",
|
||||
"versions": [
|
||||
"52",
|
||||
"53"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
@@ -93,7 +117,8 @@
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "缓存器",
|
||||
"msg": "强大的内容缓存器,支持集群",
|
||||
@@ -103,6 +128,7 @@
|
||||
{
|
||||
"name": "redis",
|
||||
"versions": [
|
||||
"52",
|
||||
"53",
|
||||
"54",
|
||||
"55",
|
||||
@@ -111,7 +137,8 @@
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "缓存器",
|
||||
"msg": "更强大的内容缓存器,支持集群",
|
||||
@@ -157,7 +184,8 @@
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "调试器",
|
||||
"msg": "不多说,不了解的不要安装",
|
||||
@@ -167,6 +195,7 @@
|
||||
{
|
||||
"name": "xhprof",
|
||||
"versions": [
|
||||
"52",
|
||||
"53",
|
||||
"54",
|
||||
"55",
|
||||
@@ -175,7 +204,8 @@
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "性能分析",
|
||||
"msg": "不多说,不了解的不要安装!",
|
||||
@@ -193,7 +223,8 @@
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "异步、并行、高性能网络通信引擎",
|
||||
@@ -203,6 +234,7 @@
|
||||
{
|
||||
"name": "eAccelerator",
|
||||
"versions": [
|
||||
"52",
|
||||
"53"
|
||||
],
|
||||
"type": "缓存器",
|
||||
@@ -238,7 +270,9 @@
|
||||
"56",
|
||||
"70",
|
||||
"71",
|
||||
"72"
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
],
|
||||
"type": "框架",
|
||||
"msg": "Yar是一个RPC框架",
|
||||
@@ -267,7 +301,8 @@
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "通用扩展",
|
||||
"msg": "Mongodb数据库连接驱动",
|
||||
@@ -279,7 +314,9 @@
|
||||
"versions": [
|
||||
"70",
|
||||
"71",
|
||||
"72"
|
||||
"72",
|
||||
"73",
|
||||
"74"
|
||||
],
|
||||
"type": "缓存器",
|
||||
"msg": "高性能无锁共享内存Cache",
|
||||
@@ -296,7 +333,9 @@
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73"
|
||||
"73",
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "大数据",
|
||||
"msg": "SOLR全文搜索服务",
|
||||
@@ -313,7 +352,9 @@
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73"
|
||||
"73",
|
||||
"74",
|
||||
"80"
|
||||
],
|
||||
"type": "日志",
|
||||
"msg": "SeasLog高性能日志记录",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
$cfg['blowfish_secret'] = 'd41d8cd98f00b204e9800998ecf8427e';
|
||||
$i = 0;
|
||||
$i = 0;
|
||||
$i++;
|
||||
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
||||
$cfg['Servers'][$i]['host'] = 'localhost';
|
||||
$cfg['Servers'][$i]['connect_type'] = 'tcp';
|
||||
$cfg['Servers'][$i]['compress'] = false;
|
||||
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
||||
$cfg['Servers'][$i]['host'] = '127.0.0.1';
|
||||
$cfg['Servers'][$i]['connect_type'] = 'tcp';
|
||||
$cfg['Servers'][$i]['compress'] = false;
|
||||
$cfg['Servers'][$i]['AllowNoPassword'] = false;
|
||||
$cfg['UploadDir'] = '';
|
||||
$cfg['SaveDir'] = '';
|
||||
$cfg['UploadDir'] = '';
|
||||
$cfg['SaveDir'] = '';
|
||||
?>
|
||||
|
||||
@@ -13,8 +13,8 @@ QB_PWD = adminadmin
|
||||
|
||||
|
||||
[file]
|
||||
FILE_TO={$SERVER_PATH}/tmp
|
||||
FILE_TRANSFER_TO={$SERVER_PATH}/tmp
|
||||
FILE_TO={$WWW_PATH}/m3u8
|
||||
FILE_TRANSFER_TO=/tmp/m3u8
|
||||
FILE_OWN=www
|
||||
FILE_GROUP=www
|
||||
FILE_ENC_SWITCH=0
|
||||
|
||||
@@ -3,7 +3,7 @@ CREATE TABLE `pl_hash_list` (
|
||||
`name` text NOT NULL,
|
||||
`info_hash` varchar(40) NOT NULL,
|
||||
`length` bigint(20) NOT NULL,
|
||||
`status` char(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
||||
`status` int(10) NOT NULL DEFAULT '0',
|
||||
`create_time` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `info_hash` (`info_hash`),
|
||||
|
||||
@@ -91,6 +91,7 @@ def getRunLog():
|
||||
def contentReplace(content):
|
||||
service_path = mw.getServerDir()
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = content.replace('{$WWW_PATH}', mw.getRootDir() + "/wwwroot")
|
||||
return content
|
||||
|
||||
|
||||
@@ -117,11 +118,10 @@ def initDreplace():
|
||||
file_bin = initD_path + '/' + getPluginName()
|
||||
|
||||
# initd replace
|
||||
if not os.path.exists(file_bin):
|
||||
content = mw.readFile(file_tpl)
|
||||
content = contentReplace(content)
|
||||
mw.writeFile(file_bin, content)
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
content = mw.readFile(file_tpl)
|
||||
content = contentReplace(content)
|
||||
mw.writeFile(file_bin, content)
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
|
||||
return file_bin
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user