I want to change Apache's port so I can use NGINx as a reverse proxy listening to port 80.
I changed the Listen 0.0.0.0:80
and Listen [::]:80
lines in the /etc/httpd/conf/httpd.conf file to Listen 0.0.0.0:8090
and Listen [::]:8090
and when I run sudo service httpd restart
and then sudo service httpd status
it says:
Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://localhost/whm-server-status
what else do I need to change in the httpd.conf file?
My NGINx conf file is
server{
listen 80;
server_name mywebpage.com;
#access_log off;
#error_log off;
#large_client_header_buffers 4 16k;
#this one is for the node app
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header Connection "";
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
#this one is for the apache one
location /otherlocation {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header Connection "";
proxy_pass http://127.0.0.1:8090;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
which works perfectly when I serve my node app but if I change Apache's port it won't work
EDIT:
I also changed every <VirtualHost *:8090>
and now it says
[Tue Feb 14 01:03:50 2017] [warn] VirtualHost 162.214.21.28:8090 overlaps with VirtualHost 162.214.21.28:8090, the first has precedence, perhaps you need a NameVirtualHost directive
[Tue Feb 14 01:03:50 2017] [warn] VirtualHost 162.214.21.28:8090 overlaps with VirtualHost 162.214.21.28:8090, the first has precedence, perhaps you need a NameVirtualHost directive
[Tue Feb 14 01:03:50 2017] [error] VirtualHost *:8090 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Tue Feb 14 01:03:50 2017] [warn] VirtualHost 162.214.21.28:8090 overlaps with VirtualHost 162.214.21.28:8090, the first has precedence, perhaps you need a NameVirtualHost directive
[Tue Feb 14 01:03:50 2017] [warn] NameVirtualHost 162.214.21.28:80 has no VirtualHosts
[Tue Feb 14 01:03:50 2017] [warn] NameVirtualHost 127.0.0.1:80 has no VirtualHosts