Comments (8)
Igor suggested --prefix=/opt/unit --state=state
and that configures /opt/unit/state
path as the internal state storage for unit daemon.
In this case, the /opt/unit/state
directory need to be created and be writable by the main process.
from unit.
If you compile unit with the --debug
option, you will see more information about what's wrong.
from unit.
What is in unit.log ?
from unit.
More detailed errors in case of invalid configuration will be ready soon.
As of now, since your configuration on my system applies without a problem, there are only two possibilities: there's no nginx
user with nginx
group on your system or the php module is not found in the configured modules directory.
from unit.
Well, in your case, it's very likely that the configuration is invalid because of wrong path to the modules directory. As I see from #43, you have unit modules path: "build"
configured, but the php module was installed into /opt/unitbuild/
using DESTDIR.
from unit.
thanks, the unit log confirms module path error
tail -100 /var/log/unitd.log
2017/09/23 06:55:47 [info] 3054#3054 discovery started
2017/09/23 06:55:47 [notice] 3054#3054 no modules matching: "build/*.unit.so" found
2017/09/23 06:55:47 [info] 3055#3055 controller started
2017/09/23 06:55:47 [notice] 3053#3053 process 3054 exited with code 0
2017/09/23 06:55:47 [crit] 3055#3055 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 06:55:47 [info] 3056#3056 router started
2017/09/23 06:55:47 [crit] 3056#3056 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 06:58:20 [notice] 3053#3053 process 3055 exited with code 0
2017/09/23 06:58:20 [notice] 3053#3053 process 3056 exited with code 0
2017/09/23 07:00:58 [info] 3292#3292 discovery started
2017/09/23 07:00:58 [notice] 3292#3292 no modules matching: "build/*.unit.so" found
2017/09/23 07:00:58 [info] 3293#3293 controller started
2017/09/23 07:00:58 [notice] 3291#3291 process 3292 exited with code 0
2017/09/23 07:00:58 [info] 3294#3294 router started
2017/09/23 07:00:58 [crit] 3293#3293 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 07:00:58 [crit] 3294#3294 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 07:24:24 [notice] 3291#3291 process 3293 exited with code 0
2017/09/23 07:24:24 [notice] 3291#3291 process 3294 exited with code 0
from unit.
thanks with fixed Unit configure setup it's working now
curl -X PUT -d @/root/tools/unitconfigs/phpstart.json --unix-socket /opt/unit/control.unit.sock http://localhost/
curl -X PUT -d @/root/tools/unitconfigs/phpstart.json --unix-socket /opt/unit/control.unit.sock http://localhost/
{
"success": "Reconfiguration done."
}
curl --unix-socket /opt/unit/control.unit.sock http://localhost/
{
"listeners": {
"*:8300": {
"application": "php56domaincom"
}
},
"applications": {
"php56domaincom": {
"type": "php",
"workers": 10,
"root": "/home/nginx/domains/domain.com/public",
"user": "nginx",
"group": "nginx",
"index": "index.php"
}
}
}
though I get failed to store current configuration
systemctl status unitd
● unitd.service - NGINX Unit
Loaded: loaded (/usr/lib/systemd/system/unitd.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2017-09-23 10:19:52 UTC; 15s ago
Process: 10467 ExecStart=/opt/unit/sbin/unitd (code=exited, status=0/SUCCESS)
Main PID: 10468 (unitd)
CGroup: /system.slice/unitd.service
├─10468 unit: main [/opt/unit/sbin/unitd]
├─10470 unit: controller
└─10471 unit: router
Sep 23 10:19:52 centos7.localdomain systemd[1]: Starting NGINX Unit...
Sep 23 10:19:52 centos7.localdomain unitd[10467]: 2017/09/23 10:19:52 [info] 10467#10467 unit started
Sep 23 10:19:52 centos7.localdomain systemd[1]: Started NGINX Unit.
Sep 23 10:20:06 centos7.localdomain t/unit/sbin/unitd][10468]: [alert] 10468#10468 failed to store current configuration
tail -20 /var/log/unitd.log
2017/09/23 10:14:40 [info] 10403#10403 discovery started
2017/09/23 10:14:40 [notice] 10403#10403 module: php 5.6.31 "/opt/unit/modules/php5631.unit.so"
2017/09/23 10:14:40 [notice] 10403#10403 module: python 2.7.5 "/opt/unit/modules/python.unit.so"
2017/09/23 10:14:40 [info] 10404#10404 controller started
2017/09/23 10:14:40 [info] 10405#10405 router started
2017/09/23 10:14:40 [crit] 10404#10404 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:14:40 [crit] 10405#10405 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:14:40 [notice] 10402#10402 process 10403 exited with code 0
2017/09/23 10:16:18 [alert] 10402#10402 failed to store current configuration
2017/09/23 10:19:52 [notice] 10402#10402 process 10404 exited with code 0
2017/09/23 10:19:52 [notice] 10402#10402 process 10405 exited with code 0
2017/09/23 10:19:52 [info] 10469#10469 discovery started
2017/09/23 10:19:52 [notice] 10469#10469 module: php 5.6.31 "/opt/unit/modules/php5631.unit.so"
2017/09/23 10:19:52 [notice] 10469#10469 module: python 2.7.5 "/opt/unit/modules/python.unit.so"
2017/09/23 10:19:52 [info] 10470#10470 controller started
2017/09/23 10:19:52 [info] 10471#10471 router started
2017/09/23 10:19:52 [crit] 10470#10470 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:19:52 [crit] 10471#10471 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:19:52 [notice] 10468#10468 process 10469 exited with code 0
2017/09/23 10:20:06 [alert] 10468#10468 failed to store current configuration
looks like /opt/unit/state
directory wasn't created.. manually creating seems to fix it
ls -lah state/
total 4.0K
drwxr-xr-x 2 root root 22 Sep 23 10:28 .
drwxr-xr-x 6 root root 78 Sep 23 10:28 ..
-rw------- 1 root root 217 Sep 23 10:28 conf.json
cat state/conf.json
{"listeners":{"*:8300":{"application":"php56domaincom"}},"applications":{"php56domaincom":{"type":"php","workers":10,"root":"/home/nginx/domains/domain.com/public","user":"nginx","group":"nginx","index":"index.php"}}}
from unit.
thanks @VBart for clarification :)
from unit.
Related Issues (20)
- CLI: instances listening on TCP ports are shown as unix sockets
- Docker: pre-populating state
- OSS-Fuzz: Moving the build upstream HOT 1
- [Epic] Create a new CLI for Unit (unitctl)
- [Epic] Implement observability with OpenTelemetry
- [Epic] Support `Transfer-Encoding: chunked` for all data flows HOT 1
- CLI: New subcommand for restarting applications
- CLI: New subcommand for listing applications
- CLI: Include unitctl in our Homebrew and Linux packages
- Chunked: Unit can send data to target from buffers before full stream is received
- OpenTelemetry: Implement distributed tracing for requests
- OpenTelemetry: Implement daemon-wide resource usage metrics
- OpenTelemetry: Ship example Collector and Grafana configurations
- OpenTelemetry: Document usage of metrics / tracing modules
- nodejs: Need to be compatible with non-utf8 text responses
- Couldn't connect to server after install on Ubuntu HOT 1
- I get 503 error with Images and CSS files HOT 6
- unit affects the performance of Node.js operations with Redis
- unitctl not installed with `brew install nginx/unit/unit` on macOS HOT 3
- NGINX UNIT "PHP" application is not supported on RHEL 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unit.