Comments (9)
@franshesco it depends on how you installed unit.
For precompiled packages, location of the socket is /var/run/control.unit.sock
or /run/control.unit.sock
If you compile unit from source, you can specify the location in configure time, using --control parameter.
./configure --help
...
--control=ADDRESS set address of control API socket
default: "unix:control.unit.sock"
Default location is in .
- current directory where the daemon is launched from.
You can also redefine the socket location when starting the daemon. See unitd --help
If you ever decide to use an IP and port for control API, you should use additional tools to secure it. See here:
http://unit.nginx.org/docs-integration-with-nginx.html#securing-and-proxying-unit-api
On your other question, after starting the daemon, you can upload configuration from any file through the API. See a few examples here: http://unit.nginx.org/docs-configuration.html
from unit.
Hi @franshesco,
In order to launch your application, Unit needs to know its location and type. Here's information about how to configure your application and listening socket for it using Unit API: http://unit.nginx.org/docs-configuration.html
You can also watch a demo video, that shows most of the features and configuration: https://www.youtube.com/watch?v=I4IWEz2lBWU
from unit.
@franshesco Now your application should work on port 8300.
from unit.
hi @nshadrin,
thank you for your reply but I still have some preoccupations.
it means that after the installation, the control.unit.sock file must be automatically created right? I have two centos7 servers, on the first server, I install unit from package but I don't find the control.unit.sock file and the package is installed.
On the second server, I have php 7 installed. When trying to install unit from packages, it needs php 5 and the installation failed because of conflict with php 7. In the documentation, normally unit is compatible with php7. How can I resolve the problem please? I have the error below
Error: php70u-common conflicts with php-common-5.4.16-42.el7.x86_64 Error: php70u-json conflicts with php-common-5.4.16-42.el7.x86_64
I would like to understand how I can launch for example my php project with unit.
What is the content of the control.unit.sock file? can you please show me an example?
thx
from unit.
unitd creates control.unit.sock when it runs. On exit the socket is deleted. The only prerequisite is a directory where the socket should be created.
from unit.
Hi @igorsysoev , thank you. sorry but I was not avalaible
I resolved my issue on the first server with unitd which start correctly. I try it for a test. When I use the command curl -X PUT -d @/var/www/html/myapps.json --unix-socket /var/run/control.unit.sock http://localhost/
I have the message "success": "Reconfiguration done."
I understand that the configuration is good but i don't still understand how unit helps me to launch my application.
thx
from unit.
Hi @VBart ,
thx for your reply. I have configured the apps.json file with the listener and object definition as the documentation shows.
{ "listeners": { "*:8300": { "application": "myapps" } }, "applications": { "myapps": { "type": "php", "workers": 20, "root": "/var/www/myapps", "index": "index.php" } } }
I have run the curl command as shown in my previous post.
curl -X PUT -d @/var/www/myapps/myapps.json --unix-socket /var/run/control.unit.sock http://localhost:8300 { "success": "Reconfiguration done." }
But I don't understand how unit helps me to launch the application.
I will watch the demo video.
from unit.
Hi @VBart ,
thx for the reply. exactly, i understand more the unit's concept.
from unit.
Sounds great. Let's close this issue now.
from unit.
Related Issues (20)
- Listeners 127.0.0.1:xx is not working, The prompt already exists, but I haven't seen the configuration anywhere HOT 3
- Upgrade wasm-wasi-component to latest Wasmtime HOT 2
- WAF
- Release 1.33 meta tasks HOT 10
- RHEL ARM Packages
- Mismatch in content of `SECURITY.txt` in Units and e.g. NGINX Agents / NJS Repositories HOT 4
- "error": "Failed to apply new configuration." HOT 3
- Current git HEAD tests issue a Rust-related error HOT 6
- Current git HEAD tests fail if Unit is built without njs: test_routes_match_if HOT 4
- Current git HEAD tests fail on Ubuntu 24.04: isolation_rootfs HOT 6
- Current git HEAD tests fail on FreeBSD 14 / Python 3.11.9: test_python_factory_invalid_callable_value HOT 7
- HTTP request is sent twice in Node app HOT 7
- docker: access log is owned by root HOT 2
- unitctl: rename app to apps
- unitctl: use `restart` instead of `reload` for `apps` subcommand
- unitctl binaries should have better version reporting HOT 3
- unitctl: update Cargo.toml metadata HOT 9
- Exposing metrics endpoint from Docker container HOT 2
- [unitctl] Support system filewatcher for restart command
- Error in the hyper legacy client: client error (Connect) HOT 5
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.