Compare commits

...
247 Commits
Author SHA1 Message Date
Mr Chen 422dea0e3f Update info.json 2019-03-15 17:48:31 +08:00
Mr Chen d52a355cc9 Update config_api.py 2019-03-15 17:45:55 +08:00
Mr Chen 389d87c2b5 Update index.py 2019-03-15 17:44:33 +08:00
Mr Chen 7ef8322731 Update index.py 2019-03-15 17:42:27 +08:00
Mr Chen d1a0b32bf6 Update gogs.tpl 2019-03-15 17:24:56 +08:00
Mr Chen 295cb399e3 Update gogs.tpl 2019-03-15 17:15:06 +08:00
Mr Chen db9477c22e Update install_centos.sh 2019-03-15 17:05:50 +08:00
Mr Chen b2ae6b67d6 Update install_centos.sh 2019-03-15 16:58:10 +08:00
Mr Chen bf5f0cecff Update config_api.py 2019-03-15 16:54:55 +08:00
Mr Chen 251503952d sphinx 自启动 done 2019-03-15 16:54:00 +08:00
Mr Chen 60445a565d pureftp 自启动 done 2019-03-15 16:50:20 +08:00
Mr Chen 6a8db02aa7 redis 自启动 done 2019-03-15 16:47:55 +08:00
Mr Chen ac50b335c3 memcached 自启动 done 2019-03-15 16:45:15 +08:00
Mr Chen c9826d5daf mysql 自启动done 2019-03-15 16:02:59 +08:00
Mr Chen ada8225e05 update 2019-03-15 15:23:54 +08:00
Mr Chen 613ca4bce0 Update index.py 2019-03-15 14:53:08 +08:00
Mr Chen 1bdfb0625a openresty 自启动 2019-03-15 14:52:18 +08:00
Mr Chen ad2e33fcd2 Update common.py 2019-03-15 14:43:00 +08:00
Mr Chen 6e846a4a51 Update common.py 2019-03-15 14:42:38 +08:00
Mr Chen dc76f0ca33 chkconfig自启动需要 2019-03-15 14:33:33 +08:00
Mr Chen c619f00c54 Update README.md 2019-03-14 17:14:28 +08:00
Mr Chen 015b132b85 update 2019-03-14 15:29:09 +08:00
Mr Chen 4e4b4ad308 Update info.json 2019-03-14 14:29:41 +08:00
Mr Chen 1226caaa39 Update update_centos.sh 2019-03-14 14:21:14 +08:00
Mr Chen 5a92027f20 Update update_centos.sh 2019-03-14 14:21:01 +08:00
Mr Chen ea6ed08461 Update update_centos.sh 2019-03-14 14:20:43 +08:00
Mr Chen 009231bbcf 0.4.2 2019-03-14 14:17:27 +08:00
Mr Chen d6fa8ca2a5 update 2019-03-14 14:15:44 +08:00
Mr Chen e3bfca777d Update info.json 2019-03-14 14:09:06 +08:00
Mr Chen 292fb9362a Update plugins_api.py 2019-03-14 14:02:25 +08:00
Mr Chen f68a8c88d7 安装提示更新 2019-03-14 13:57:12 +08:00
Mr Chen 4175a71547 优化 2019-03-14 13:26:08 +08:00
Mr Chen 0a5680de12 update 2019-03-14 13:15:56 +08:00
Mr Chen b3df13210d ssh连接优化 2019-03-14 12:58:28 +08:00
Mr Chen 55c9cb8856 Update __init__.py 2019-03-14 12:56:03 +08:00
Mr Chen 740ad102ea up 2019-03-14 12:53:21 +08:00
Mr Chen 1af0097673 Update __init__.py 2019-03-14 12:51:20 +08:00
Mr Chen b86a2f4243 Update __init__.py 2019-03-14 11:47:31 +08:00
Mr Chen 9500e4a39d Update __init__.py 2019-03-14 11:45:31 +08:00
Mr Chen 73b5d91ddc Update __init__.py 2019-03-14 11:44:01 +08:00
Mr Chen 645cf21898 Update __init__.py 2019-03-14 11:42:26 +08:00
Mr Chen 04e4e5a9dd Update __init__.py 2019-03-14 11:40:44 +08:00
Mr Chen 3d215ba96d Update __init__.py 2019-03-14 11:36:52 +08:00
Mr Chen 9b7722f847 Update __init__.py 2019-03-14 11:33:51 +08:00
Mr Chen 040a6c0ed1 Update __init__.py 2019-03-14 11:31:00 +08:00
Mr Chen ef2a04e886 update 2019-03-14 11:14:53 +08:00
Mr Chen e656c64fee Update install.sh 2019-03-14 10:53:43 +08:00
midoks 0ee24a763a 优化修改
1.mysql修改备注
2.修改版本号
3.mysql迁移功能
4.选择文件优化
2019-03-14 02:07:39 +08:00
Mr Chen 26120018c6 Update files_api.py 2019-03-13 20:29:44 +08:00
Mr Chen ae78b0aa8c Update mw.tpl 2019-03-13 20:21:07 +08:00
Mr Chen 3cca69ae9f Update update_centos.sh 2019-03-13 20:20:00 +08:00
Mr Chen 422460c422 Update update_centos.sh 2019-03-13 20:17:00 +08:00
Mr Chen 47a60b3465 Update update_centos.sh 2019-03-13 20:14:37 +08:00
Mr Chen 701ff6f817 Update update_centos.sh 2019-03-13 20:07:57 +08:00
Mr Chen 385fa4bb5d Update update_centos.sh 2019-03-13 19:55:56 +08:00
Mr Chen f410727d42 Update update_centos.sh 2019-03-13 19:55:45 +08:00
Mr Chen f9baee0a4a Update update_centos.sh 2019-03-13 19:54:45 +08:00
Mr Chen c97e1ad3a7 Update update_centos.sh 2019-03-13 19:54:32 +08:00
Mr Chen deaa193478 Update update_centos.sh 2019-03-13 19:52:58 +08:00
Mr Chen e290af5403 Update update_centos.sh 2019-03-13 19:52:10 +08:00
Mr Chen f6f160883c Update update_centos.sh 2019-03-13 19:51:56 +08:00
Mr Chen 0a2f8c9765 Update update_centos.sh 2019-03-13 19:49:06 +08:00
Mr Chen 788a672e74 Update update_centos.sh 2019-03-13 19:48:36 +08:00
Mr Chen 2a078d3290 Update update_centos.sh 2019-03-13 19:45:55 +08:00
Mr Chen 03d3761805 Update lib.sh 2019-03-13 19:37:21 +08:00
Mr Chen 6d16ae5767 Update lib.sh 2019-03-13 19:31:36 +08:00
Mr Chen 66c9828b68 Update lib.sh 2019-03-13 19:24:39 +08:00
Mr Chen cf2ea6e16c Update update_centos.sh 2019-03-13 19:22:46 +08:00
Mr Chen b2533943ed 安装提示优化 2019-03-13 19:04:18 +08:00
Mr Chen 5c9ccd9bd2 Update phplib.conf 2019-03-13 18:53:53 +08:00
Mr Chen fa48db5f1b update 2019-03-13 18:52:43 +08:00
Mr Chen 79a45082c1 Update task.py 2019-03-13 17:59:14 +08:00
Mr Chen 7998afb78a Update mongo.sh 2019-03-13 17:59:11 +08:00
Mr Chen 492f875205 op 2019-03-13 17:59:07 +08:00
Mr Chen 5e767fde08 Update phplib.conf 2019-03-13 17:58:39 +08:00
Mr Chen 15acc8c67c 添加seaslog扩展 2019-03-13 17:58:36 +08:00
Mr Chen 6234188ceb op 2019-03-13 17:19:33 +08:00
Mr Chen 36842c8b2c 田间solr扩展 2019-03-13 14:41:02 +08:00
Mr Chen 089de80c59 update 2019-03-13 14:38:02 +08:00
Mr Chen c60e9aabcd update 2019-03-13 13:09:37 +08:00
Mr Chen 3195f915f5 Update install_centos.sh 2019-03-13 12:57:29 +08:00
Mr Chen 24191e082a update 2019-03-13 12:53:54 +08:00
Mr Chen c2745a5f16 update 2019-03-13 12:38:03 +08:00
Mr Chen 7d03e6ddf3 Update install.sh 2019-03-13 11:14:46 +08:00
Mr Chen 77cfc12013 Update install_macos.sh 2019-03-13 11:14:39 +08:00
Mr Chen 0bf9c06ef2 Update mongo.sh 2019-03-12 20:01:25 +08:00
Mr Chen d2b40b3399 Update install_macos.sh 2019-03-12 19:32:57 +08:00
Mr Chen 482f4072c7 Update install_macos.sh 2019-03-12 19:05:02 +08:00
Mr Chen 4879fee9a8 Update phplib.conf 2019-03-12 18:01:27 +08:00
Mr Chen 51307c31f8 update 2019-03-12 17:59:44 +08:00
Mr Chen db451b630c update 2019-03-12 16:28:48 +08:00
Mr Chen 400ea68cc9 update 2019-03-12 14:52:02 +08:00
Mr Chen 078c755684 Update opcache.sh 2019-03-12 14:44:17 +08:00
Mr Chen f17c89605f php imagick 2019-03-12 14:37:13 +08:00
Mr Chen 5f961febac update 2019-03-12 14:31:04 +08:00
Mr Chen 1fb2c3ed5d Update gogs.js 2019-03-12 13:15:20 +08:00
Mr Chen acc6cd0c73 update 2019-03-12 13:11:00 +08:00
Mr Chen 4e27082225 update 2019-03-11 19:22:18 +08:00
Mr Chen 6563bb0044 update 2019-03-11 17:51:16 +08:00
Mr Chen d4b2a1214e Update gogs.tpl 2019-03-11 17:49:14 +08:00
Mr Chen 097fb3b4cb Update index.py 2019-03-11 17:37:09 +08:00
Mr Chen f3f69767a1 Update index.py 2019-03-11 17:32:27 +08:00
Mr Chen dc149ac022 update 2019-03-11 17:30:22 +08:00
Mr Chen 37cde7a7af update 2019-03-11 16:40:29 +08:00
Mr Chen e320104fb8 update 2019-03-11 15:46:41 +08:00
Mr Chen af4ad33031 qbittorrent 删除,不在主要软件管理中.. 2019-03-11 14:38:35 +08:00
Mr Chen 2038111a11 修复问题 2019-03-11 14:24:36 +08:00
Mr Chen 3481e660a3 Update install.sh 2019-03-11 13:56:18 +08:00
Mr Chen 4651bf782c update 2019-03-11 13:43:04 +08:00
Mr Chen 608a78ac67 update 2019-03-11 11:45:28 +08:00
Mr Chen 4a12128315 Update install.sh 2019-03-11 10:55:27 +08:00
midoks 746b3295cb Update install_centos.sh 2019-03-10 20:06:42 +08:00
midoks 3d42cf67d7 Update requirements.txt 2019-03-10 19:42:50 +08:00
midoks b7f5b7b5e5 Update requirements.txt 2019-03-09 23:17:13 +08:00
midoks 5e548f7899 update 2019-03-09 23:15:15 +08:00
Mr Chen fb68ad7705 update 2019-03-08 18:52:37 +08:00
Mr Chen e959ae2494 uu 2019-03-08 17:11:20 +08:00
Mr Chen 3a6e84119f php安装版本 2019-03-08 13:11:37 +08:00
Mr Chen 4f3f7a70a9 优化 2019-03-08 11:39:22 +08:00
Mr Chen e1bf1e306d 优化 2019-03-08 11:10:36 +08:00
Mr Chen c9333a3023 Update phplib.conf 2019-03-07 20:49:52 +08:00
Mr Chen 840fd5243a update 2019-03-07 20:25:56 +08:00
Mr Chen dde8fb3202 update 2019-03-07 19:38:06 +08:00
Mr Chen 0f5ef505d0 update 2019-03-07 19:05:12 +08:00
Mr Chen 1673a23455 删除不通用的 2019-03-07 18:59:41 +08:00
Mr Chen b4b16ada27 安装文件优化 2019-03-07 18:59:26 +08:00
Mr Chen a4d75bfc04 php卸载优化 2019-03-07 18:59:15 +08:00
Mr Chen 61bd4f799b 卸载软件功能优化 2019-03-07 18:54:17 +08:00
Mr Chen 002a3ea79e Install_Libmemcached 2019-03-07 17:48:30 +08:00
Mr Chen 5dce56357b Update plugins_api.py 2019-03-07 16:21:04 +08:00
Mr Chen 89ab800565 修复php53安装问题 2019-03-07 16:03:16 +08:00
Mr Chen 349741b31b Update index.py 2019-03-06 20:40:11 +08:00
Mr Chen 725b398da9 Update index.py 2019-03-06 20:37:32 +08:00
Mr Chen ce9f53dddb Update index.py 2019-03-06 20:35:55 +08:00
Mr Chen fc37413d91 update 2019-03-06 20:31:29 +08:00
Mr Chen ba39c39622 Update index.py 2019-03-06 19:22:53 +08:00
Mr Chen 6c5ee78b18 u 2019-03-06 18:54:19 +08:00
Mr Chen eafa575e8e rsyncd基本功能 2019-03-06 18:47:43 +08:00
Mr Chen a3dd458cb2 Update site.js 2019-03-06 18:47:26 +08:00
Mr Chen c5cb8b65f3 rsyncd 2019-03-06 15:07:04 +08:00
Mr Chen 994b93852e 删除samba扩展 2019-03-06 14:39:57 +08:00
Mr Chen 912eda2cb8 Update index.py 2019-03-06 14:33:32 +08:00
Mr Chen 0461fabab0 Update index.py 2019-03-06 14:32:41 +08:00
Mr Chen 0324872499 Update index.html 2019-03-06 14:30:53 +08:00
Mr Chen 5877644570 update 2019-03-06 14:29:47 +08:00
Mr Chen f292fdd354 Update install.sh 2019-03-05 19:21:06 +08:00
Mr Chen 85ce4dc462 rsyncd 2019-03-05 19:20:04 +08:00
Mr Chen a9d3aa4962 up 2019-03-05 18:35:28 +08:00
Mr Chen 9a562934e5 Update config_api.py 2019-03-05 17:13:17 +08:00
Mr Chen 784304f639 Update public.js 2019-03-05 17:02:30 +08:00
Mr Chen 582792c2bf Update public.js 2019-03-05 17:01:45 +08:00
Mr Chen 946523a73d Update index.html 2019-03-05 16:30:41 +08:00
Mr Chen 39021dca1e 优化说明 2019-03-05 16:27:46 +08:00
Mr Chen e240ef713b 更改gogs- hook脚本 2019-03-05 16:00:31 +08:00
Mr Chen 2b1f88ae0f Update site_api.py 2019-03-05 14:58:53 +08:00
Mr Chen 8259823451 网站删除优化 2019-03-05 14:50:52 +08:00
Mr Chen 05109a500d Update site.js 2019-03-05 14:29:15 +08:00
Mr Chen 78b156aeed Update site_api.py 2019-03-05 14:27:53 +08:00
Mr Chen 39789bcc33 Update site.js 2019-03-05 14:25:42 +08:00
Mr Chen 310c8a57e7 Update site_api.py 2019-03-05 14:21:19 +08:00
Mr Chen 3b947d6446 Update index.py 2019-03-05 13:56:21 +08:00
Mr Chen d163c84916 Update index.py 2019-03-05 13:50:02 +08:00
Mr Chen ef43ceab48 Update index.py 2019-03-05 13:47:05 +08:00
Mr Chen 665952869a Update index.py 2019-03-05 13:46:27 +08:00
Mr Chen 942a1fbf1a samba debug 2019-03-05 13:42:46 +08:00
Mr Chen 0c05f87acd 优化
1.ssl跳转优化
2.acme安装
2019-03-05 12:59:37 +08:00
Mr Chen ef856a1420 Update README.md 2019-03-05 11:18:31 +08:00
Mr Chen 0ea666bb7c 增加灵活性
1.php显示phpinfo优化
2.插件接口新增方法
2019-03-05 10:42:47 +08:00
Mr Chen 5fc3a8607f 脚本修复 2019-03-05 10:04:05 +08:00
midoks 163ca52b7f Update plugins_api.py 2019-03-04 23:39:05 +08:00
midoks dbcf62edb1 修复phpinfo显示 2019-03-04 23:22:29 +08:00
Mr Chen 6e1ef774df 找到问题,待解决 2019-03-04 19:45:06 +08:00
Mr Chen 84e646dbe4 优化数据显示 2019-03-04 18:02:30 +08:00
Mr Chen 705ea56813 Update site_api.py 2019-03-04 17:56:08 +08:00
Mr Chen 91ae7244b0 Update site_api.py 2019-03-04 17:12:27 +08:00
Mr Chen 1539504258 samba init 2019-03-04 15:41:56 +08:00
Mr Chen 1ef899d11e 源码中删除simdht 2019-03-04 15:20:15 +08:00
Mr Chen e36df4fff5 Update install_centos.sh 2019-03-04 14:39:56 +08:00
Mr Chen 76a1fed75d 添加命令更新脚本 2019-03-04 14:24:49 +08:00
Mr Chen 338ccef6d6 增加网站分类功能 2019-03-04 14:09:43 +08:00
Mr Chen 1fa7fbda45 samba init 2019-03-04 11:04:10 +08:00
midoks 4459d296eb uu 2019-03-03 23:44:03 +08:00
midoks a9f7a47022 Update __init__.py 2019-03-03 10:57:39 +08:00
midoks e1e69a4677 Update __init__.py 2019-03-03 09:40:37 +08:00
midoks 6827de3f67 Update config_api.py 2019-03-03 08:41:29 +08:00
midoks bffd4c1150 ssl功能90% 2019-03-02 23:32:11 +08:00
midoks ad44c255cb ssl功能80% 2019-03-02 22:33:29 +08:00
Mr Chen c884197f2e 删除l2tp插件 2019-03-01 19:36:07 +08:00
Mr Chen 1bc335d715 l2tp ok 2019-03-01 18:01:22 +08:00
Mr Chen a10f5a3337 Update index.py 2019-03-01 17:51:49 +08:00
Mr Chen c2c413a9ef Update index.py 2019-03-01 17:51:22 +08:00
Mr Chen c9eea53ff5 Update index.py 2019-03-01 17:50:10 +08:00
Mr Chen e176ac2e8d test 2019-03-01 17:46:53 +08:00
Mr Chen 522f9f22e4 Update index.py 2019-03-01 17:41:39 +08:00
Mr Chen 8fded1c678 update 2019-03-01 17:37:18 +08:00
Mr Chen 2b0782f125 u 2019-03-01 17:15:42 +08:00
Mr Chen f7c2e38a5e y 2019-03-01 17:14:33 +08:00
Mr Chen 93d3fc3cef Update l2tp.js 2019-03-01 16:36:08 +08:00
Mr Chen 0e200e8c12 Update index.py 2019-03-01 16:34:31 +08:00
Mr Chen 28ddb57c8e Update l2tp.js 2019-03-01 16:32:47 +08:00
Mr Chen 348ecd938e Update index.py 2019-03-01 16:31:45 +08:00
Mr Chen 6de200a294 Update l2tp.js 2019-03-01 16:29:45 +08:00
Mr Chen 8b0dc43f74 Update index.py 2019-03-01 16:20:44 +08:00
Mr Chen e14d8109f2 Update l2tp.js 2019-03-01 16:17:34 +08:00
Mr Chen ea8b829c6e Update index.py 2019-03-01 16:15:50 +08:00
Mr Chen faf637aae1 u 2019-03-01 16:09:54 +08:00
Mr Chen bb69c92a9c update 2019-03-01 15:53:29 +08:00
Mr Chen 3886888843 优化 2019-02-28 20:01:07 +08:00
Mr Chen 1bd0a38f6b 优化gogs插件 2019-02-28 19:54:53 +08:00
Mr Chen ac7fe66734 u 2019-02-28 16:41:17 +08:00
Mr Chen 3365ab9a49 update 2019-02-28 16:22:15 +08:00
Mr Chen 3cfaa5361f l2tp测试 2019-02-28 16:17:50 +08:00
Mr Chen 43800b6578 Update site.js 2019-02-28 15:43:02 +08:00
Mr Chen 0891e206d5 Update index.py 2019-02-28 15:08:23 +08:00
Mr Chen 8f6aae7e4c Update index.py 2019-02-28 14:47:08 +08:00
Mr Chen d860405b16 Update index.py 2019-02-28 14:43:44 +08:00
Mr Chen df4f1aa28b update 2019-02-28 14:24:43 +08:00
Mr Chen b464c848a9 0.0.8 2019-02-28 14:05:43 +08:00
Mr Chen 04780d8094 Update info.json 2019-02-28 13:56:18 +08:00
Mr Chen e41604499a 优化 2019-02-28 13:52:06 +08:00
Mr Chen ef90ba7aab 重要插件不可修改 2019-02-28 13:27:46 +08:00
Mr Chen b5954be201 Update plugin_compress.sh 2019-02-28 13:15:16 +08:00
Mr Chen 5d7b37cb18 删除不必要插件 2019-02-28 13:14:58 +08:00
Mr Chen 71026d74e9 pm2 ok 2019-02-28 11:54:42 +08:00
Mr Chen d656d07487 Update pm2.js 2019-02-28 10:27:24 +08:00
midoks 3bf395c86f Update index.py 2019-02-28 02:10:52 +08:00
midoks f841a89940 基本功能OK 2019-02-28 01:59:56 +08:00
Mr Chen 287de96277 update 2019-02-27 19:58:32 +08:00
Mr Chen 860bcd0c9d Update files.html 2019-02-27 19:15:36 +08:00
Mr Chen 73f6354332 L2TP vpn 插件 2019-02-27 15:52:16 +08:00
Mr Chen 9770821628 网站分类基本功能完成~ 2019-02-27 15:09:25 +08:00
Mr Chen dff57a4b13 Update site_api.py 2019-02-27 14:26:03 +08:00
Mr Chen cfed5e813d Update site.js 2019-02-27 14:25:59 +08:00
Mr Chen 2518e53abc Update site.html 2019-02-27 14:25:56 +08:00
Mr Chen bf970dbd02 Update site.css 2019-02-27 14:25:09 +08:00
Mr Chen aa583e4586 Update public.js 2019-02-27 14:25:07 +08:00
Mr Chen 07a33f1a5f Update control.js 2019-02-27 14:25:03 +08:00
Mr Chen bd1eff9fc8 Update default.sql 2019-02-27 14:24:58 +08:00
Mr Chen ded6dad023 Update config_api.py 2019-02-27 14:24:46 +08:00
Mr Chen 52f7bdd65d pm2 init 2019-02-27 14:24:41 +08:00
Mr Chen 6874bfc059 优化启动脚本 2019-02-27 10:40:47 +08:00
Mr Chen bef439ce55 Update site.html 2019-02-26 19:13:59 +08:00
Mr Chen 726c684a94 Update php72.ini 2019-02-26 17:02:23 +08:00
Mr Chen e6b9fd8a66 Update info.json 2019-02-26 16:09:07 +08:00
Mr Chen 350a1e8b61 修复重复js方法 2019-02-26 16:08:23 +08:00
Mr Chen b904ef4e8a Update system_api.py 2019-02-26 16:01:39 +08:00
Mr Chen d64040abb7 Update info.json 2019-02-26 15:57:36 +08:00
248 changed files with 12096 additions and 6407 deletions
+1
View File
@@ -119,3 +119,4 @@ data/site.pl
data/admin_path.pl
data/close.pl
ssl/input.pl
data/datadir.pl
+12 -2
View File
@@ -1,7 +1,17 @@
# mdserver-web
简单的Linux面板
简单的Linux面板,感谢bt.cn写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
复制了后台管理界面,按照自己想要的方式写了一版。
### 自动安装
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | sh
```
```
### 更新
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | sh
```
### wiki
+2
View File
@@ -68,6 +68,8 @@ def initInitD():
import shutil
shutil.copyfile(script_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
#加入自启动
public.execShell('chkconfig --add mw')
def initUserInfo():
+13 -4
View File
@@ -15,7 +15,16 @@ from flask import request
class config_api:
__version = '0.0.5'
# 本版解决自启动问题
# openresty 自启动 done
# php 自启动 done
# mysql 自启动 done
# memcached 自启动 done
# redis 自启动 done
# pureftp 自启动 done
# sphinx 自启动 done
# 修复rsync自启动问题
__version = '0.5.6'
def __init__(self):
pass
@@ -64,14 +73,14 @@ class config_api:
isSave = public.M('panel').where(
'(title=? OR url=?) AND id!=?', (title, url, mid)).count()
if isSave:
return public.returnMsg(False, '备注或面板地址重复!')
return public.returnJson(False, '备注或面板地址重复!')
# 更新到数据库
isRe = public.M('panel').where('id=?', (mid,)).save(
'title,url,username,password', (title, url, username, password))
if isRe:
return public.returnMsg(True, '修改成功!')
return public.returnMsg(False, '修改失败!')
return public.returnJson(True, '修改成功!')
return public.returnJson(False, '修改失败!')
def syncDateApi(self):
if public.isAppleSystem():
+6 -6
View File
@@ -310,7 +310,7 @@ done
if os.path.exists('data/recycle_bin.pl'):
if self.mvRecycleBin(path):
return public.returnJson(True, '已将文件移动到回收站!')
os.remove(path)
public.execShell('rm -rf ' + path)
public.writeLog('文件管理', '删除文件成功!', (path,))
return public.returnJson(True, '删除文件成功!')
except:
@@ -397,11 +397,11 @@ done
try:
import shutil
shutil.move(path, rFile)
public.writeLog('TYPE_FILE', public.getInfo(
public.writeLog('文件管理', public.getInfo(
'移动文件[{1}]到回收站成功!', (path)))
return True
except:
public.writeLog('TYPE_FILE', public.getInfo(
public.writeLog('文件管理', public.getInfo(
'移动文件[{1}]到回收站失败!', (path)))
return False
@@ -477,7 +477,7 @@ done
fp.write(data)
fp.close()
public.writeLog('TYPE_FILE', '文件保存成功', (path,))
public.writeLog('文件管理', '文件保存成功', (path,))
return public.returnJson(True, '文件保存成功')
except Exception as ex:
return public.returnJson(False, 'FILE_SAVE_ERR:' + str(ex))
@@ -501,7 +501,7 @@ done
os.system("cd '" + path + "' && tar -zcvf '" +
dfile + "' " + sfiles + " > " + tmps + " 2>&1")
self.setFileAccept(dfile)
public.writeLog("TYPE_FILE", '文件压缩成功!', (sfile, dfile))
public.writeLog("文件管理", '文件压缩成功!', (sfile, dfile))
return public.returnJson(True, '文件压缩成功!')
except:
return public.returnJson(False, '文件压缩失败!')
@@ -520,7 +520,7 @@ done
if self.mvRecycleBin(path):
return public.returnJson(True, '已将文件移动到回收站!')
os.remove(path)
public.writeLog('TYPE_FILE', public.getInfo(
public.writeLog('文件管理', public.getInfo(
'删除文件[{1}]成功!', (path)))
return public.returnJson(True, '删除文件成功!')
except:
+80 -29
View File
@@ -98,7 +98,7 @@ class plugins_api:
return public.returnJson(False, '缺少版本信息!', ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
print infoJsonPos
# print infoJsonPos
if not os.path.exists(infoJsonPos):
return public.retJson(False, '配置文件不存在!', ())
@@ -115,7 +115,7 @@ class plugins_api:
public.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd)
return public.returnJson(True, '已将安装任务添加到队列!')
def uninstallApi(self):
def uninstallOldApi(self):
rundir = public.getRunDir()
name = request.form.get('name', '')
version = request.form.get('version', '')
@@ -142,6 +142,38 @@ class plugins_api:
public.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd)
return public.returnJson(True, '已将卸载任务添加到队列!')
# 卸载时间短,不加入任务中...
def uninstallApi(self):
rundir = public.getRunDir()
name = request.form.get('name', '')
version = request.form.get('version', '')
if name.strip() == '':
return public.returnJson(False, "缺少插件名称!", ())
if version.strip() == '':
return public.returnJson(False, "缺少版本信息!", ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
if not os.path.exists(infoJsonPos):
return public.retJson(False, "配置文件不存在!", ())
pluginInfo = json.loads(public.readFile(infoJsonPos))
execstr = "cd " + os.getcwd() + "/plugins/" + \
name + " && /bin/bash " + pluginInfo["shell"] \
+ " uninstall " + version
data = public.execShell(execstr)
if public.isAppleSystem():
print execstr
print data[0],data[1]
return public.returnJson(True, '卸载执行成功!')
# if data[1] == '':
# return public.returnJson(True, '已将卸载成功!')
# else:
# return public.returnJson(False, '卸载出现错误信息!' + data[1])
def checkApi(self):
name = request.form.get('name', '')
if name.strip() == '':
@@ -177,6 +209,17 @@ class plugins_api:
return public.returnJson(True, "OK", data[0].strip())
return public.returnJson(False, data[1].strip())
def callbackApi(self):
name = request.form.get('name', '')
func = request.form.get('func', '')
args = request.form.get('args', '')
script = request.form.get('script', 'index')
data = self.callback(name, func, args, script)
if data[0]:
return public.returnJson(True, "OK", data[1])
return public.returnJson(False, data[1])
def updateZipApi(self):
tmp_path = public.getRootDir() + '/temp'
if not os.path.exists(tmp_path):
@@ -228,6 +271,9 @@ class plugins_api:
except:
public.execShell("rm -rf " + tmp_path)
return public.returnJson(False, '在压缩包中没有找到插件信息,请检查插件包!')
protectPlist = ('openresty', 'mysql', 'php', 'csvn', 'gogs', 'pureftp')
if data['name'] in protectPlist:
return public.returnJson(False, '[' + data['name'] + '],重要插件不可修改!')
return public.getJson(data)
def inputZipApi(self):
@@ -271,17 +317,10 @@ class plugins_api:
return True
# 检查是否正在安装
def checkSetupTask(self, sName):
sName = ''
version = ''
def checkSetupTask(self, sName, sVer, sCoexist):
if not self.__tasks:
self.__tasks = public.M('tasks').where(
"status!=?", ('1',)).field('status,name').select()
if sName.find('php-') != -1:
tmp = sName.split('-')
sName = tmp[0]
version = tmp[1]
isTask = '1'
for task in self.__tasks:
tmpt = public.getStrBetween('[', ']', task['name'])
@@ -289,12 +328,10 @@ class plugins_api:
continue
tmp1 = tmpt.split('-')
name1 = tmp1[0].lower()
if sName == 'php':
if name1 == sName and tmp1[1] == version:
if sCoexist:
if name1 == sName and tmp1[1] == sVer:
isTask = task['status']
else:
if name1 == 'pure':
name1 = 'pure-ftpd'
if name1 == sName:
isTask = task['status']
return isTask
@@ -410,7 +447,7 @@ class plugins_api:
if info.has_key('coexist') and info['coexist']:
coexist = True
pluginInfo = {
pInfo = {
"id": 10000,
"pid": info['pid'],
"type": 1000,
@@ -431,29 +468,28 @@ class plugins_api:
"status": False,
}
pluginInfo['task'] = self.checkSetupTask(pluginInfo['name'])
if checks.find('VERSION') > -1:
pluginInfo['install_checks'] = checks.replace(
pInfo['install_checks'] = checks.replace(
'VERSION', info['versions'])
if path.find('VERSION') > -1:
pluginInfo['path'] = path.replace(
pInfo['path'] = path.replace(
'VERSION', info['versions'])
pluginInfo['display'] = self.checkDisplayIndex(
info['name'], pluginInfo['versions'])
pInfo['task'] = self.checkSetupTask(
pInfo['name'], info['versions'], coexist)
pInfo['display'] = self.checkDisplayIndex(
info['name'], pInfo['versions'])
pluginInfo['setup'] = os.path.exists(pluginInfo['install_checks'])
pInfo['setup'] = os.path.exists(pInfo['install_checks'])
if coexist and pluginInfo['setup']:
pluginInfo['setup_version'] = info['versions']
if coexist and pInfo['setup']:
pInfo['setup_version'] = info['versions']
else:
pluginInfo['setup_version'] = self.getVersion(
pluginInfo['install_checks'])
pInfo['setup_version'] = self.getVersion(pInfo['install_checks'])
# pluginInfo['status'] = self.checkStatus(pluginInfo)
pluginInfo['status'] = False
return pluginInfo
pInfo['status'] = False
return pInfo
def makeCoexist(self, data):
plugins_info = []
@@ -738,6 +774,7 @@ class plugins_api:
public.writeFile(self.__index, json.dumps(indexList))
return public.returnJson(True, '删除成功!')
# shell 调用
def run(self, name, func, version, args='', script='index'):
path = public.getRunDir() + '/' + self.__plugin_dir + \
'/' + name + '/' + script + '.py'
@@ -754,6 +791,20 @@ class plugins_api:
# data = os.popen(py_cmd).read()
if public.isAppleSystem():
print py_cmd
print 'run', py_cmd
# print os.path.exists(py_cmd)
return (data[0].strip(), data[1].strip())
# 映射包调用
def callback(self, name, func, args='', script='index'):
package = public.getRunDir() + '/plugins/' + name
if not os.path.exists(package):
return (False, "插件不存在!")
sys.path.append(package)
eval_str = "__import__('" + script + "')." + func + '(' + args + ')'
newRet = eval(eval_str)
if public.isAppleSystem():
print 'callback', eval_str
return (True, newRet)
+8 -5
View File
@@ -355,13 +355,16 @@ def HttpGet(url, timeout=10):
def HttpGet2(url, timeout):
import urllib
import urllib2
req = urllib2.Request(url)
res = urllib2.urlopen(req, timeout=timeout)
result = res.read()
return result
try:
req = urllib2.Request(url)
res = urllib2.urlopen(req, timeout=timeout)
result = res.read()
return result
except Exception as e:
return str(e)
def httpGet(url, timeout=10):
+148 -30
View File
@@ -9,6 +9,8 @@ import json
import pwd
import shutil
sys.path.append("/usr/local/lib/python2.7/site-packages")
sys.path.append("/usr/lib64/python2.7/site-packages")
import psutil
from flask import request
@@ -51,9 +53,15 @@ class site_api:
def listApi(self):
limit = request.form.get('limit', '').encode('utf-8')
p = request.form.get('p', '').encode('utf-8')
type_id = request.form.get('type_id', '').encode('utf-8')
start = (int(p) - 1) * (int(limit))
_list = public.M('sites').where('', ()).field('id,name,path,status,ps,addtime,edate').limit(
siteM = public.M('sites')
if type_id != '' and type_id == '-1' and type_id == '0':
siteM.where('type_id=?', (type_id))
_list = siteM.field('id,name,path,status,ps,addtime,edate').limit(
(str(start)) + ',' + limit).order('id desc').select()
for i in range(len(_list)):
@@ -63,7 +71,7 @@ class site_api:
_ret = {}
_ret['data'] = _list
count = public.M('sites').where('', ()).count()
count = siteM.count()
_page = {}
_page['count'] = count
_page['tojs'] = 'getWeb'
@@ -403,9 +411,9 @@ class site_api:
'rm -rf /etc/letsencrypt/archive/' + siteName + '-00*')
public.execShell(
'rm -f /etc/letsencrypt/renewal/' + siteName + '.conf')
public.execShell('rm -f /etc/letsencrypt/renewal/' +
public.execShell('rm -rf /etc/letsencrypt/renewal/' +
siteName + '-00*.conf')
public.execShell('rm -f ' + path + '/README')
public.execShell('rm -rf ' + path + '/README')
public.execShell('mkdir -p ' + path)
public.writeFile(keypath, key)
@@ -424,9 +432,38 @@ class site_api:
return public.returnJson(False, 'ERROR: <br><a style="color:red;">' + isError.replace("\n", '<br>') + '</a>')
public.restartWeb()
public.writeLog('TYPE_SITE', '证书已保存!')
public.writeLog('网站管理', '证书已保存!')
return public.returnJson(True, '证书已保存!')
def setCertToSiteApi(self):
certName = request.form.get('certName', '').encode('utf-8')
siteName = request.form.get('siteName', '').encode('utf-8')
try:
path = self.sslDir + siteName
if not os.path.exists(path):
return public.returnJson(False, '证书不存在!')
result = self.setSslConf(siteName)
if not result['status']:
return public.getJson(result)
public.restartWeb()
public.writeLog('网站管理', '证书已部署!')
return public.returnJson(True, '证书已部署!')
except Exception as ex:
return public.returnJson(False, '设置错误,' + str(ex))
def removeCertApi(self):
certName = request.form.get('certName', '').encode('utf-8')
try:
path = self.sslDir + certName
if not os.path.exists(path):
return public.returnJson(False, '证书已不存在!')
os.system("rm -rf " + path)
return public.returnJson(True, '证书已删除!')
except:
return public.returnJson(False, '删除失败!')
def closeSslConfApi(self):
siteName = request.form.get('siteName', '').encode('utf-8')
@@ -471,7 +508,7 @@ class site_api:
public.writeFile(file, conf)
msg = public.getInfo('网站[{1}]关闭SSL成功!', (siteName,))
public.writeLog('TYPE_SITE', msg)
public.writeLog('网站管理', msg)
public.restartWeb()
return public.returnJson(True, 'SSL已关闭!')
@@ -498,7 +535,7 @@ class site_api:
if siteConf.find('301-START') != -1:
return public.returnJson(False, '检测到您的站点做了301重定向设置,请先关闭重定向!')
letpath = public.getServerDir() + '/letsencrypt/live/' + siteName
letpath = self.sslDir + siteName
csrpath = letpath + "/fullchain.pem" # 生成证书路径
keypath = letpath + "/privkey.pem" # 密钥文件路径
@@ -556,8 +593,7 @@ class site_api:
if domainCount == 0:
return public.returnJson(False, '请选择域名(不包括IP地址与泛域名)!')
home_path = public.getServerDir() + '/openresty/nginx/conf/cert/' + \
domains[0]
home_path = '/root/.acme.sh/' + domains[0]
home_cert = home_path + '/fullchain.cer'
home_key = home_path + '/' + domains[0] + '.key'
@@ -566,11 +602,6 @@ class site_api:
home_cert = home_path + '/fullchain.cer'
home_key = home_path + '/' + domains[0] + '.key'
if not os.path.exists(home_cert):
home_path = '/root/.acme.sh/' + domains[0]
home_cert = home_path + '/fullchain.cer'
home_key = home_path + '/' + domains[0] + '.key'
if public.isAppleSystem():
user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
@@ -582,6 +613,8 @@ class site_api:
# print home_cert
cmd = 'export ACCOUNT_EMAIL=' + email + ' && ' + execStr
print domains
print cmd
result = public.execShell(cmd)
if not os.path.exists(home_cert.replace("\*", "*")):
@@ -616,7 +649,6 @@ class site_api:
# 写入配置文件
result = self.setSslConf(siteName)
# print result['msg']
if not result['status']:
return public.getJson(result)
result['csr'] = public.readFile(csrpath)
@@ -625,6 +657,39 @@ class site_api:
return public.returnJson(True, 'OK', result)
def httpToHttpsApi(self):
siteName = request.form.get('siteName', '').encode('utf-8')
file = self.getHostConf(siteName)
conf = public.readFile(file)
if conf:
# if conf.find('ssl_certificate') == -1:
# return public.returnJson(False, '当前未开启SSL')
to = """#error_page 404/404.html;
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END"""
conf = conf.replace('#error_page 404/404.html;', to)
public.writeFile(file, conf)
public.restartWeb()
return public.returnJson(True, '设置成功!证书也要设置好哟!')
def closeToHttpsApi(self):
siteName = request.form.get('siteName', '').encode('utf-8')
file = self.getHostConf(siteName)
conf = public.readFile(file)
if conf:
rep = "\n\s*#HTTP_TO_HTTPS_START(.|\n){1,300}#HTTP_TO_HTTPS_END"
conf = re.sub(rep, '', conf)
rep = "\s+if.+server_port.+\n.+\n\s+\s*}"
conf = re.sub(rep, '', conf)
public.writeFile(file, conf)
public.restartWeb()
return public.returnJson(True, '关闭HTTPS跳转成功!')
def getIndexApi(self):
sid = request.form.get('id', '').encode('utf-8')
data = {}
@@ -757,7 +822,7 @@ class site_api:
public.restartWeb()
msg = public.getInfo('网站[{1}]添加域名[{2}]成功!', (webname, domain_name))
public.writeLog('TYPE_SITE', msg)
public.writeLog('网站管理', msg)
public.M('domain').add('pid,name,port,addtime',
(pid, domain_name, domain_port, public.getDate()))
@@ -1056,7 +1121,7 @@ class site_api:
public.M('domain').where("id=?", (find['id'],)).delete()
msg = public.getInfo('网站[{1}]删除域名[{2}]成功!', (webname, domain))
public.writeLog('TYPE_SITE', msg)
public.writeLog('网站管理', msg)
public.restartWeb()
return public.returnJson(True, '站点删除成功!')
@@ -1107,9 +1172,58 @@ class site_api:
proxylist.append(i)
return public.getJson(proxylist)
def getSiteTypesApi(self):
# 取网站分类
data = public.M("site_types").field("id,name").order("id asc").select()
data.insert(0, {"id": 0, "name": "默认分类"})
return public.getJson(data)
def addSiteTypeApi(self):
name = request.form.get('name', '').strip().encode('utf-8')
if not name:
return public.returnJson(False, "分类名称不能为空")
if len(name) > 18:
return public.returnJson(False, "分类名称长度不能超过6个汉字或18位字母")
if public.M('site_types').count() >= 10:
return public.returnJson(False, '最多添加10个分类!')
if public.M('site_types').where('name=?', (name,)).count() > 0:
return public.returnJson(False, "指定分类名称已存在!")
public.M('site_types').add("name", (name,))
return public.returnJson(True, '添加成功!')
def removeSiteTypeApi(self):
mid = request.form.get('id', '').encode('utf-8')
if public.M('site_types').where('id=?', (mid,)).count() == 0:
return public.returnJson(False, "指定分类不存在!")
public.M('site_types').where('id=?', (mid,)).delete()
public.M("sites").where("type_id=?", (mid,)).save("type_id", (0,))
return public.returnJson(True, "分类已删除!")
def modifySiteTypeNameApi(self):
# 修改网站分类名称
name = request.form.get('name', '').strip().encode('utf-8')
mid = request.form.get('id', '').encode('utf-8')
if not name:
return public.returnJson(False, "分类名称不能为空")
if len(name) > 18:
return public.returnJson(False, "分类名称长度不能超过6个汉字或18位字母")
if public.M('site_types').where('id=?', (mid,)).count() == 0:
return public.returnJson(False, "指定分类不存在!")
public.M('site_types').where('id=?', (mid,)).setField('name', name)
return public.returnJson(True, "修改成功!")
def setSiteTypeApi(self):
# 设置指定站点的分类
site_ids = request.form.get('site_ids', '').encode('utf-8')
mid = request.form.get('id', '').encode('utf-8')
site_ids = json.loads(site_ids)
for sid in site_ids:
print public.M('sites').where('id=?', (sid,)).setField('type_id', mid)
return public.returnJson(True, "设置成功!")
##### ----- end ----- ###
# 域名编码转换
# 域名编码转换
def toPunycode(self, domain):
import re
if sys.version_info[0] == 2:
@@ -1514,13 +1628,12 @@ location /{
self.sitePort = port.strip().replace(' ', '')
self.phpVersion = version
siteM = public.M('sites')
if siteM.where("name=?", (self.siteName,)).count():
if public.M('sites').where("name=?", (self.siteName,)).count():
return public.returnJson(False, '您添加的站点已存在!')
# 写入数据库
pid = siteM.add('name,path,status,ps,edate,addtime',
(self.siteName, self.sitePath, '1', ps, '0000-00-00', public.getDate()))
pid = public.M('sites').add('name,path,status,ps,edate,addtime,type_id',
(self.siteName, self.sitePath, '1', ps, '0000-00-00', public.getDate(), 0,))
opid = public.M('domain').where(
"name=?", (self.siteName,)).getField('pid')
if opid:
@@ -1532,14 +1645,13 @@ location /{
for domain in siteMenu['domainlist']:
sdomain = domain
swebname = self.siteName
spid = str(get.pid)
spid = str(pid)
# self.addDomain(domain, webname, pid)
public.M('domain').add('pid,name,port,addtime',
(pid, self.siteName, self.sitePort, public.getDate()))
self.createRootDir(self.sitePath)
self.nginxAddConf()
data = {}
@@ -1550,16 +1662,22 @@ location /{
def deleteWSLogs(self, webname):
assLogPath = public.getLogsDir() + '/' + webname + '.log'
errLogPath = public.getLogsDir() + '/' + webname + '.error.log'
confFile = self.setupPath + '/openresty/nginx/conf/vhost/' + webname + '.conf'
rewriteFile = self.setupPath + '/openresty/nginx/conf/rewrite/' + webname + '.conf'
logs = [assLogPath, errLogPath, confFile, rewriteFile]
confFile = self.setupPath + '/nginx/vhost/' + webname + '.conf'
rewriteFile = self.setupPath + '/nginx/rewrite/' + webname + '.conf'
rewriteFile = self.setupPath + '/nginx/pass/' + webname + '.conf'
keyPath = self.sslDir + webname + '/privkey.pem'
certPath = self.sslDir + webname + '/fullchain.pem'
logs = [assLogPath,
errLogPath,
confFile,
rewriteFile,
keyPath,
certPath]
for i in logs:
public.deleteFile(i)
def delete(self, sid, webname, path):
self.deleteWSLogs(webname)
if path == '1':
rootPath = public.getWwwDir() + '/' + webname
public.execShell('rm -rf ' + rootPath)
@@ -1617,7 +1735,7 @@ location /{
self.saveCert(keyPath, certPath)
msg = public.getInfo('网站[{1}]开启SSL成功!', siteName)
public.writeLog('TYPE_SITE', msg)
public.writeLog('网站管理', msg)
return public.returnData(True, 'SSL开启成功!')
def saveCert(self, keyPath, certPath):
+1 -3
View File
@@ -601,11 +601,10 @@ class system_api:
return 'test'
old_list = old.split('.')
ret = 'none'
for i in range(len(old_list)):
tm_new = int(new_list[i])
tm_old = int(new_list[i])
tm_old = int(old_list[i])
if tm_new > tm_old:
return 'new'
return ret
@@ -614,7 +613,6 @@ class system_api:
upAddr = 'https://raw.githubusercontent.com/midoks/mdserver-web/master/version/info.json'
try:
version = public.httpGet(upAddr)
print version
version = json.loads(version)
return version[0]
except Exception as e:
+5 -2
View File
@@ -15,12 +15,15 @@ mw_start_debug(){
gunicorn -b :7200 -k gevent -w 1 app:app
# gunicorn -b :7200 -k eventlet -w 1 app:app
# gunicorn -c setting.py app:app
}
mw_stop()
{
ps -ef|grep app:app |grep -v grep|awk '{print $2}'|xargs kill -9
PLIST=`ps -ef|grep app:app |grep -v grep|awk '{print $2}'`
for i in $PLIST
do
kill -9 $i
done
ps -ef|grep task.py |grep -v grep|awk '{print $2}'|xargs kill -9
}
+6
View File
@@ -65,11 +65,17 @@ CREATE TABLE IF NOT EXISTS `sites` (
`path` TEXT,
`status` TEXT,
`index` TEXT,
`type_id` INTEGER,
`ps` TEXT,
`edate` TEXT,
`addtime` TEXT
);
CREATE TABLE IF NOT EXISTS `site_types` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT
);
CREATE TABLE IF NOT EXISTS `domain` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`pid` INTEGER,
Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

-16
View File
@@ -1,16 +0,0 @@
<div class="bt-form">
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('abkill');">服务</p>
<p onclick="pluginInitD('abkill');">自启动</p>
<p onclick="pluginConfig('abkill');">黑名单</p>
<p onclick="pluginConfig('abkill');">异常日志</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=abkill&f=js/abkill.js");
</script>
-172
View File
@@ -1,172 +0,0 @@
# coding: utf-8
import time
import random
import os
import urllib
import binascii
import json
import re
import sys
import subprocess
sys.path.append(os.getcwd() + "/class/core")
import public
app_debug = False
if public.getOs() == 'darwin':
app_debug = True
def getPluginName():
return 'abkill'
def getPluginDir():
return public.getPluginDir() + '/' + getPluginName()
def getServerDir():
return public.getServerDir() + '/' + getPluginName()
def getInitDFile():
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
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():
initd_file = getInitDFile()
if not os.path.exists(initd_file):
return getServerDir()
return initd_file
def status():
data = public.execShell(
"ps -ef|grep " + getPluginName() + " |grep -v grep | grep -v python | awk '{print $2}'")
if data[0] == '':
return 'stop'
return 'start'
def csvnOp(method):
if app_debug:
os_name = public.getOs()
if os_name == 'darwin':
return "Apple Computer does not support"
_initd_csvn = '/etc/init.d/csvn'
_initd_csvn_httpd = '/etc/init.d/csvn-httpd'
#_csvn = getServerDir() + '/bin/csvn'
#_csvn_httpd = getServerDir() + '/bin/csvn-httpd'
ret_csvn_httpd = public.execShell(_initd_csvn_httpd + ' ' + method)
# ret_csvn = public.execShell(_initd_csvn + ' ' + method)
subprocess.Popen(_initd_csvn + ' ' + method,
stdout=subprocess.PIPE, shell=True)
if ret_csvn_httpd[1] == '':
return 'ok'
return 'fail'
def start():
return csvnOp('start')
def stop():
return csvnOp('stop')
def restart():
return csvnOp('restart')
def reload():
return csvnOp('reload')
def initdStatus():
if not app_debug:
if public.getOs() == 'darwin':
return "Apple Computer does not support"
_initd_csvn = '/etc/init.d/csvn'
_initd_csvn_httpd = '/etc/init.d/csvn-httpd'
if os.path.exists(_initd_csvn) and os.path.exists(_initd_csvn_httpd):
return 'ok'
return 'fail'
def initdInstall():
import shutil
if not app_debug:
if public.getOs() == 'darwin':
return "Apple Computer does not support"
_csvn = getServerDir() + '/bin/csvn'
_csvn_httpd = getServerDir() + '/bin/csvn-httpd'
ret_csvn = public.execShell(_csvn + ' install')
ret_csvn_httpd = public.execShell(_csvn_httpd + ' install')
if ret_csvn[1] == '' and ret_csvn_httpd[1] == '':
return 'ok'
return 'fail'
def initdUinstall():
if not app_debug:
if public.getOs() == 'darwin':
return "Apple Computer does not support"
_csvn = getServerDir() + '/bin/csvn'
_csvn_httpd = getServerDir() + '/bin/csvn-httpd'
ret_csvn = public.execShell(_csvn + ' remove')
ret_csvn_httpd = public.execShell(_csvn_httpd + ' remove')
return 'ok'
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 == 'initd_status':
print initdStatus()
elif func == 'initd_install':
print initdInstall()
elif func == 'initd_uninstall':
print initdUinstall()
else:
print 'fail'
-16
View File
@@ -1,16 +0,0 @@
{
"sort": 7,
"ps": "异常程序监控和KILL",
"shell": "install.sh",
"name": "abkill",
"title": "异常程序监控",
"versions": "0.1",
"updates":"0.1",
"tip": "soft",
"checks": "server/abkill",
"author": "midoks",
"date": "201-04-01",
"home": "https://www.collab.net",
"type": "异常程序监控和KILL",
"pid": "4"
}
-76
View File
@@ -1,76 +0,0 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
ak_path={$SERVER_PATH}/abkill
ak_start(){
isStart=$(ps aux |grep 'abkill.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" == '' ];then
echo -e "Starting abkill... \c"
cd $ak_path && nohup python abkill.py >> $ak_path/task.log 2>&1 &
sleep 0.3
isStart=$(ps aux |grep 'abkill.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" == '' ];then
echo -e "\033[31mfailed\033[0m"
echo '------------------------------------------------------'
tail -n 20 $ak_path/task.log
echo '------------------------------------------------------'
echo -e "\033[31mError: abkill service startup failed.\033[0m"
return;
fi
echo -e "\033[32mdone\033[0m"
else
echo "Starting abkill(pid $isStart) already running"
fi
}
ak_stop()
{
echo -e "Stopping abkill... \c";
pids=$(ps aux | grep 'abkill.py' | grep -v grep|awk '{print $2}')
arr=($pids)
for p in ${arr[@]}
do
kill -9 $p
done
echo -e "\033[32mdone\033[0m"
}
ak_status()
{
isStart=$(ps aux|grep 'abkill.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" != '' ];then
echo -e "\033[32mabkill (pid $(echo $isStart)) already running\033[0m"
else
echo -e "\033[31mabkill not running\033[0m"
fi
}
ak_reload()
{
isStart=$(ps aux|grep 'abkill.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" != '' ];then
ak_stop
ak_start
else
echo -e "\033[31mmw not running\033[0m"
mw_start
fi
}
case "$1" in
'start') ak_start;;
'stop') ak_stop;;
'reload') ak_reload;;
'restart')
ak_stop
sleep 0.3
ak_start;;
'status') ak_status;;
esac
-1
View File
@@ -1 +0,0 @@
pluginService('abkill');
-85
View File
@@ -1,85 +0,0 @@
# coding: utf-8
# 使用示例:
# 1、将此文件重命名为btkill.py , 然后上传到服务器/root目录
# 2、执行 python /root/btkill.py
import time
import os
import sys
sys.path.append("/usr/local/lib/python2.7/site-packages")
import psutil
class btkill:
__limit = 10 # Cpu使用率触发上限
__vmsize = 1048576 / 4 # 虚拟内存触发上限(字节)
def checkMain(self):
pids = psutil.pids()
print pids
num = 0
for pid in pids:
try:
p = psutil.Process(pid)
if p.exe() == "":
continue
name = p.name()
if self.whiteList(name):
continue
cputimes = p.cpu_times()
if cputimes.user < 0.1:
continue
print p
percent = p.cpu_percent(interval=1)
vm = p.memory_info().vms
if percent > self.__limit or vm > self.__vmsize:
log = time.strftime('%Y-%m-%d %X', time.localtime()) + " (PID=" + str(
pid) + ", NAME=" + name + ", VMS=" + str(vm) + ", PERCENT=" + str(percent) + "%)"
# p.kill()
num += 1
print log + " >> killed\n"
except Exception as ex:
print str(ex)
return num
# 检查白名单
def whiteList(self, name):
wlist = ['yum', 'apt-get', 'apt', 'redis-cli', 'memcached', 'sshd', 'vm', 'vim', 'htop', 'top', 'sh', 'bash', 'zip', 'gzip', 'rsync',
'tar', 'unzip', 'php', 'composer', 'pkill', 'mongo', 'mongod', 'php-fpm', 'nginx', 'httpd', 'lsof', 'ps', 'redis-server',
'mysqld', 'mysqld_safe', 'mysql', 'pure-ftpd', 'sparse_dd', 'stunnel', 'squeezed', 'vncterm', 'awk', 'ruby', 'postgres',
'mpathalert', 'vncterm', 'multipathd', 'fe', 'elasticsyslog', 'syslogd', 'v6d', 'xapi', 'screen', 'runsvdir', 'svlogd',
'java', 'udevd', 'ntpd', 'irqbalance', 'qmgr', 'wpa_supplicant', 'mysqld_safe', 'sftp-server', 'lvmetad', 'gitlab-web',
'pure-ftpd', 'auditd', 'master', 'dbus-daemon', 'tapdisk', 'sshd', 'init', 'ksoftirqd', 'kworker', 'kmpathd',
'kmpath_handlerd', 'python', 'kdmflush', 'bioset', 'crond', 'kthreadd', 'migration', 'rcu_sched', 'kjournald',
'gcc', 'gcc++', 'nginx', 'mysqld', 'php-cgi', 'login', 'firewalld', 'iptables', 'systemd', 'network', 'dhclient',
'systemd-journald', 'NetworkManager', 'systemd-logind', 'systemd-udevd', 'polkitd', 'tuned', 'rsyslogd', 'AliYunDunUpdate', 'AliYunDun', 'sendmail']
wslist = ['vif', 'qemu', 'scsi_eh', 'xcp',
'xen', 'docker', 'yunsuo', 'aliyun', 'PM2']
for key in wlist:
if key == name:
return True
for key in wslist:
if name.find(key) != -1:
return True
return False
# 开始处理
def start(self):
num = 0
while True:
num += self.checkMain()
print "查杀完成, 共查杀[" + str(num) + "]个异常进程!"
time.sleep(3)
print '======================================='
print "查杀完成, 共查杀[" + str(num) + "]个异常进程!"
if __name__ == "__main__":
print "正在检测异常进程..."
print '======================================='
c = btkill()
c.start()
+11 -8
View File
@@ -25,14 +25,17 @@ resetPluginWinWidth(700);
$.getScript( "/plugins/file?name=csvn&f=js/csvn.js");
function csvnReadme(){
var html = '<p>* 注意:在启动时会比较慢,需要耐心等待一会</p>';
html += '<p>* 注意:csvn需要java环境,在安装会自动检查并安装</p>';
html += '<p>* 注意:默认后台密码admin:admin,最好马上修改</p>';
html += '<p>* 注意:牢记admin的密码,在后csvn的管理后台和这里不同步</p>';
html += '<p>* 注意:在这里添加用户和csvn后台并不同步</p>';
html += '<p>* 注意:项目管理的地址一般是正确的,但在特殊环境下,地址可能不一致</p>';
html += '<p>* 注意:脚本内使用sudo名,需要注释(vi /etc/sudoers)[#Default requiretty]</p>';
$('.bt-w-main .soft-man-con').html(html);
var readme = '<ul class="help-info-text c7">';
readme += '<li>注意:在启动时会比较慢,需要耐心等待一会</li>';
readme += '<li>注意:csvn需要java环境,在安装会自动检查并安装</li>';
readme += '<li>注意:默认后台密码admin:admin,最好马上修改</li>';
readme += '<li>注意:牢记admin的密码,在后csvn的管理后台和这里不同步</li>';
readme += '<li>注意:在这里添加用户和csvn后台并不同步</li>';
readme += '<li>注意:项目管理的地址一般是正确的,但在特殊环境下,地址可能不一致</li>';
readme += '<li>注意:脚本内使用sudo名,需要注释(vi /etc/sudoers)[#Default requiretty]</li>';
readme += '</ul>';
$('.bt-w-main .soft-man-con').html(readme);
}
</script>
+1 -1
View File
@@ -7,7 +7,7 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
CSVN_SOURCE='https://github.com/midoks/mdserver-web/releases/download/init/CollabNetSubversionEdge-5.1.4_linux-x86_64.tar.xz'
+1 -1
View File
@@ -7,7 +7,7 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
Install_gae()
{
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
GITADDR="{$GITROOTURL}{$USERNAME}/{$PROJECT}"
GITADDR="{$GITROOTURL}/{$USERNAME}/{$PROJECT}"
GIT_SDIR="{$CODE_DIR}"
GIT_USER_DIR="${GIT_SDIR}/{$USERNAME}"
+57 -12
View File
@@ -46,11 +46,11 @@ def getArgs():
if args_len == 1:
t = args[0].strip('{').strip('}')
t = t.split(':')
t = t.split(':', 1)
tmp[t[0]] = t[1]
elif args_len > 1:
for i in range(len(args)):
t = args[i].split(':')
t = args[i].split(':', 1)
tmp[t[0]] = t[1]
return tmp
@@ -84,19 +84,37 @@ def status():
return 'start'
def contentReplace(content):
user = 'root'
def getHomeDir():
if public.isAppleSystem():
user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
content = content.replace('{$HOME_DIR}', '/Users/' + user)
return '/Users/' + user
else:
content = content.replace('{$HOME_DIR}', '/root')
return '/root'
def getRunUser():
if public.isAppleSystem():
user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return user
else:
return 'root'
__SR = '''#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
export USER=%s
export HOME=%s && ''' % ( getRunUser(), getHomeDir())
def contentReplace(content):
service_path = public.getServerDir()
content = content.replace('{$ROOT_PATH}', public.getRootDir())
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$RUN_USER}', user)
content = content.replace('{$RUN_USER}', getRunUser())
content = content.replace('{$HOME_DIR}', getHomeDir())
return content
@@ -141,6 +159,15 @@ def getRootUrl():
return tmp.groups()[0]
def getSshPort():
content = public.readFile(getConf())
rep = 'SSH_PORT\s*=\s*(.*)'
tmp = re.search(rep, content)
if not tmp:
return ''
return tmp.groups()[0]
def getRootPath():
content = public.readFile(getConf())
rep = 'ROOT\s*=\s*(.*)'
@@ -221,7 +248,7 @@ def start():
if not data['status']:
return data['msg']
data = public.execShell(file + ' start')
data = public.execShell(__SR + file + ' start')
if data[1] == '':
return 'ok'
return data[0]
@@ -229,7 +256,7 @@ def start():
def stop():
file = initDreplace()
data = public.execShell(file + ' stop')
data = public.execShell(__SR + file + ' stop')
if data[1] == '':
return 'ok'
return data[1]
@@ -237,7 +264,7 @@ def stop():
def restart():
file = initDreplace()
data = public.execShell(file + ' reload')
data = public.execShell(__SR + file + ' restart')
if data[1] == '':
return 'ok'
return data[1]
@@ -245,7 +272,7 @@ def restart():
def reload():
file = initDreplace()
data = public.execShell(file + ' reload')
data = public.execShell(__SR + file + ' reload')
if data[1] == '':
return 'ok'
return data[1]
@@ -273,6 +300,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -283,6 +311,7 @@ def initdUinstall():
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
public.execShell('chkconfig --del ' + getPluginName())
return 'ok'
@@ -512,7 +541,9 @@ def projectScriptLoad():
codeDir = public.getRootDir() + '/git'
cc_content = public.readFile(commit_tpl)
cc_content = cc_content.replace('{$GITROOTURL}', getRootUrl())
sshUrl = 'ssh://127.0.0.1:' + getSshPort()
cc_content = cc_content.replace('{$GITROOTURL}', sshUrl)
cc_content = cc_content.replace('{$CODE_DIR}', codeDir)
cc_content = cc_content.replace('{$USERNAME}', user)
cc_content = cc_content.replace('{$PROJECT}', args['name'])
@@ -574,6 +605,17 @@ def gogsEdit():
return public.getJson(data)
def getRsaPublic():
path = getHomeDir()
path += '/.ssh/id_rsa.pub'
content = public.readFile(path)
data = {}
data['public'] = content
return public.getJson(data)
def getTotalStatistics():
st = status()
data = {}
@@ -591,6 +633,7 @@ def getTotalStatistics():
data['count'] = 0
return public.returnJson(False, 'fail', data)
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
@@ -635,6 +678,8 @@ if __name__ == "__main__":
print projectScriptDebug()
elif func == 'gogs_edit':
print gogsEdit()
elif func == 'get_rsa_public':
print getRsaPublic()
elif func == 'get_total_statistics':
print getTotalStatistics()
else:
+25 -16
View File
@@ -25,12 +25,17 @@ if [ -f /etc/init.d/functions ];then
. /etc/init.d/functions
fi
if [ -f /etc/rc.d/init.d/functions ];then
. /etc/rc.d/init.d/functions
fi
# Default values
HOME={$HOME_DIR}
export HOME={$HOME_DIR}
export USER={$RUN_USER}
NAME=gogs
GOGS_HOME={$SERVER_PATH}/gogs
GOGS_PATH=${GOGS_HOME}/$NAME
GOGS_USER=midoks
GOGS_USER={$RUN_USER}
SERVICENAME="Gogs"
LOCKFILE=/tmp/gogs.lock
LOGPATH=${GOGS_HOME}/log
@@ -38,12 +43,17 @@ LOGFILE=${LOGPATH}/gogs.log
RETVAL=0
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
DAEMON_OPTS="--check $NAME"
[ ! -z "$GOGS_USER" ] && DAEMON_OPTS="$DAEMON_OPTS --user=${GOGS_USER}"
status(){
isStart=`ps -ef|grep 'gogs web' |grep -v grep|awk '{print $2}'`
if [ "$isStart" == '' ];then
echo "${SERVICENAME} not running"
echo -e "${SERVICENAME} not running"
else
echo "${SERVICENAME}(pid $(echo $isStart)) already running"
echo -e "${SERVICENAME}(pid $(echo $isStart)) already running"
fi
}
@@ -55,24 +65,23 @@ start() {
fi
cd ${GOGS_HOME}
echo "Starting ${SERVICENAME}: \c"
echo -e "Starting ${SERVICENAME}: \c"
${GOGS_PATH} web > ${LOGFILE} 2>&1 &
RETVAL=$?
[ $RETVAL = 0 ] && touch ${LOCKFILE} && echo "\033[32mdone\033[0m"
[ $RETVAL = 0 ] && touch ${LOCKFILE} && echo -e "\033[32mdone\033[0m"
return $RETVAL
}
stop() {
cd ${GOGS_HOME}
echo "Shutting down ${SERVICENAME}: \c"
which "killproc" > /dev/null
if [ $? -eq 0 ];then
killproc ${NAME}
else
pkill ${NAME}
fi
RETVAL=$?
[ $RETVAL = 0 ] && rm -f ${LOCKFILE} && echo "\033[32mdone\033[0m"
pids=`ps -ef|grep 'gogs web' |grep -v grep|awk '{print $2}'`
arr=($pids)
echo -e "Stopping gogs... \c"
for p in ${arr[@]}
do
kill -9 $p
done
echo -e "\033[32mdone\033[0m"
}
case "$1" in
+9 -1
View File
@@ -7,7 +7,7 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
GOGS_DOWNLOAD='https://dl.gogs.io'
@@ -49,6 +49,14 @@ Install_gogs()
mv $serverPath/source/gogs/gogs_${version}/gogs/ $serverPath/gogs
echo $version > $serverPath/gogs/version.pl
# if id -u gogs > /dev/null 2>&1; then
# echo "gogs user exists"
# else
# useradd gogs
# cp /etc/sudoers{,.`date +"%Y-%m-%d_%H-%M-%S"`}
# echo "gogs ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# fi
echo 'install success' > $install_tmp
}
+33 -7
View File
@@ -87,13 +87,12 @@ function gogsSetConfig(){
//提交PHP配置
function submitGogsConf() {
var data = {
DOMAIN: $("select[name='DOMAIN']").val(),
ROOT_URL: $("select[name='ROOT_URL']").val(),
DOMAIN: $("input[name='DOMAIN']").val(),
ROOT_URL: $("input[name='ROOT_URL']").val(),
HTTP_ADDR: $("select[name='HTTP_ADDR']").val(),
HTTP_PORT: $("select[name='HTTP_PORT']").val(),
HTTP_PORT: $("input[name='HTTP_PORT']").val(),
START_SSH_SERVER: $("select[name='START_SSH_SERVER']").val() || 'false',
SSH_PORT: $("select[name='SSH_PORT']").val(),
ROOT_URL: $("select[name='ROOT_URL']").val(),
SSH_PORT: $("input[name='SSH_PORT']").val(),
REQUIRE_SIGNIN_VIEW: $("select[name='REQUIRE_SIGNIN_VIEW']").val() || 'false',
ENABLE_CAPTCHA: $("select[name='ENABLE_CAPTCHA']").val() || 'true',
DISABLE_REGISTRATION: $("select[name='DISABLE_REGISTRATION']").val() || 'false',
@@ -313,8 +312,35 @@ function projectScriptDebug(user,name){
});
}
function getRsaPublic(){
gogsPost('get_rsa_public', {}, function(data){
var rdata = $.parseJSON(data.data);
var con = '<div class="tab-con">\
<div class="myKeyCon ptb15">\
<textarea style="margin:0px;width:580px;height:110px;outline:none;" spellcheck="false">'+rdata.public+'</textarea>\
</div>\
<ul class="help-info-text c7 pull-left"></ul>\
</div>'
layer.open({
type: 1,
area: "600px",
title: '本机公钥',
closeBtn: 2,
shift: 5,
shadeClose: false,
content:con
});
});
}
function gogsRead(){
var readme = '<p>* 默认使用MySQL,第一个启动加载各种配置,并修改成正确的数据库配置</p>';
readme += '<p>* 邮件端口使用456,gogs仅支持使用STARTTLS的SMTP协议</p>';
var readme = '<ul class="help-info-text c7">';
readme += '<li>默认使用MySQL,第一个启动加载各种配置,并修改成正确的数据库配置</li>';
readme += '<li>邮件端口使用456,gogs仅支持使用STARTTLS的SMTP协议</li>';
readme += '<li>如果使用项目中脚本本地同步,<a target="_blank" href="https://github.com/midoks/mdserver-web/wiki/%E6%8F%92%E4%BB%B6%E7%AE%A1%E7%90%86%5Bgogs%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%5D#%E5%90%AF%E5%8A%A8gogs%E5%90%8E%E5%A6%82%E6%9E%9C%E8%A6%81%E4%BD%BF%E7%94%A8hook%E8%84%9A%E6%9C%AC%E5%90%8C%E6%AD%A5%E4%BB%A3%E7%A0%81%E9%9C%80%E8%A6%81%E5%BC%80%E5%90%AFssh%E7%AB%AF%E5%8F%A3">点击查看</></li>';
readme += '<li><a href="#" onclick="getRsaPublic();">点击查看本机公钥</></li>';
readme += '</ul>';
$('.soft-man-con').html(readme);
}
+4
View File
@@ -194,10 +194,12 @@ def initdInstall():
if public.isAppleSystem():
return "Apple Computer does not support"
mem_bin = initDreplace()
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -205,6 +207,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+9 -12
View File
@@ -1,4 +1,5 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
@@ -7,35 +8,31 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
Install_mem()
{
Install_mem(){
mkdir -p $serverPath/source
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
if
fi
cd $serverPath/source && tar -zxvf memcached.tar.gz
mkdir -p $serverPath/memcached
cd memcached* && ./configure --prefix=$serverPath/memcached && make && make install
cd $serverPath/source/memcached*
./configure --prefix=$serverPath/memcached && make && make install
echo '1.5' > $serverPath/memcached/version.pl
echo '安装完成' > $install_tmp
echo 'install ok' > $install_tmp
}
Uninstall_mem()
{
$serverPath/memcached/init.d/memcached stop
rm -rf mkdir -p $serverPath/memcached
${serverPath}/memcached/init.d/memcached stop
rm -rf $serverPath/memcached
}
+1
View File
@@ -31,6 +31,7 @@
<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>
+93 -17
View File
@@ -151,10 +151,6 @@ def getDataDir():
def binLog():
args = getArgs()
# data = checkArgs(args, ['status'])
# if not data[0]:
# return data[1]
conf = getConf()
con = public.readFile(conf)
@@ -163,7 +159,7 @@ def binLog():
return public.returnJson(False, '0')
con = con.replace('#log-bin=mysql-bin', 'log-bin=mysql-bin')
con = con.replace('#binlog_format=mixed', 'binlog_format=mixed')
os.system('sync')
public.execShell('sync')
restart()
else:
path = getDataDir()
@@ -177,9 +173,9 @@ def binLog():
return public.returnJson(True, dsize)
con = con.replace('log-bin=mysql-bin', '#log-bin=mysql-bin')
con = con.replace('binlog_format=mixed', '#binlog_format=mixed')
os.system('sync')
public.execShell('sync')
restart()
os.system('rm -f ' + path + '/mysql-bin.*')
public.execShell('rm -f ' + path + '/mysql-bin.*')
public.writeFile(conf, con)
return public.returnJson(True, '设置成功!')
@@ -195,12 +191,14 @@ def getErrorLog():
if n == 'error.log':
filename = path + '/' + n
break
print filename
if not os.path.exists(filename):
return public.returnJson(False, '指定文件不存在!')
if args.has_key('close'):
public.writeFile(filename, '')
return public.returnJson(True, '日志已清空')
return public.getNumLines(filename, 1000)
return public.returnJson(False, '日志已清空')
info = public.getNumLines(filename, 1000)
return public.returnJson(True, 'OK', info)
def getShowLogFile():
@@ -295,6 +293,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(mysql_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -302,11 +301,63 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
def getMyDbPos():
file = getConf()
content = public.readFile(file)
rep = 'datadir\s*=\s*(.*)'
tmp = re.search(rep, content)
return tmp.groups()[0].strip()
def setMyDbPos():
args = getArgs()
data = checkArgs(args, ['datadir'])
if not data[0]:
return data[1]
s_datadir = getMyDbPos()
t_datadir = args['datadir']
if t_datadir == s_datadir:
return public.returnJson(False, '与当前存储目录相同,无法迁移文件!')
if not os.path.exists(t_datadir):
public.execShell('mkdir -p ' + t_datadir)
# public.execShell('/etc/init.d/mysqld stop')
stop()
public.execShell('cp -rf ' + s_datadir + '/* ' + t_datadir + '/')
public.execShell('chown -R mysql.mysql ' + t_datadir)
public.execShell('chmod -R 755 ' + t_datadir)
public.execShell('rm -f ' + t_datadir + '/*.pid')
public.execShell('rm -f ' + t_datadir + '/*.err')
path = getServerDir()
myfile = path + '/etc/my.cnf'
mycnf = public.readFile(myfile)
public.writeFile(path + '/etc/my_backup.cnf', mycnf)
mycnf = mycnf.replace(s_datadir, t_datadir)
public.writeFile(myfile, mycnf)
start()
result = public.execShell(
'ps aux|grep mysqld| grep -v grep|grep -v python')
if len(result[0]) > 10:
public.writeFile('data/datadir.pl', t_datadir)
return public.returnJson(True, '存储目录迁移成功!')
else:
public.execShell('pkill -9 mysqld')
public.writeFile(myfile, public.readFile(path + '/etc/my_backup.cnf'))
start()
return public.returnJson(False, '文件迁移失败!')
def getMyPort():
file = getConf()
content = public.readFile(file)
@@ -317,8 +368,9 @@ def getMyPort():
def setMyPort():
args = getArgs()
if not 'port' in args:
return 'port missing'
data = checkArgs(args, ['port'])
if not data[0]:
return data[1]
port = args['port']
file = getConf()
@@ -586,8 +638,10 @@ def syncToDatabases():
def setRootPwd():
args = getArgs()
if not 'password' in args:
return 'password missing'
data = checkArgs(args, ['password'])
if not data[0]:
return data[1]
password = args['password']
try:
pdb = pMysqlDb()
@@ -648,15 +702,31 @@ def setUserPwd():
return isError
pdb.execute("flush privileges")
psdb.where("id=?", (id,)).setField('password', newpassword)
return public.returnJson(True, public.getInfo('修改数据库[{1}]密码成功!', (name)))
return public.returnJson(True, public.getInfo('修改数据库[{1}]密码成功!', (name,)))
except Exception as ex:
print str(ex)
return public.returnJson(False, public.getInfo('修改数据库[{1}]密码失败!', (name)))
# print str(ex)
return public.returnJson(False, public.getInfo('修改数据库[{1}]密码失败!', (name,)))
def setDbPs():
args = getArgs()
data = checkArgs(args, ['id', 'name', 'ps'])
if not data[0]:
return data[1]
ps = args['ps']
sid = args['id']
name = args['name']
try:
psdb = pSqliteDb('databases')
psdb.where("id=?", (sid,)).setField('ps', ps)
return public.returnJson(True, public.getInfo('修改数据库[{1}]备注成功!', (name,)))
except Exception as e:
return public.returnJson(True, public.getInfo('修改数据库[{1}]备注失败!', (name,)))
def addDb():
args = getArgs()
data = checkArgs(args,
['password', 'name', 'codeing', 'db_user', 'dataAccess', 'ps'])
if not data[0]:
@@ -990,6 +1060,10 @@ if __name__ == "__main__":
print getErrorLog()
elif func == 'show_log':
print getShowLogFile()
elif func == 'my_db_pos':
print getMyDbPos()
elif func == 'set_db_pos':
print setMyDbPos()
elif func == 'my_port':
print getMyPort()
elif func == 'set_my_port':
@@ -1014,6 +1088,8 @@ if __name__ == "__main__":
print getDbAccess()
elif func == 'set_db_access':
print setDbAccess()
elif func == 'set_db_ps':
print setDbPs()
elif func == 'get_db_info':
print getDbInfo()
elif func == 'repair_table':
+2 -1
View File
@@ -4,7 +4,8 @@
"name":"mysql",
"type":"运行环境",
"ps":"MySQL是一种关系数据库管理系统!",
"versions":["5.5","5.6","5.7","8.0"],
"todo_versions":["5.6","5.7","8.0"],
"versions":["5.5"],
"updates":["5.5.62"],
"shell":"install.sh",
"checks":"server/mysql",
+4
View File
@@ -1,4 +1,8 @@
#!/bin/sh
# chkconfig: 2345 55 25
# Description: mysql service
# distro. For CentOS/Redhat run: 'chkconfig --add mysql'
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
+1 -1
View File
@@ -8,7 +8,7 @@ rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
action=$1
+39 -35
View File
@@ -88,6 +88,26 @@ function runInfo(){
}
function myDbPos(){
myPost('my_db_pos','',function(data){
var con = '<div class="line ">\
<div class="info-r ml0">\
<input id="datadir" name="datadir" class="bt-input-text mr5 port" type="text" style="width:330px" value="'+data.data+'">\
<span class="glyphicon cursor mr5 glyphicon-folder-open icon_datadir" onclick="changePath(\'datadir\')"></span>\
<button id="btn_change_path" name="btn_change_path" class="btn btn-success btn-sm mr5 ml5 btn_change_port">迁移</button>\
</div></div>';
$(".soft-man-con").html(con);
$('#btn_change_path').click(function(){
var datadir = $("input[name='datadir']").val();
myPost('set_db_pos','datadir='+datadir,function(data){
var rdata = $.parseJSON(data.data);
layer.msg(rdata.msg,{icon:rdata.status ? 1 : 5,time:2000,shade: [0.3, '#000']});
});
});
});
}
function myPort(){
myPost('my_port','',function(data){
var con = '<div class="line ">\
@@ -469,15 +489,6 @@ function copyPass(password){
$("#bt_copys").click();
}
function readerTableChecked(){
$('table').find('th').find('input').bind('click',function(){
$('table').find('td').find('input').each(function(i,obj){
checked = $(this).prop('checked');
$(this).prop('checked',!checked);
});
});
}
function checkSelect(){
setTimeout(function () {
var num = $('input[type="checkbox"].check:checked').length;
@@ -749,36 +760,26 @@ function delDbBatch(){
}
function setDataByKey(tab, key, obj) {
function setDbPs(id, name, obj) {
var _span = $(obj);
var _input = $("<input class='baktext' value="+_span.text()+" type='text' placeholder='备注信息' />");
var _input = $("<input class='baktext' value=\""+_span.text()+"\" type='text' placeholder='备注信息' />");
_span.hide().after(_input);
_input.focus();
_input.blur(function(){
// var item = $(this).parents('tr').data('item');
// console.log(item);
// var _txt = $(this);
// var data = {table:tab,id:item.id};
// data[key] = _txt.val()
// bt.pub.set_data_ps(data,function(rdata){
// if(rdata.status){
// _span.text(_txt.val());
// _span.show();
// _txt.remove();
// }
// })
})
$(this).remove();
var ps = _input.val();
_span.text(ps).show();
var data = {name:name,id:id,ps:ps};
myPost('set_db_ps', data, function(data){
var rdata = $.parseJSON(data.data);
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
});
});
_input.keyup(function(){
if(event.keyCode == 13){
_input.trigger('blur');
}
})
}
function setDbPs(data,callback){
bt.send('setPs','data/setPs',data,function(rdata){
if(callback) callback(rdata);
})
});
}
function openPhpmyadmin(name,username,password){
@@ -847,7 +848,7 @@ function dbList(page, search){
'<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="setDataByKey(\'databases\',\'ps\',this)" style="display: inline-block;">'+rdata.data[i]['ps']+'</span></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> | ' +
'<a href="javascript:;" class="btlink" onclick="repTools(\''+rdata.data[i]['name']+'\')" title="MySQL优化修复工具">工具</a> | ' +
@@ -944,9 +945,12 @@ function myLogs(){
})
myPost('error_log', 'p=1', function(data){
var error_body = data.data;
if (error_body == "") {
error_body = '当前没有日志内容!';
var rdata = $.parseJSON(data.data);
var error_body = '';
if (rdata.status){
error_body = rdata.data;
} else {
error_body = rdata.msg;
}
$("#error_log").text(error_body);
var ob = document.getElementById('error_log');
+2 -2
View File
@@ -11,7 +11,7 @@ rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
mysqlDir=${serverPath}/source/mysql
Install_mysql()
@@ -54,7 +54,7 @@ Install_mysql()
Uninstall_mysql()
{
#rm -rf $serverPath/mysql
rm -rf $serverPath/mysql
echo '卸载完成' > $install_tmp
}
+3
View File
@@ -232,6 +232,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -239,6 +240,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+1 -1
View File
@@ -2,7 +2,7 @@
# chkconfig: 2345 55 25
# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
# run 'update-rc.d -f nginx defaults', or use the appropriate command on your
# distro. For CentOS/Redhat run: 'chkconfig --add nginx'
# distro. For CentOS/Redhat run: 'chkconfig --add openresty'
### BEGIN INIT INFO
# Provides: nginx
+6 -1
View File
@@ -74,6 +74,7 @@ function orPluginOpService(a, b, v) {
});
} else {
orPluginOpServiceOp(a,b,c,d,a,v);
}
});
})
@@ -98,6 +99,10 @@ function orPluginOpServiceOp(a,b,c,d,a,v){
if( g.status && g.data != 'ok' ) {
layer.msg(g.data, {icon: 2,time: 3000,shade: 0.3,shadeClose: true});
}
setTimeout(function(){
location.reload();
},2000);
},'json').error(function() {
layer.close(e);
layer.msg('操作异常!', {icon: 2});
@@ -151,7 +156,7 @@ function nginxSoftMain(name, version) {
layer.open({
type: 1,
area: '640px',
title: name + lan.soft.admin,
title: name + '管理',
closeBtn: 2,
shift: 0,
content: '<div class="bt-w-main" style="width:640px;">\
+1 -1
View File
@@ -8,7 +8,7 @@ rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
openrestyDir=${serverPath}/source/openresty
Install_openresty()
+1 -1
View File
@@ -7,7 +7,7 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
openrestyDir=${serverPath}/source/openresty
@@ -45,7 +45,7 @@ allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
disable_functions = phpinfo,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
[CLI Server]
cli_server.color = On
@@ -212,8 +212,3 @@ ldap.max_links = -1
[dba]
[curl]
[Zend Opcache]
;[xhprof]
;extension=md_xhprof.so
;xhprof.output_dir="MD:/bin/tmp/xhprof"
@@ -44,7 +44,7 @@ allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
disable_functions = phpinfo,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
[CLI Server]
cli_server.color = On
@@ -211,26 +211,3 @@ ldap.max_links = -1
[dba]
[curl]
[Zend Opcache]
;[xhprof]
;extension=md_xhprof.so
;xhprof.output_dir="MD:/bin/tmp/xhprof"
;extension=igbinary.so
;extension=iconv.so
;extension=yaf.so
;extension=swoole.so
;extension=curl.so
;extension=bcmath.so
;extension=mcrypt.so
;extension=gd.so
;extension=openssl.so
;extension=intl.so
;extension=gettext.so
;extension=imagick.so
;extension=redis.so
;extension=mongodb.so
;extension=memcached.so
;extension=phalcon.so
;extension=opencv.so
+1 -1
View File
@@ -3,6 +3,7 @@
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('php', $('.plugin_version').attr('version'));">服务</p>
<p onclick="pluginInitD('php', $('.plugin_version').attr('version'));">自启动</p>
<p onclick="phpLibConfig($('.plugin_version').attr('version'));">安装扩展</p>
<p onclick="phpSetConfig($('.plugin_version').attr('version'));">配置修改</p>
<p onclick="phpUploadLimitReq($('.plugin_version').attr('version'));">上传限制</p>
@@ -25,5 +26,4 @@
$.getScript( "/plugins/file?name=php&f=js/php.js", function(){
pluginService('php', $('.plugin_version').attr('version'));
});
</script>
+66 -18
View File
@@ -12,6 +12,8 @@ reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append(os.getcwd() + "/class/core")
sys.path.append("/usr/local/lib/python2.7/site-packages")
import public
app_debug = False
@@ -31,10 +33,10 @@ def getServerDir():
return public.getServerDir() + '/' + getPluginName()
def getInitDFile():
def getInitDFile(version):
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
return '/etc/init.d/' + getPluginName()+version
def getArgs():
@@ -156,7 +158,7 @@ def phpFpmWwwReplace(version):
def makePhpIni(version):
d_ini = public.getServerDir() + '/php/' + version + '/etc/php.ini'
if not os.path.exists(d_ini):
s_ini = getPluginDir() + '/conf/php' + version + '.ini'
s_ini = getPluginDir() + '/conf/php' + version[0:1] + '.ini'
shutil.copyfile(s_ini, d_ini)
@@ -214,6 +216,41 @@ def reload(version):
return phpOp(version, 'reload')
def initdStatus(version):
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
initd_bin = getInitDFile(version)
if os.path.exists(initd_bin):
return 'ok'
return 'fail'
def initdInstall(version):
import shutil
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
source_bin = initReplace(version)
initd_bin = getInitDFile(version)
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName()+version)
return 'ok'
def initdUinstall(version):
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile(version)
os.remove(initd_bin)
return 'ok'
def fpmLog(version):
return getServerDir() + '/' + version + '/var/log/php-fpm.log'
@@ -480,30 +517,34 @@ def setDisableFunc(version):
return public.returnJson(True, '设置成功!')
def checkPhpinfoFile(version):
def checkPhpinfoFile(v):
if public.isInstalledWeb():
desc_file = public.getServerDir(
) + '/openresty/nginx/conf/php_status/phpinfo_' + version + '.conf'
) + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
if not os.path.exists(desc_file):
tpl = getPluginDir() + '/conf/phpinfo.conf'
content = public.readFile(tpl)
content = contentReplace(content, version)
content = contentReplace(content, v)
public.writeFile(desc_file, content)
public.restartWeb()
def getPhpinfo(version):
checkPhpinfoFile(version)
sPath = public.getRootDir() + '/phpinfo/' + version
# public.execShell("rm -rf " + public.getRootDir() + '/phpinfo')
def getPhpinfo(v):
checkPhpinfoFile(v)
sPath = public.getRootDir() + '/phpinfo/' + v
public.execShell("rm -rf " + public.getRootDir() + '/phpinfo')
public.execShell("mkdir -p " + sPath)
public.writeFile(sPath + '/phpinfo.php', '<?php phpinfo(); ?>')
# print 'http://127.0.0.1/' + version + '/phpinfo.php'
phpinfo = public.httpGet('http://127.0.0.1/' + version + '/phpinfo.php', 3)
# os.system("rm -rf " + public.getRootDir() + '/phpinfo')
url = 'http://127.0.0.1/' + v + '/phpinfo.php'
phpinfo = public.httpGet(url)
os.system("rm -rf " + public.getRootDir() + '/phpinfo')
return phpinfo
def get_php_info(args):
return getPhpinfo(args['version'])
def getLibConf(version):
fname = public.getServerDir() + '/php/' + version + '/etc/php.ini'
if not os.path.exists(fname):
@@ -563,11 +604,12 @@ def uninstallLib(version):
execstr = "cd " + getPluginDir() + '/versions/' + version + " && /bin/bash " + \
name + '.sh' + ' uninstall ' + version
rettime = time.strftime('%Y-%m-%d %H:%M:%S')
insert_info = (None, '安装[' + name + '-' + version + ']',
'execshell', '0', rettime, execstr)
public.M('tasks').add('id,name,type,status,addtime,execstr', insert_info)
return public.returnJson(True, '已将卸载载任务添加到队列!')
data = public.execShell(execstr)
if data[0] == '' and data[1] == '':
return public.returnJson(True, '已经卸载成功!')
else:
return public.returnJson(False, '卸载信息![通道0]:' + data[0] + "[通道0]:" + data[1])
if __name__ == "__main__":
@@ -588,6 +630,12 @@ if __name__ == "__main__":
print restart(version)
elif func == 'reload':
print reload(version)
elif func == 'initd_status':
print initdStatus(version)
elif func == 'initd_install':
print initdInstall(version)
elif func == 'initd_uninstall':
print initdUinstall(version)
elif func == 'fpm_log':
print fpmLog(version)
elif func == 'fpm_slow_log':
+2 -2
View File
@@ -5,8 +5,8 @@
"name": "php",
"title": "PHP",
"coexist": true,
"versions": ["52","56","72"],
"updates": ["5.2.17","5.6.36","7.2.0"],
"versions": ["53","54","55","56","70","71","72","73"],
"updates": ["5.3.17","5.4.45","5.6.36","7.0.30","7.1.27","7.2.16","7.3.3"],
"tip": "soft",
"checks": "server/php/VERSION/bin/php",
"path": "server/php/VERSION",
+2
View File
@@ -1,4 +1,6 @@
#! /bin/sh
# chkconfig: 2345 55 25
# description: PHP Service
### BEGIN INIT INFO
# Provides: php-fpm
+1 -1
View File
@@ -7,7 +7,7 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
install_tmp=${rootPath}/tmp/mw_install.pl
action=$1
+66 -9
View File
@@ -36,6 +36,33 @@ function phpPost(method, version, args,callback){
},'json');
}
function phpPostCallbak(method, version, args,callback){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
var req_data = {};
req_data['name'] = 'php';
req_data['func'] = method;
args['version'] = version;
if (typeof(args) == 'string'){
req_data['args'] = JSON.stringify(str2Obj(args));
} else {
req_data['args'] = JSON.stringify(args);
}
$.post('/plugins/callback', req_data, 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 phpSetConfig(version) {
@@ -373,12 +400,12 @@ function setDisableFunc(version, act, fs) {
//phpinfo
function getPhpinfo(version) {
var con = '<button class="btn btn-default btn-sm" onclick="getPHPInfo(\'' + version + '\')">' + lan.soft.phpinfo + '</button>';
var con = '<button class="btn btn-default btn-sm" onclick="getPHPInfo(\'' + version + '\')">查看phpinfo()</button>';
$(".soft-man-con").html(con);
}
//获取PHPInfo
function getPHPInfo(version) {
function getPHPInfo_old(version) {
phpPost('get_phpinfo', version, '', function(data){
var rdata = data.data;
layer.open({
@@ -392,14 +419,38 @@ function getPHPInfo(version) {
});
}
function getPHPInfo(version) {
phpPostCallbak('get_php_info', version, {}, function(data){
if (!data.status){
layer.msg(rdata.msg, { icon: 2 });
}
layer.open({
type: 1,
title: "PHP-" + version + "-PHPINFO",
area: ['90%', '90%'],
closeBtn: 2,
shadeClose: true,
content: data.data
});
})
}
function phpLibConfig(version){
phpPost('get_lib_conf', version, '', function(data){
var rdata = $.parseJSON(data.data);
var libs = rdata.data;
if (!rdata.status){
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
return;
}
var libs = rdata.data;
var body = '';
var opt = '';
for (var i = 0; i < libs.length; i++) {
if (libs[i].versions.indexOf(version) == -1){
continue;
@@ -457,9 +508,12 @@ function installPHPLib(version, name, title, pathinfo) {
phpPost('install_lib', version, data, function(data){
var rdata = $.parseJSON(data.data);
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
getTaskCount();
phpLibConfig(version);
// layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
showMsg(rdata.msg, function(){
getTaskCount();
phpLibConfig(version);
},{ icon: rdata.status ? 1 : 2 });
});
});
}
@@ -471,9 +525,12 @@ function uninstallPHPLib(version, name, title, pathinfo) {
var data = 'name=' + name + '&version=' + version;
phpPost('uninstall_lib', version, data, function(data){
var rdata = $.parseJSON(data.data);
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
getTaskCount();
phpLibConfig(version);
// layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
showMsg(rdata.msg, function(){
getTaskCount();
phpLibConfig(version);
},{ icon: rdata.status ? 1 : 2 },5000);
});
});
}
-65
View File
@@ -1,65 +0,0 @@
#!/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
install_tmp=${rootPath}/tmp/bt_install.pl
# echo $curPath
# echo ${1}
# echo ${serverPath}
# echo ${install_tmp}
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-5.2.17 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.2.17.tar.bz2 ];then
wget -O $sourcePath/php/php-5.2.17.tar.bz2 https://museum.php.net/php5/php-5.2.17.tar.bz2
fi
if [ ! -d $sourcePath/php/php-5.2.17 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.2.17.tar.bz2
fi
cd $sourcePath/php/php-5.2.17 && ./configure \
--prefix=$serverPath/php/php52 \
--exec-prefix=$serverPath/php/php52 \
--with-config-file-path=$serverPath/php/php55/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--without-iconv \
--enable-zip \
--enable-mbstring \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-fpm \
&& make && make install
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
echo "卸载php-5.2.17 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi
+92
View File
@@ -0,0 +1,92 @@
#!/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=apc
LIBV=3.1.9
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_lib
mkdir -p $php_lib
_LIBNAME=$(echo $LIBNAME | tr '[a-z]' '[A-Z]')
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
cd $php_lib
rm -rf ${_LIBNAME}-${LIBV}
rm -rf ${_LIBNAME}-${LIBV}.tgz
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
echo $extFile
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
+95
View File
@@ -0,0 +1,95 @@
#!/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-20090626/${LIBNAME}.so
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_${version}_lib
mkdir -p $php_lib
#
# wget -O $php_lib/${LIBNAME}-${LIBV}.tgz 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 jxvf ${LIBNAME}-${LIBV}.tar.bz2
cd ${LIBNAME}-${LIBV}
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config \
--enable-eaccelerator=shared --with-eaccelerator-shared-memory
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+110
View File
@@ -0,0 +1,110 @@
#!/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
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-5.3.29 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.3.29.tar.xz ];then
wget -O $sourcePath/php/php-5.3.29.tar.xz https://museum.php.net/php5/php-5.3.29.tar.xz
fi
if [ ! -d $sourcePath/php/php-5.3.29 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.3.29.tar.xz
fi
if [ -f $serverPath/php/53/bin/php.dSYM ];then
mv $serverPath/php/53/bin/php.dSYM $serverPath/php/53/bin/php
fi
if [ -f $serverPath/php/53/sbin/php-fpm.dSYM ];then
mv $serverPath/php/53/sbin/php-fpm.dSYM $serverPath/php/53/sbin/php-fpm
fi
if [ -f $serverPath/php/53/bin/php ];then
return
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS='--without-iconv'
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-curl"
fi
# --enable-intl \
cd $sourcePath/php/php-5.3.29 && ./configure \
--prefix=$serverPath/php/53 \
--exec-prefix=$serverPath/php/53 \
--with-config-file-path=$serverPath/php/53/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-zip \
--enable-exif \
--enable-hash \
--enable-libxml \
--enable-simplexml \
--enable-dom \
--enable-filter \
--enable-fileinfo \
--enable-pcntl \
--enable-bcmath \
--enable-xml \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-sockets \
--enable-mbstring \
--enable-mysqlnd \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
$OPTIONS \
--enable-fpm \
&& make && make install && make clean
if [ -f $serverPath/php/53/bin/php.dSYM ];then
mv $serverPath/php/53/bin/php.dSYM $serverPath/php/53/bin/php
fi
if [ -f $serverPath/php/53/sbin/php-fpm.dSYM ];then
mv $serverPath/php/53/sbin/php-fpm.dSYM $serverPath/php/53/sbin/php-fpm
fi
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
$serverPath/php/init.d/php53 stop
rm -rf $serverPath/php/53
echo "uninstall php-5.3.29 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi
+89
View File
@@ -0,0 +1,89 @@
#!/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-20090626/${LIBNAME}.so
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_${version}_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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+87
View File
@@ -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
LIBNAME=memcache
LIBV=2.2.7
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+91
View File
@@ -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=memcached
LIBV=2.2.0
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+97
View File
@@ -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=mongo
LIBV=1.6.16
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2q"
fi
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 $OPTIONS
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+100
View File
@@ -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=opcache
LIBV=7.0.5
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_lib
mkdir -p $php_lib
wget -O $php_lib/zendopcache-7.0.5.tgz http://pecl.php.net/get/zendopcache-7.0.5.tgz
cd $php_lib && tar xvf zendopcache-7.0.5.tgz
cd zendopcache-7.0.5
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf zendopcache-7.0.5
rm -rf zendopcache-7.0.5.tgz
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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.memory_consumption=128" >> $serverPath/php/$version/etc/php.ini
echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini
echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini
echo "opcache.revalidate_freq=60" >> $serverPath/php/$version/etc/php.ini
echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable_cli=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
sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
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
+94
View File
@@ -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=redis
LIBV=4.2.0
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/
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_${version}_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
fi
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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+100
View File
@@ -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=SeasLog
LIBV=2.0.2
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
fi
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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+99
View File
@@ -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=solr
LIBV=2.4.0
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
fi
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 $OPTIONS
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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-$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
+105
View File
@@ -0,0 +1,105 @@
#!/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='1.10.1';
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then
LIBV='2.2.0'
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_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-openssl --with-openssl-dir=$serverPath/lib/openssl --enable-sockets
make && make install
cd ..
rm -rf ${LIBNAME}-*
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},请选择其它版本!"
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}/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
+89
View File
@@ -0,0 +1,89 @@
#!/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=2.2.7
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+88
View File
@@ -0,0 +1,88 @@
#!/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-20090626/${LIBNAME}.so
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_${version}_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}/extension
$serverPath/php/$version/bin/phpize
./configure --enable-xhprof --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+100
View File
@@ -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=yaf
LIBV='2.3.5'
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then
LIBV='3.0.7';
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_${version}_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
cd ..
rm -rf yaf-*
rm -f package.xml
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 "yaf.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 未安装${LIBNAME},请选择其它版本!"
echo "php-$version not install ${LIBNAME}, Plese select other version!"
return
fi
echo $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/yaf.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/yaf.use_namespace/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/\[yaf\]/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
+97
View File
@@ -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=ZendGuardLoader
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so
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_${version}_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/zend-loader-php5.3.tar.gz http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
fi
cd $php_lib && tar xvf zend-loader-php5.3.tar.gz
cd ZendGuardLoader-php* && cd php-5.3.x
cp ZendGuardLoader.so $serverPath/php/$version/lib/php/extensions/no-debug-non-zts-20090626/
rm -rf $php_lib/ZendGuardLoader*
rm -rf $php_lib/zend-loader-php5.3*
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=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
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' "/ZendGuardLoader.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
+92
View File
@@ -0,0 +1,92 @@
#!/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=apc
LIBV=3.1.9
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_lib
mkdir -p $php_lib
_LIBNAME=$(echo $LIBNAME | tr '[a-z]' '[A-Z]')
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
cd $php_lib
rm -rf ${_LIBNAME}-${LIBV}
rm -rf ${_LIBNAME}-${LIBV}.tgz
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
echo $extFile
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
+91
View File
@@ -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=imagick
LIBV=3.4.3
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+77
View File
@@ -0,0 +1,77 @@
#!/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
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-7.2.5 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.4.45.tar.gz ];then
wget -O $sourcePath/php/php-5.4.45.tar.gz https://museum.php.net/php5/php-5.4.45.tar.gz
fi
if [ ! -d $sourcePath/php/php-5.4.45 ];then
cd $sourcePath/php && tar -zvxf $sourcePath/php/php-5.4.45.tar.gz
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS='--without-iconv'
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-curl"
fi
cd $sourcePath/php/php-5.4.45 && ./configure \
--prefix=$serverPath/php/54 \
--exec-prefix=$serverPath/php/54 \
--with-config-file-path=$serverPath/php/54/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--enable-zip \
--enable-mbstring \
--enable-sockets \
--enable-ftp \
--enable-simplexml \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
$OPTIONS \
--enable-fpm \
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
$serverPath/php/init.d/php54 stop
rm -rf $serverPath/php/54
echo "卸载php-5.4.45 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi
+87
View File
@@ -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
LIBNAME=memcache
LIBV=2.2.7
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+91
View File
@@ -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=memcached
LIBV=2.2.0
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+97
View File
@@ -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=mongo
LIBV=1.6.16
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2q"
fi
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 $OPTIONS
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+103
View File
@@ -0,0 +1,103 @@
#!/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=opcache
LIBV=7.0.5
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_lib
mkdir -p $php_lib
wget -O $php_lib/zendopcache-7.0.5.tgz http://pecl.php.net/get/zendopcache-7.0.5.tgz
cd $php_lib && tar xvf zendopcache-7.0.5.tgz
cd zendopcache-7.0.5
$serverPath/php/$version/bin/phpize
./configure --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
# cp modules/opcache.la $serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/
cd $php_lib
rm -rf zendopcache-7.0.5
rm -rf zendopcache-7.0.5.tgz
rm -rf package.xml
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 "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.memory_consumption=128" >> $serverPath/php/$version/etc/php.ini
echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini
echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini
echo "opcache.revalidate_freq=60" >> $serverPath/php/$version/etc/php.ini
echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable_cli=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
sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
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
+93
View File
@@ -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=redis
LIBV=4.2.0
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/
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_${version}_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
fi
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
cd $php_lib
rm -rf ${LIBNAME}-*
fi
sleep 1
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-$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
+100
View File
@@ -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=SeasLog
LIBV=2.0.2
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
fi
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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+99
View File
@@ -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=solr
LIBV=2.4.0
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
fi
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 $OPTIONS
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+104
View File
@@ -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
actionType=$1
version=$2
LIBNAME=swoole
LIBV='1.10.1';
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then
LIBV='2.2.0'
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_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-openssl --with-openssl-dir=$serverPath/lib/openssl --enable-sockets
make && make install
cd ..
rm -rf ${LIBNAME}-*
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
+91
View File
@@ -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=xdebug
LIBV=2.2.7
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+88
View File
@@ -0,0 +1,88 @@
#!/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-20100525/${LIBNAME}.so
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_${version}_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}/extension
$serverPath/php/$version/bin/phpize
./configure --enable-xhprof --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+99
View File
@@ -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=yaf
LIBV='2.3.5'
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20100525/${LIBNAME}.so
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then
LIBV='3.0.7';
fi
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php-$version 已安装yaf,请选择其它版本!"
return
fi
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_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
cd ..
rm -rf yaf-*
rm -f package.xml
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 "yaf.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' "/yaf.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/yaf.use_namespace/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/\[yaf\]/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
+91
View File
@@ -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=imagick
LIBV=3.4.3
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+77
View File
@@ -0,0 +1,77 @@
#!/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
Install_php()
{
#------------------------ install start ------------------------------------#
echo "安装php-5.5.38 ..." > $install_tmp
mkdir -p $sourcePath/php
mkdir -p $serverPath/php
if [ ! -f $sourcePath/php/php-5.5.38.tar.xz ];then
wget -O $sourcePath/php/php-5.5.38.tar.xz https://museum.php.net/php5/php-5.5.38.tar.xz
fi
if [ ! -d $sourcePath/php/php-5.5.38 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.5.38.tar.xz
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS='--without-iconv'
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-curl"
fi
cd $sourcePath/php/php-5.5.38 && ./configure \
--prefix=$serverPath/php/55 \
--exec-prefix=$serverPath/php/55 \
--with-config-file-path=$serverPath/php/55/etc \
--with-zlib-dir=$serverPath/lib/zlib \
--enable-mysqlnd \
--enable-zip \
--enable-simplexml \
--enable-intl \
--enable-mbstring \
--enable-sockets \
--enable-ftp \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
$OPTIONS \
--enable-fpm \
&& make && make install && make clean
#------------------------ install end ------------------------------------#
}
Uninstall_php()
{
$serverPath/php/init.d/php55 stop
rm -rf $serverPath/php/55
echo "卸载php-5.5.38 ..." > $install_tmp
}
action=${1}
if [ "${1}" == 'install' ];then
Install_php
else
Uninstall_php
fi
+85
View File
@@ -0,0 +1,85 @@
#!/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-20121212/${LIBNAME}.so
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_${version}_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
cd $php_lib
rm -rf ${LIBNAME}-*
fi
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
echo "extension=${LIBNAME}" >> $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
+88
View File
@@ -0,0 +1,88 @@
#!/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=2.2.0
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
fi
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
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
+97
View File
@@ -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=mongo
LIBV=1.6.16
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2q"
fi
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 $OPTIONS
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+89
View File
@@ -0,0 +1,89 @@
#!/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.5.3
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
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_${version}_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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+55
View File
@@ -0,0 +1,55 @@
#!/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=opcache
LIBV=7.0.5
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
Install_lib()
{
echo "" >> $serverPath/php/$version/etc/php.ini
echo "[opcache]" >> $serverPath/php/$version/etc/php.ini
echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.memory_consumption=128" >> $serverPath/php/$version/etc/php.ini
echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini
echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini
echo "opcache.revalidate_freq=60" >> $serverPath/php/$version/etc/php.ini
echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi
+93
View File
@@ -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=redis
LIBV=4.2.0
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/
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_${version}_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
fi
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
cd $php_lib
rm -rf ${LIBNAME}-*
fi
sleep 1
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-$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
+100
View File
@@ -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=SeasLog
LIBV=2.0.2
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
fi
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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+99
View File
@@ -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=solr
LIBV=2.4.0
sysName=`uname`
actionType=$1
version=$2
extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/
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_${version}_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
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
fi
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 $OPTIONS
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+104
View File
@@ -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
actionType=$1
version=$2
LIBNAME=swoole
LIBV='1.10.1';
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then
LIBV='2.2.0'
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
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_${version}_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-openssl --with-openssl-dir=$serverPath/lib/openssl --enable-sockets
make && make install
cd ..
rm -rf ${LIBNAME}-*
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
+91
View File
@@ -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=xdebug
LIBV=2.2.7
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+88
View File
@@ -0,0 +1,88 @@
#!/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-20121212/${LIBNAME}.so
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_${version}_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}/extension
$serverPath/php/$version/bin/phpize
./configure --enable-xhprof --with-php-config=$serverPath/php/$version/bin/php-config
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+99
View File
@@ -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=yaf
LIBV='2.3.5'
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20121212/${LIBNAME}.so
if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then
LIBV='3.0.7';
fi
Install_lib()
{
isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"`
if [ "${isInstall}" != "" ];then
echo "php-$version 已安装yaf,请选择其它版本!"
return
fi
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_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
cd ..
rm -rf yaf-*
rm -f package.xml
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 "yaf.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' "/yaf.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/yaf.use_namespace/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/\[yaf\]/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
+91
View File
@@ -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=imagick
LIBV=3.4.3
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+19 -12
View File
@@ -7,13 +7,8 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source
install_tmp=${rootPath}/tmp/bt_install.pl
# echo $curPath
# echo ${1}
# echo ${serverPath}
# echo ${install_tmp}
sysName=`uname`
install_tmp=${rootPath}/tmp/mw_install.pl
Install_php()
@@ -31,6 +26,15 @@ if [ ! -d $sourcePath/php/php-5.6.36 ];then
cd $sourcePath/php && tar -Jxf $sourcePath/php/php-5.6.36.tar.xz
fi
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS='--without-iconv'
OPTIONS="${OPTIONS} --with-curl=${serverPath}/lib/curl"
else
OPTIONS="--with-iconv=${serverPath}/lib/libiconv"
OPTIONS="${OPTIONS} --with-gd --enable-gd-native-ttf"
OPTIONS="${OPTIONS} --with-curl"
fi
cd $sourcePath/php/php-5.6.36 && ./configure \
--prefix=$serverPath/php/56 \
@@ -40,20 +44,22 @@ cd $sourcePath/php/php-5.6.36 && ./configure \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--without-iconv \
--enable-zip \
--enable-mbstring \
--enable-simplexml \
--enable-intl \
--enable-ftp \
--enable-sockets \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--enable-intl \
--enable-wddx \
--enable-soap \
--enable-posix \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
$OPTIONS \
--enable-fpm \
&& make clean && make && make install && make clean
@@ -64,6 +70,7 @@ cd $sourcePath/php/php-5.6.36 && ./configure \
Uninstall_php()
{
$serverPath/php/init.d/php56 stop
rm -rf $serverPath/php/56
echo "卸载php-5.6.36 ..." > $install_tmp
}
+15 -16
View File
@@ -12,8 +12,11 @@ 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-20131226/${LIBNAME}.so
Install_lib()
{
@@ -23,30 +26,28 @@ Install_lib()
return
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
wget -O $php_lib/memcache-2.2.7.tgz http://pecl.php.net/get/memcache-2.2.7.tgz
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
cd $php_lib && tar xvf memcache-2.2.7.tgz
cd memcache-2.2.7
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
cd $php_lib
rm -rf memcache-*
rm -f package.xml
rm -rf ${LIBNAME}-*
fi
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=memcache.so" >> $serverPath/php/$version/etc/php.ini
echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
echo "extension=${LIBNAME}" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
@@ -57,18 +58,18 @@ Install_lib()
Uninstall_lib()
{
if [ ! -f "$serverPath/php/$version/bin/php-config" ];then
echo "php$version 未安装,请选择其它版本!"
echo "php-$version 未安装,请选择其它版本!"
return
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
if [ ! -f "$extFile" ];then
echo "php$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$vphp not install memcache, Plese select other version!"
echo "php-$version 未安装${LIBNAME},请选择其它版本!"
echo "php-$version not install memcache, Plese select other version!"
return
fi
sed -i '_bak' '/memcache.so/d' $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
@@ -77,8 +78,6 @@ Uninstall_lib()
}
actionType=$1
version=$2
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
+92
View File
@@ -0,0 +1,92 @@
#!/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=2.2.0
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
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_${version}_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=$serverPath/lib/zlib \
--with-libmemcached-dir=$serverPath/lib/libmemcached
make && make install
cd $php_lib
rm -rf ${LIBNAME}-*
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
+25 -14
View File
@@ -12,8 +12,11 @@ serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=mongo
LIBV=1.6.16
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
Install_lib()
{
@@ -23,30 +26,40 @@ Install_lib()
return
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
if [ ! -f "$extFile" ];then
php_lib=$sourcePath/php_${version}_lib
mkdir -p $php_lib
wget -O $php_lib/mongo-1.6.16.tgz http://pecl.php.net/get/mongo-1.6.16.tgz
if [ ! -f $php_lib/${LIBNAME}-${LIBV}.tgz ];then
wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz
fi
cd $php_lib && tar xvf mongo-1.6.16.tgz
cd mongo-1.6.16
OPTIONS=''
if [ $sysName == 'Darwin' ]; then
OPTIONS="--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2q"
fi
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
./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS
make && make install
cd $php_lib
rm -rf mongo-*
rm -f package.xml
rm -rf ${LIBNAME}-*
fi
if [ ! -f "$extFile" ];then
echo "ERROR!"
return
fi
echo "extension=mongo.so" >> $serverPath/php/$version/etc/php.ini
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 '==========================================================='
@@ -61,14 +74,14 @@ Uninstall_lib()
return
fi
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${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
sed -i '_bak' '/mongo.so/d' $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
@@ -77,8 +90,6 @@ Uninstall_lib()
}
actionType=$1
version=$2
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
+89
View File
@@ -0,0 +1,89 @@
#!/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.5.3
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
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_${version}_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
cd $php_lib
rm -rf ${LIBNAME}-*
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
+55
View File
@@ -0,0 +1,55 @@
#!/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=opcache
LIBV=7.0.5
sysName=`uname`
actionType=$1
version=$2
extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20131226/${LIBNAME}.so
Install_lib()
{
echo "" >> $serverPath/php/$version/etc/php.ini
echo "[opcache]" >> $serverPath/php/$version/etc/php.ini
echo "zend_extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.memory_consumption=128" >> $serverPath/php/$version/etc/php.ini
echo "opcache.interned_strings_buffer=8" >> $serverPath/php/$version/etc/php.ini
echo "opcache.max_accelerated_files=4000" >> $serverPath/php/$version/etc/php.ini
echo "opcache.revalidate_freq=60" >> $serverPath/php/$version/etc/php.ini
echo "opcache.fast_shutdown=1" >> $serverPath/php/$version/etc/php.ini
echo "opcache.enable_cli=1" >> $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini
sed -i '_bak' "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini
$serverPath/php/init.d/php$version reload
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

Some files were not shown because too many files have changed in this diff Show More