I am willing to run both nginx and apache2 web server together in order to host multiple domains on the same IP address on my Linux ubuntu server.

I have already modified my ports.conf file to change my ubuntu port to 8080

I installed nginx by disabling the apache webserver because it was creating issues while it was enabled.

But as soon as i made the reverse proxy script and put it in sites enabled i am unable to start both of them together.

Even after changing ubuntu port to 8080 this appears

tcp 0 0* LISTEN 18961/apache2

tcp 0 0* LISTEN 18961/apache2

I do not have 000-default.conf i deleted it earlier when i had only one single domain.

I need to remove apache2 from port 80 so it can only be limited to port 8080 and henceforth i can host my nginx server together with apache.

  • Welcome to U&L. Have you restarted Apache after making the port configuration changes? If it is still listening on port 80, you must have a 'Listen 80' directive specified elsewhere.
    – Haxiel
    Feb 2, 2019 at 14:54
  • I do not have any listen directive on port 80 in ports.conf found in /etc/apache2 Is there any other place where this directive is embedded in apache web server? Please let me know i will fix that too. Edit: Yes i have restarted the apache web server many a times already as i wanted to start one of the domains.
    – Bituspy
    Feb 2, 2019 at 18:14
  • Anyone knows about any config file other than /etc/apache2/ports.conf from where apache picks up the default port config please?
    – Bituspy
    Feb 4, 2019 at 5:43

1 Answer 1


Find out where that directive might be:

grep -iIR 'listen ' /etc/apache2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .