Score:0

nginx.service: Failed at step EXEC spawning /usr/sbin/nginx: No such file or directory

me flag

Hello anyone can help?

I was running aws ligthsail using Nginx Instance. Everything is fine. when i configure vhosts.conf and other conf. when i sudo nginx -t error is this:

nginx: [emerg] "server" directive is not allowed here in /opt/bitnami/apps/capital/conf/nginx-vhosts.conf:1 nginx: configuration file /opt/bitnami/nginx/conf/nginx.conf test failed

and then i tried to check using this code `sudo service nginx status i get this error:

Jan 31 14:15:01 ip-172-26-12-145 systemd[5817]: nginx.service: Failed to execute command: No such file or directory Jan 31 14:15:01 ip-172-26-12-145 systemd[5817]: nginx.service: Failed at step EXEC spawning /usr/sbin/nginx: No such file or directory Jan 31 14:15:01 ip-172-26-12-145 systemd[1]: nginx.service: Control process exited, code=exited, status=203/EXEC Jan 31 14:15:01 ip-172-26-12-145 systemd[1]: nginx.service: Failed with result 'exit-code'. Jan 31 14:15:01 ip-172-26-12-145 systemd[1]: Failed to start The NGINX HTTP and reverse proxy server.

anyone can help please i am new using nginx server.

`

Marvin Desoyo avatar
me flag
anyway i tried to look-up the file path mention on the error log which is /usr/sbin/nginx there's is no nginx folder under on /usr/sbin/
Marvin Desoyo avatar
me flag
also tried to check the status: sudo /opt/bitnami/ctlscript.sh status I got this: mariadb already running nginx not running php-fpm already running
cn flag
Do you need to configure Nginx on Lightsail? Doesn't it kind of do everything for you?
Marvin Desoyo avatar
me flag
thank you for the reply.. what do you mean configure nginx? is already configured i guess
cn flag
Do you still have to configure "vhosts.conf and other conf" if you're using Lightsail? I thought you pretty much just uploaded some code and it did the rest.
Marvin Desoyo avatar
me flag
Yes i did.. this is my code under nginx-vhosts.conf ` server { listen 81; root "/opt/bitnami/apps/capital/htdocs"; server_name capital.carketa.com; include "/opt/bitnami/apps/capital/conf/nginx-app.conf"; } `
cn flag
Looks like there's lots of good info here: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-quick-start-guide-nginx
cn flag
The error is saying your config is wrong, it doesn't like the 'server' line.
Tim avatar
gp flag
Tim
Your nginx config is incorrect, particularly around a "server" block. If you want help with the Nginx configuration you need to share all the files that make up that configuration. Please edit your question to include that information.
Score:1
bd flag

Install nginx with one of these commands:

sudo apt install nginx-core    
sudo apt install nginx-extras  
sudo apt install nginx-full    
sudo apt install nginx-light   

Then you can get it working.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.