vi /etc/yum.repos.d/unit.repo
[unit]
name=unit repo
baseurl=https://packages.nginx.org/unit/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
yum install unit
yum install unit-php
systemctl restart unit
vi demo.json
{
"listeners": {
"*:8080": {
"application": "demo"
}
},
"applications": {
"demo": {
"type": "php",
"processes": 20,
"root": "/home/www/demo/public",
"index": "index.php"
}
}
}
mkdir -p /home/www/demo/public
vi /home/www/demo/public/index.php
<?php
phpinfo();
curl -X PUT -d @demo.json --unix-socket /run/control.unit.sock http://localhost/config/