Nginx unable to connect

I am referring to this link to install Nginx on Ubuntu: Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Ubuntu 13.04.

sudo su — Runs OK.

apt-get install mysql-server mysql-client
mysql-client is already the newest version.
mysql-server is already the newest version.

Yet when I try on Firefox it does not show the welcome page. (That is Nginx is not running).

Unable to connect

Firefox can't establish a connection to the server at localhost.

1

1 Answer

Do have a look at the port number used by nginx. Most of the times, if another web-server was installed (e.g. apache standalone, or lamp) and improperly removed, the default port 80 will be occupied.

Best bet is to first check if the port number is occupied by using"netstat" to check the presently using ports.

netstat -antp

If 80 is occupied, then try the following

  1. open nginx.conf and change the server port number to 8080
  2. save and exit
  3. restart nginx by:

    sudo service nginx restart or /etc/init.d/nginx restart

Check if the above is working and do the necessary changes later.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like