There are typically four sources of errors when attempting to install Nginx or to run it for the first time:
Some of the prerequisites are missing or an invalid path to the source was specified. More details about prerequisites can be found in Chapter 1, Downloading and Installing Nginx.
After having installed Nginx correctly, you cannot use the SSL-related directives to host a secure website. Have you made sure to include the SSL module correctly during the
configure
step? More details in Chapter 1, Downloading and Installing Nginx.Nginx refuses to start and outputs a message similar to
[emerg] bind() to 0.0.0.0:80 failed (98: Address already in use).
This error signifies that another application is utilizing the network port 80. This could either mean that another web server such as Apache is already running on the machine, or that you don't have the proper permissions to open a server socket on this port. This can happen if you are running Nginx from an underprivileged system account.Nginx refuses to start and outputs a message similar to
[emerg] 3629#0: open() "/path/to/logs/access.log" failed (2: No such file or directory)
. In this case, one of the files that Nginx tries to open, such as logfiles, cannot be accessed. This could be caused by invalid access permissions or by an invalid directory path (for example, when specifying log files to be stored in a directory that does not exist on the system).