Tom
Tom

Reputation: 936

Apache cant change listening port

I am trying to install nginx as reverse frontend proxy to apache.

During this process I have to change the listening port for apache to e.g. 7070 instead of 80.

I went to the /etc/httpd/conf/httpd.conf and changed:

Listen 80

to

Listen 7070

I also added a virtualhost

NameVirtualHost *:7070
<VirtualHost *:7070>
//code
</VirtualHost>

at the end of it

However when i restart apache and nginx, nginx complains that port 80 is already in use and cannot be used

if i run

ss -plnt sport eq :80

i see lots of httpd processes/users.

What am i doing wrong, why is apache still on port 80?

If i do

sudo fuser -k 80/tcp 

i can start nginx then, but then apache complains about the used port 80...

What am i doing wrong? :|

I am thankful for any help

Upvotes: 1

Views: 298

Answers (1)

Capsule
Capsule

Reputation: 6159

You need a NameVirtualHost directive matching your virtualhosts somewhere in your config. In your case, you'd need that, before the VirtualHosts declarations:

NameVirtualHost *:7070

As a matter of fact, you must have NameVirtualHost *:80 somewhere already, just change the port there too.

Upvotes: 2

Related Questions