Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rongfengliang/nginx-unit-demo
nginx unit . basic demo project
https://github.com/rongfengliang/nginx-unit-demo
demo nginx nginx-unit
Last synced: 7 days ago
JSON representation
nginx unit . basic demo project
- Host: GitHub
- URL: https://github.com/rongfengliang/nginx-unit-demo
- Owner: rongfengliang
- Created: 2018-04-07T13:52:19.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-07T14:01:58.000Z (almost 7 years ago)
- Last Synced: 2025-01-10T01:18:30.512Z (8 days ago)
- Topics: demo, nginx, nginx-unit
- Language: PHP
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nginx unit basic demo project
just for learning unit how to use
## install unit(centos 7)
```bash
nano /etc/yum.repos.d/unit.repo[unit]
name=unit repo
baseurl=https://packages.nginx.org/unit/centos/$releasever/$basearch/
gpgcheck=0
enabled=1yum install unit
yum install unit-php unit-python unit-go unit-perl
```
## run demo project
* start unit server
```bash
systemctl restart unit
```* application registe
```bash
curl -X PUT -d @$PWD/unit/blog.json \
--unix-socket /var/run/control.unit.sock http://localhost/
```* application describe json file
```json
{
"listeners": {
"*:8300": {
"application": "blogs"
}
},"applications": {
"blogs": {
"type": "php",
"processes": 20,
"root": "/opt/blogs/scripts", # where to run
"index": "index.php" # index page
}
}
}```
* access
just like below
```bash
curl -i http://localhost:8300
HTTP/1.1 200 OK
X-Powered-By: PHP/5.4.16
Content-type: text/html
Server: Unit/0.7
Date: Sat, 07 Apr 2018 05:00:18 GMT
Transfer-Encoding: chunked
dalong demo unit
```