猫言猫语

严以律己·宽以待人·自强不息·知行合一

CentOS 7 下 NGINX Unit 快速体验

| CentOS 7 下 NGINX Unit 快速体验已关闭评论

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/ 

评论已关闭。