V
V
Vladimir2015-06-25 09:58:09
Nginx
Vladimir, 2015-06-25 09:58:09

How to change the user under which nginx is running?

There is a need to give statics from the /var/lib/tomcat7/webapps/ folder, while leaving the host locale to be able to knock on this folder through tomcat. To do this, I registered in /etc/nginx.conf the user under which its processes will run


user tomcat7 tomcat7;
worker_processes 4;
pid /run/nginx.pid

Now if nginx is not reloaded, then the logs for the previous day are transferred to *.log.1 new log files are created not under root, but under tomcat7 nginx writes that it does not have access to these files and continues to write to log.1
Sooner or later it crashes with text, the log file has exceeded the size.
If the log files are deleted and nginx is restarted, log files are created from under the root and nginx writes to them without problems

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
egor_nullptr, 2015-06-25
@egor_nullptr

How exactly do you rotate logs?

R
rinokonli, 2015-06-26
@rinokonli

just add group root to this folder with logs
like chown tomcat7:root /var/log/...
or vice versa

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question