1

i am running a vps with apache. just installed nginx. got the address already in use error at port 80 because apache is using it. I am new to linux/apache stuff so is it possible to change the port of nginx and how ? if yes will it work as i want it to serve static files automaticaly or should i get my hosting company to do it instead since i don't know much about these.

and yes i used this tutorial to install it http://library.linode.com/web-servers/nginx/installation/centos-5

Help Appreciated :)

Thanks in advance

Ayaz Malik
  • 148
  • 1
  • 12

1 Answers1

3

Look either into

  • your nginx.conf file
  • or any of the sites in sites-enabled (usually under the nginx directory)

and search the server part, listen

  server {
    listen   80;

here you can change the port for 81 for instance instead of 80.

Notes:

  • you may also have the server { listen } part within your nginx.conf directly
  • if you are under Linux, the configuration is usually in /etc/nginx (nginx.conf) and sites-enabled is below that directory.
  • regarding Apache (Linux), using either service apache stop or service httpd stop or /etc/init.d/apache stop (or httpd) should work to stop the process, or try killall httpd or killall apache (or apache2) to stop Apache.
Déjà vu
  • 28,223
  • 6
  • 72
  • 100