Answer the question
In order to leave comments, you need to log in
CentOS + Nginx from sources. Why is the service not starting?
Good day dear!
Due to subjective reasons, I decided to tinker with CentOS (before that, I tinkered with Debian for 10+ years). I downloaded CentOS-7, installed it on a virtual machine, updated it, everything is fine. I decided to build Nginx from source, because. this is one of the most frequent procedures in my practice (building software from source) when working with Linux, and Nginx is a program that is quite familiar to me. Well, for a change, I decided to screw ngx_pagespeed into it.
I read the instructions, for example here (there are a lot of very similar ones, I won’t give all the links, they are essentially the same).
I did everything as it should be, downloaded src.rpm, unpacked it, added the module, built Nginx, delivered the dependencies, built the package, installed the package via: yum install local nginx...rpm
I'm writing: service nginx start
- error. I look at the error:
янв 21 18:19:27 localhost.localdomain systemd[1]: Starting nginx - high performance web server...
янв 21 18:19:27 localhost.localdomain nginx[2241]: /usr/sbin/nginx: error while loading shared libraries: cannot create cache for search path: Cannot allocate memory
янв 21 18:19:27 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=127
янв 21 18:19:27 localhost.localdomain systemd[1]: Failed to start nginx - high performance web server.
/usr/sbin/nginx
- lo and behold, Nginx has started! service start nginx
- the error is the same. From the error, I realized that nginx cannot load the "space" libraries, cannot create a folder for the cache at the address "space" and cannot allocate memory ... /usr/lib/systemd/system/nginx.service
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
/usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx -s stop
service nginx start
- we return to the same as it was at the beginning. Answer the question
In order to leave comments, you need to log in
[nginx] Don't use type=forking in systemd service file
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=...
This is a memory allocation error. It can happen to both muscle and gzip. Either the server eats a lot of memory when it is started from service, or there is little memory in principle. See how much it eats.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question