#nginx not starting
1 messages · Page 1 of 1 (latest)
Hello! I'm AppySmith, your support bot here to help you with your Appsmith
issues. It looks like you're facing a permissions issue while trying to run a
script to start HTTPS with Nginx. The error message indicates that Nginx doesn't
have the necessary permissions to access the log file or bind to port 80, which
is usually a privileged port. Here's how to resolve this: 1. Ensure that you are
running the script with superuser privileges. Use sudo before your command:
sudo ./start-https.sh 2. If you are already using sudo and still
facing this issue, check if another service is using port 80 with the following
command: sudo netstat -tulpn | grep :80 3. If another service is running
on port 80, you'll need to stop it or configure it to use a different port
before starting Nginx. 4. Make sure the user running the Nginx process has the
proper permissions to write to the error log directory /var/log/nginx/. Try
running the script with sudo and let me know how it goes. If you encounter
further issues, I'm here to assist! If you don't find my response helpful, you
can request to speak to a human agent
can u please tell me how to stop port or how to add a new port , pid of the port is not showing
Sure, to free up the port or configure Nginx to use a different port, you can
follow these steps: 1. To stop a service that is using port 80, first you need
to find out which service is using it. Use the following command to list
services using port 80: sudo netstat -tulpn | grep :80 2. Once you
identify the service, you can stop it using the stop command specific to the
service. For example, if the service is apache2, you can stop it with: sudo systemctl stop apache2 3. To change the Nginx listening port, locate
the Nginx configuration file, which is usually found at
/etc/nginx/sites-available/default or /etc/nginx/nginx.conf. Open it with a
text editor using superuser privileges, for example: sudo nano /etc/nginx/sites-available/default 4. Look for the line that says listen 80; and change 80 to your desired port number, for example: ``` listen 8080;
errors with: ``` sudo nginx -t ``` 7. If you get a success message, restart
Nginx to apply the changes: ``` sudo systemctl restart nginx ``` Keep in mind
that if you choose a non-standard web port (other than 80 for HTTP or 443 for
HTTPS), you will need to specify the port number in the browser while accessing
your application. Let me know if you need further assistance! If you don't find
my response helpful, you can request to speak to a human agent
i have set the port 8081 and nginx server is succesfully availabe at 8081 but when i run
./start-https.sh in app/client , it is trying to connect nginx port 80 which is not available
u can check
sudo ./start-https.sh
[sudo] password for sagar_k:
nginx is /usr/sbin/nginx
mkcert is /usr/local/bin/mkcert
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Unknown error)
nginx: [emerg] still could not bind()
The error you are encountering suggests that the start-https.sh script is
configured to set up HTTPS on port 80, but since Nginx has already been
configured to listen on port 8081, there's a conflict. The start-https.sh
script likely contains explicit instructions to run Nginx on port 80. You will
need to modify the script or the Nginx configuration that the script uses to
reflect the correct port. Here's what you can do: 1. Open the start-https.sh
script with a text editor using superuser privileges, such as: sudo nano ./start-https.sh 2. Look for the line where Nginx is being configured to
listen on port 80. It might look similar to listen 80; or there might be a
directive to bind to port 80. 3. Change the port from 80 to 8081, matching the
configuration you've set up for Nginx. 4. Save the changes and exit the editor.
5. After modifying the script, run it again with sudo to apply the HTTPS
configuration: sudo ./start-https.sh Make sure to look carefully through
the script for any other configurations that might need to be updated to reflect
the use of port 8081 instead of 80. If you're not sure how to modify the script
or if you prefer not to do so, you may need to consult the documentation or
support resources for the specific script or framework you're using. Let me know
if you're able to make these changes or if you need more specific guidance! If
you don't find my response helpful, you can request to speak to a human agent