Excuse me, what do I need to do to get detailed error information?The logs only start information
Operation is as follows:
tcp 0 0 127.0.0.1:8224 0.0.0.0:* LISTEN 566/unit: main v1.4
{
"error": "Invalid method."
}
{
"listeners": {
"*:8300": {
"application": "blogs"
}
},
"applications": {
"blogs": {
"type": "php",
"processes": 2,
"root": "/usr/local/nginx/php",
"index": "index.php",
"user": "php",
"group": "php",
"options": {
"file": "/usr/local/php7/lib/php.ini"
}
}
}
}
You can't use the PUT method with 127.0.0.1:8224, that's why it says "Invalid method". You should PUT your configuration object to 127.0.0.1:8224/config/.
curl -X PUT -d@/etc/unit/start.json '127.0.0.1:8224/config/'
Hi!
I can not load the configuration.
netstat -tulnp | grep unit
tcp 0 0 127.0.0.1:8300 0.0.0.0:* LISTEN 29335/unit: main v1
cat /etc/unit/start.json
{
"listeners": {
"*:8300": {
"application": "blogs"
}
},
"applications": {
"blogs": {
"type": "php",
"processes": 2,
"root": "/usr/share/doc/unit-php/examples/phpinfo-app",
"index": "index.php",
"user": "nobody",
"group": "nobody",
}
}
}
curl -X PUT -d@/etc/unit/start.json '127.0.0.1:8300/config/'
{
"error": "Failed to apply new configuration."
}
In unit.log
2019/01/10 17:49:00 [alert] 29335#29335 bind(\"0.0.0.0:8300\") failed (98: Address already in use)
2019/01/10 17:49:00 [alert] 29338#29338 failed to apply new conf
changed the address to "listeners": {
"*:8301": {
"success": "Reconfiguration done."
@maksitop Please make sure that you have only one Unit daemon running.
Most helpful comment
You can't use the PUT method with
127.0.0.1:8224, that's why it says "Invalid method". You should PUT your configuration object to127.0.0.1:8224/config/.curl -X PUT -d@/etc/unit/start.json '127.0.0.1:8224/config/'