You are not logged in.
I followed the instructions from here: https://wiki.archlinux.org/title/nginx# … ng_systemd
Here is my nginx.conf:
user user;
worker_processes auto;
worker_cpu_affinity auto;
events {
multi_accept on;
worker_connections 1024;
}
http {
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
log_not_found off;
types_hash_max_size 4096;
client_max_body_size 16M;
# MIME
include mime.types;
default_type application/octet-stream;
# logging
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
# load configs
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server {
listen 7777;
listen [::]:7777;
server_name site.com;
root /home/user/site;
location / {
index index.php index.html index.htm;
}
}
}
My user.conf:
[Service]
User=user
Group=user
RuntimeDirectory=nginx
StateDirectory=nginx
LogsDirectory=nginx
PIDFile=/run/nginx/nginx.pid
ExecStart=
ExecStart=/usr/bin/nginx -g 'pid /run/nginx/nginx.pid; error_log stderr;'
ExecReload=
ExecReload=/usr/bin/nginx -s reload -g 'pid /run/nginx/nginx.pid; error_log stderr;'
After running I see an error:
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/etc/systemd/system/nginx.service; disabled; preset: disabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─user.conf
Active: active (running) since Thu 2023-08-03 15:44:50; 3min 4s ago
Process: 5014 ExecStart=/usr/bin/nginx -g pid /run/nginx/nginx.pid; error_log stderr; (code=exited, status=0/SUCCESS)
Main PID: 5016 (nginx)
Tasks: 3 (limit: 4684)
Memory: 2.7M
CPU: 56ms
CGroup: /system.slice/nginx.service
├─5016 "nginx: master process /usr/bin/nginx -g pid /run/nginx/nginx.pid; error_log stderr;"
├─5017 "nginx: worker process"
└─5018 "nginx: worker process"
Aug 03 15:44:50 linux systemd[1]: Starting A high performance web server and a reverse proxy server...
Aug 03 15:44:50 linux nginx[5014]: 2023/08/03 15:44:50 [warn] 5014#5014: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
Aug 03 15:44:50 linux systemd[1]: Started A high performance web server and a reverse proxy server.
Help please to run this without using aur package and dockers and other complex manipulations
Last edited by larmet (2023-08-03 14:20:35)
Offline
So the server is running but a warning is hanging, what should I do about it
Aug 03 15:44:50 linux nginx[5014]: 2023/08/03 15:44:50 [warn] 5014#5014: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
Last edited by larmet (2023-08-03 13:56:26)
Offline
Why do you have 'user user;' in nginx.conf?
Offline
Can't run...
But it does run, and it seems to just fine.
After running I see an error
What error? There is a warning there which is 1) pretty straitforward, and 2) not fatal.
So what's the actual problem?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Why do you have 'user user;' in nginx.conf?
Because I need to run nginx as user user
Offline
Title wrote:Can't run...
But it does run, and it seems to just fine.
larmet wrote:After running I see an error
What error? There is a warning there which is 1) pretty straitforward, and 2) not fatal.
So what's the actual problem?
And I figured it out, it turns out user is not needed because I registered it in systemd. It was a mistake I'm using a translator
Offline