I have a problem with an Apache+Wordpress machine (Debian). By default it listens over port 80, I have changed it and now "listens" over port 9090.
/etc/Apache2/ports.conf
[...]
NameVirtualHost *:9090
Listen 0.0.0.0:9090
[...]
/etc/apache2/sites-available/default
[...]
<VirtualHost *:9090>
[...]
When I tried to access via http://10.250.10.70:9090
y doesnt work. (Chrome error: ERR_CONNECTION_REFUSED
)
Over the same machine if I try wget http://10.250.10.70:9090/ -O -
I get this output:
--2015-05-14 12:31:43-- http://10.250.10.70:9090/
Connecting to 10.250.10.70:9090... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://10.250.10.70/ [following]
--2015-05-14 12:31:43-- http://10.250.10.70/
Connecting to 10.250.10.70:80... failed: Connection refused.
If I listen over port 80 too, but not changing /etc/apache2/sites-available/default
/etc/Apache2/ports.conf
[...]
NameVirtualHost *:9090
Listen 0.0.0.0:9090
Listen 0.0.0.0:80
[...]
WebSite works over port 80 (really I dont know why because NameVirtualHost only should work with port 9090). Also if I access via port 9090 works, but redirects to same URI with port 80
If I execute over the webserver again wget http://10.250.10.70:9090/ -O -
I get this response:
--2015-05-14 12:38:16-- http://10.250.10.70:9090/
Connecting to 10.250.10.70:9090... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://10.250.10.70/ [following]
--2015-05-14 12:38:16-- http://10.250.10.70/
Connecting to 10.250.10.70:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `STDOUT'
[<=> ] 0 --.-K/s <!DOCTYPE html>
[...]
First of all, I dont know why VirtualHost works over port 80, and second why this system redirect any traffic I listen to (9090 in this case), to port 80...
Im completely "lost"
Thanks you all
NOTE:
root@TWBLOG:~# apache2 -v
Server version: Apache/2.2.22 (Debian)
Server built: Dec 23 2014 22:48:29
iptables -L -n
?root@TWBLOG:~# iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination