Reputation: 553
I am having a crazy issue with my ubuntu 18 server. I have installed nginx meanwhile nginx service is not getting started using /etc/init.d/nginx start or service nginx start. Both are having the below error.
nginx syntax check is not throwing any errors. I have managed to start the service directly using the command '/usr/sbin/nginx'
Tried purging entire nginx libraries and reinstalling the same but the below error is still there. Any work around for the same?
Jan 20 14:27:48 ns3159300 systemd[5219]: nginx.service: Failed to execute command: No such file or directory
Jan 20 14:27:48 ns3159300 systemd[5219]: nginx.service: Failed at step EXEC spawning /usr/share/nginx/sbin/nginx: No such file or directory
Jan 20 14:27:48 ns3159300 systemd[1]: nginx.service: Control process exited, code=exited status=203
I have managed to fix the error by coping the sbin folder from another ubuntu 18 server. But now new error is there. This was the actual issue that has caused all the problem
nginx: [emerg] module "/usr/share/nginx/modules/ngx_http_geoip_module.so" version 1014000 instead of 1016001 in /etc/nginx/modules-enabled/50-mod-http-geoip.conf:1
Upvotes: 0
Views: 1740
Reputation: 119
you can reset your server and then after installation when you get that old error of service you have to correct your path in service.nginx file. As you are saying that you were able to start the service directly by /usr/sbin/nginx path. But in your error message you can see service.nginx file is looking on /usr/share/nginx/sbin/nginx path for start script, which is in /usr/sbin/nginx path, So you have to correct the path of nginx file in your service.nginx file. Same is the case for restart and other services. Note: when you reinstall the nginx so first confirm the location of nginx binary file. which is in this case in usr/sbin/nginx directory Moreover, You can check the official documentation on this link.
Upvotes: 2