{"id":16366754,"url":"https://github.com/centminmod/centminmod-nginx-unit","last_synced_at":"2026-04-11T12:42:07.236Z","repository":{"id":80279580,"uuid":"104614058","full_name":"centminmod/centminmod-nginx-unit","owner":"centminmod","description":"Nginx Unit Tools for CentminMod.com","archived":false,"fork":false,"pushed_at":"2018-04-19T05:42:22.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T21:36:15.247Z","etag":null,"topics":["centminmod","go","nginx","nginx-php","nginx-proxy","nginx-unit","php","python"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centminmod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-24T02:50:07.000Z","updated_at":"2018-04-19T05:42:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d543857-6e4d-4b85-a38c-b11f335fd6c3","html_url":"https://github.com/centminmod/centminmod-nginx-unit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/centminmod/centminmod-nginx-unit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-nginx-unit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-nginx-unit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-nginx-unit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-nginx-unit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centminmod","download_url":"https://codeload.github.com/centminmod/centminmod-nginx-unit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centminmod%2Fcentminmod-nginx-unit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31681201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centminmod","go","nginx","nginx-php","nginx-proxy","nginx-unit","php","python"],"created_at":"2024-10-11T02:47:28.348Z","updated_at":"2026-04-11T12:42:07.209Z","avatar_url":"https://github.com/centminmod.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginx unit tools\n\n[Nginx Unit](https://github.com/nginx/unit) and [Nginx Unit Documentation](http://unit.nginx.org/docs-nginx-unit.html).\n\nInstall commands on CentOS 7.4 64bit for Centmin Mod 123.09beta01 LEMP Stack based servers\n\n```\nmkdir -p /root/tools\ngit clone https://github.com/centminmod/centminmod-nginx-unit\ncd centminmod-nginx-unit\ntools/nginx-unit-tools.sh install-unit\n```\n\nOnce installed, save your Nginx Unit json config files in `/root/tools/unitconfigs` and then run `merge-json` option to get a command you run to load your json configs into Nginx Unit.\n\nOptionally enable multiple PHP and Python version support if you're on Centmin Mod 123.09beta01 LEMP stack installed servers via variables within `tools/nginx-unit-tools.sh`:\n\n```\nMULTI_PHPVER='y'\nPYTHONTHREEFOUR='y'\nPYTHONTHREEFIVE='y'\nPYTHONTHREESIX='y'\n```\n\n```\nls -lah /opt/unit/modules\ntotal 900K\ndrwxr-xr-x 2 root root 4.0K Sep 28 04:02 .\ndrwxr-xr-x 5 root root   67 Sep 28 04:02 ..\n-rwxr-xr-x 1 root root 110K Sep 28 04:02 iuspython34.unit.so\n-rwxr-xr-x 1 root root 110K Sep 28 04:02 iuspython35.unit.so\n-rwxr-xr-x 1 root root 111K Sep 28 04:02 iuspython36.unit.so\n-rwxr-xr-x 1 root root  89K Sep 28 04:02 php5.6.31.unit.so\n-rwxr-xr-x 1 root root 104K Sep 28 04:02 python.unit.so\n-rwxr-xr-x 1 root root  89K Sep 28 04:02 remiphp56.unit.so\n-rwxr-xr-x 1 root root  88K Sep 28 04:02 remiphp70.unit.so\n-rwxr-xr-x 1 root root  89K Sep 28 04:02 remiphp71.unit.so\n-rwxr-xr-x 1 root root  90K Sep 28 04:02 remiphp72.unit.so\n```\n\n```\ntail -100 /var/log/unitd.log \n2017/09/28 04:02:31 [info] 8563#8563 discovery started\n2017/09/28 04:02:31 [notice] 8563#8563 module: python 3.4.7 \"/opt/unit/modules/iuspython34.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 module: python 3.5.4 \"/opt/unit/modules/iuspython35.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 module: python 3.6.2 \"/opt/unit/modules/iuspython36.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 module: php 5.6.31 \"/opt/unit/modules/php5.6.31.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 module: python 2.7.5 \"/opt/unit/modules/python.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 module: php 5.6.31 \"/opt/unit/modules/remiphp56.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 ignoring /opt/unit/modules/remiphp56.unit.so module with the same application language version php 5.6.31 as in /opt/unit/modules/php5.6.31.unit.so\n2017/09/28 04:02:31 [notice] 8563#8563 module: php 7.0.24 \"/opt/unit/modules/remiphp70.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 module: php 7.1.10 \"/opt/unit/modules/remiphp71.unit.so\"\n2017/09/28 04:02:31 [notice] 8563#8563 module: php 7.2.0RC3 \"/opt/unit/modules/remiphp72.unit.so\"\n2017/09/28 04:02:31 [info] 8566#8566 controller started\n2017/09/28 04:02:31 [info] 8567#8567 router started\n```\n\n# Merging JSON Configs\n\nFor merging a directory of Nginx Unit json config files into one json config for loading into Nginx Unit API\n\nExample\n\n`merge-json` option takes all json config files saved in `/root/tools/unitconfigs` and generates a command you can use leveraging `jq` to merge all `.json` extension based json config files into a single json format file to piping into Nginx unit\n\n```\nls -lah /root/tools/unitconfigs/ \ntotal 20K\ndrwxr-xr-x  2 root root  101 Sep 24 09:38 .\ndrwxr-xr-x. 7 root root 4.0K Sep 24 02:40 ..\n-rw-r--r--  1 root root  404 Sep 24 00:55 php5631start.json\n-rw-r--r--  1 root root  404 Sep 24 00:59 php7024start.json\n-rw-r--r--  1 root root  404 Sep 24 01:27 php7110start.json\n-rw-r--r--  1 root root  403 Sep 24 00:59 php720start.json\n```\n\nRun command from `/root/tools/unitconfigs` directory\n\n```\ncd /root/tools/unitconfigs\n/root/tools/unittools/nginx-unit-tools.sh merge-json\njq -s '.[0] * .[1] * .[2] * .[3]' php5631start.json php7024start.json php720start.json php7110start.json  | curl -X PUT -d@- --unix-socket /opt/unit/control.unit.sock http://localhost\n```\n\nrunning the generated command\n\n```\njq -s '.[0] * .[1] * .[2] * .[3]' php5631start.json php7024start.json php720start.json php7110start.json  | curl -X PUT -d@- --unix-socket /opt/unit/control.unit.sock http://localhost\n{\n        \"success\": \"Reconfiguration done.\"\n}\n```\n\nchecking Nginx unit loaded configurations\n\n```\ncurl --unix-socket /opt/unit/control.unit.sock http://localhost/\n{\n        \"listeners\": {\n                \"*:8300\": {\n                        \"application\": \"php56domaincom\"\n                },\n\n                \"*:8400\": {\n                        \"application\": \"php70domaincom\"\n                },\n\n                \"*:8600\": {\n                        \"application\": \"php72domaincom\"\n                },\n\n                \"*:8500\": {\n                        \"application\": \"php71domaincom\"\n                }\n        },\n\n        \"applications\": {\n                \"php56domaincom\": {\n                        \"type\": \"php 5.6.31\",\n                        \"workers\": 20,\n                        \"root\": \"/home/nginx/domains/domain.com/public\",\n                        \"user\": \"nginx\",\n                        \"group\": \"nginx\",\n                        \"index\": \"index.php\"\n                },\n\n                \"php70domaincom\": {\n                        \"type\": \"php 7.0.24\",\n                        \"workers\": 20,\n                        \"root\": \"/home/nginx/domains/domain.com/public\",\n                        \"user\": \"nginx\",\n                        \"group\": \"nginx\",\n                        \"index\": \"index.php\"\n                },\n\n                \"php72domaincom\": {\n                        \"type\": \"php 7.2.0\",\n                        \"workers\": 20,\n                        \"root\": \"/home/nginx/domains/domain.com/public\",\n                        \"user\": \"nginx\",\n                        \"group\": \"nginx\",\n                        \"index\": \"index.php\"\n                },\n\n                \"php71domaincom\": {\n                        \"type\": \"php 7.1.10\",\n                        \"workers\": 20,\n                        \"root\": \"/home/nginx/domains/domain.com/public\",\n                        \"user\": \"nginx\",\n                        \"group\": \"nginx\",\n                        \"index\": \"index.php\"\n                }\n        }\n}\n```\n\n```\nroot       966  0.0  0.0  16032   820 ?        Ss   09:26   0:00 unit: main [/opt/unit/sbin/unitd]\nnginx     1078  0.0  0.0  26276   796 ?        S    09:26   0:00  \\_ unit: controller\nnginx     1080  0.0  0.0 403428  1432 ?        Sl   09:26   0:00  \\_ unit: router\nnginx     6715  0.3  1.9 1178344 37432 ?       S    09:46   0:00  \\_ unit: \"php72domaincom\" application\nnginx     6716  0.3  2.8 1175444 53728 ?       S    09:46   0:00  \\_ unit: \"php71domaincom\" application\nnginx     6729  0.4  2.8 1174400 53304 ?       S    09:46   0:00  \\_ unit: \"php70domaincom\" application\nnginx     6730  0.6  2.3 1062704 43740 ?       S    09:46   0:00  \\_ unit: \"php56domaincom\" application\n```\n\n\n# individual json config files\n\nContents of json config files individual saved at `/root/tools/unitconfigs`\n\n## 5.6.31\n\n/root/tools/unitconfigs/php5631start.json\n\n```\n{\n     \"listeners\": {\n         \"*:8300\": {\n             \"application\": \"php56domaincom\"\n         }\n     },\n     \"applications\": {\n         \"php56domaincom\": {\n             \"type\": \"php 5.6.31\",\n              \"workers\": 20,\n              \"root\": \"/home/nginx/domains/domain.com/public\",\n              \"user\": \"nginx\",\n              \"group\": \"nginx\",\n              \"index\": \"index.php\"\n         }\n     }\n}\n```\n\n## 7.0.24\n\n/root/tools/unitconfigs/php7024start.json\n\n```\n{\n     \"listeners\": {\n         \"*:8400\": {\n             \"application\": \"php70domaincom\"\n         }\n     },\n     \"applications\": {\n         \"php70domaincom\": {\n             \"type\": \"php 7.0.24\",\n              \"workers\": 20,\n              \"root\": \"/home/nginx/domains/domain.com/public\",\n              \"user\": \"nginx\",\n              \"group\": \"nginx\",\n              \"index\": \"index.php\"\n         }\n     }\n}\n```\n\n## 7.1.10\n\n/root/tools/unitconfigs/php7110start.json\n\n```\n{\n     \"listeners\": {\n         \"*:8500\": {\n             \"application\": \"php71domaincom\"\n         }\n     },\n     \"applications\": {\n         \"php71domaincom\": {\n             \"type\": \"php 7.1.10\",\n              \"workers\": 20,\n              \"root\": \"/home/nginx/domains/domain.com/public\",\n              \"user\": \"nginx\",\n              \"group\": \"nginx\",\n              \"index\": \"index.php\"\n         }\n     }\n}\n```\n\n## 7.2.0\n\n/root/tools/unitconfigs/php720start.json\n\n```\n{\n     \"listeners\": {\n         \"*:8600\": {\n             \"application\": \"php72domaincom\"\n         }\n     },\n     \"applications\": {\n         \"php72domaincom\": {\n             \"type\": \"php 7.2.0\",\n              \"workers\": 20,\n              \"root\": \"/home/nginx/domains/domain.com/public\",\n              \"user\": \"nginx\",\n              \"group\": \"nginx\",\n              \"index\": \"index.php\"\n         }\n     }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmod-nginx-unit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentminmod%2Fcentminmod-nginx-unit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentminmod%2Fcentminmod-nginx-unit/lists"}