Can't access apache from outside my local network [closed]
I've created a simple Apache2 server in my computer, and set my vhost to my folder correctly, and added a phpmyadmin as well.
When accessing from localhost and from any computers inside the LAN, it works perfectly.
Leaving the network makes both apache and phpmyadmin inaccessible. I've changed my Hosts file to translate domain.lan to my internet's IP.
I can access ssh normally, and using domain.lan:8080, I can access my home router settings from outside.
For testing purposes, I've forwarded EVERY port in the router to my server's IP.
Some tests I've run:
Server-side (home internet):
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# ufw status
Status: inactive
$ nmap 187.39.*.*
Starting Nmap 7.60 ( https://nmap.org ) at 2019-01-28 13:50 -02
Nmap scan report for <ISP> (187.39.*.*)
Host is up (0.050s latency).
Not shown: 997 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
161/tcp closed snmp
Nmap done: 1 IP address (1 host up) scanned in 12.56 seconds
virtual host file:
<VirtualHost *:80>
ServerName domain.lan
ServerAlias www.domain.lan
ServerAdmin webmaster@localhost
DocumentRoot /path
<Directory /path/>
Order Allow,Deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
client-side(foreign network)
$ ping domain.lan
PING domain.lan (187.39.*.*) 56(84) bytes of data.
64 bytes from domain.lan (187.39.*.*): icmp_seq=1 ttl=49 time=32.6ms
^C
--- domain.lan ping statistics ---
1 package transmitted, 1 received, 0% package loss, time 1000ms
$ nc -zv 187.39.*.* 22
Connection to 187.39.*.* 22 port [tcp/ssh] succeeded!
$ nc -zv 187.39.*.* 80
nc: connect to 187.39.*.* port 80 (tcp) failed: Connection timed out
apache-httpd webserver phpmyadmin
closed as too broad by Rui F Ribeiro, RalfFriedl, Mr Shunz, jimmij, msp9011 Jan 30 at 18:33
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
|
show 1 more comment
I've created a simple Apache2 server in my computer, and set my vhost to my folder correctly, and added a phpmyadmin as well.
When accessing from localhost and from any computers inside the LAN, it works perfectly.
Leaving the network makes both apache and phpmyadmin inaccessible. I've changed my Hosts file to translate domain.lan to my internet's IP.
I can access ssh normally, and using domain.lan:8080, I can access my home router settings from outside.
For testing purposes, I've forwarded EVERY port in the router to my server's IP.
Some tests I've run:
Server-side (home internet):
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# ufw status
Status: inactive
$ nmap 187.39.*.*
Starting Nmap 7.60 ( https://nmap.org ) at 2019-01-28 13:50 -02
Nmap scan report for <ISP> (187.39.*.*)
Host is up (0.050s latency).
Not shown: 997 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
161/tcp closed snmp
Nmap done: 1 IP address (1 host up) scanned in 12.56 seconds
virtual host file:
<VirtualHost *:80>
ServerName domain.lan
ServerAlias www.domain.lan
ServerAdmin webmaster@localhost
DocumentRoot /path
<Directory /path/>
Order Allow,Deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
client-side(foreign network)
$ ping domain.lan
PING domain.lan (187.39.*.*) 56(84) bytes of data.
64 bytes from domain.lan (187.39.*.*): icmp_seq=1 ttl=49 time=32.6ms
^C
--- domain.lan ping statistics ---
1 package transmitted, 1 received, 0% package loss, time 1000ms
$ nc -zv 187.39.*.* 22
Connection to 187.39.*.* 22 port [tcp/ssh] succeeded!
$ nc -zv 187.39.*.* 80
nc: connect to 187.39.*.* port 80 (tcp) failed: Connection timed out
apache-httpd webserver phpmyadmin
closed as too broad by Rui F Ribeiro, RalfFriedl, Mr Shunz, jimmij, msp9011 Jan 30 at 18:33
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Do you have selinux enabled ? Also, is the hostname for your Apache configured to be resolved globally. The Apache should be accessible within the network however is the IP statically resolved outside the network. The DNS should be able to understand that your hostname is resolved to certain IP.
– Atul
Jan 28 at 17:17
Try to forward only 80/HTTP for testing. The firewall rules/iptables seem to be all open...e.g. they are not doing anything practical. Also, your foreign network, if corporate/bank, can block direct access to the Internet. Does a nc to a known Internet site works?
– Rui F Ribeiro
Jan 28 at 17:32
@Atul I never installed selinux, and I believe Ubuntu 18.04 LTS doesn't have by default, so no. How do I check if my apache is configured to be resolved globally?
– Victor Monteiro Cunha
Jan 28 at 18:26
@RuiFRibeiro I am indeed testing from a corporate network, but nc'ing to google.com 80 works fine. Since nc'ing to port 80 times out, I believe there's something blocking it involving my computer or my router, not the apache itself.
– Victor Monteiro Cunha
Jan 28 at 18:30
Have you also deactivated the router "management" in the WAN interface?
– Rui F Ribeiro
Jan 28 at 18:35
|
show 1 more comment
I've created a simple Apache2 server in my computer, and set my vhost to my folder correctly, and added a phpmyadmin as well.
When accessing from localhost and from any computers inside the LAN, it works perfectly.
Leaving the network makes both apache and phpmyadmin inaccessible. I've changed my Hosts file to translate domain.lan to my internet's IP.
I can access ssh normally, and using domain.lan:8080, I can access my home router settings from outside.
For testing purposes, I've forwarded EVERY port in the router to my server's IP.
Some tests I've run:
Server-side (home internet):
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# ufw status
Status: inactive
$ nmap 187.39.*.*
Starting Nmap 7.60 ( https://nmap.org ) at 2019-01-28 13:50 -02
Nmap scan report for <ISP> (187.39.*.*)
Host is up (0.050s latency).
Not shown: 997 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
161/tcp closed snmp
Nmap done: 1 IP address (1 host up) scanned in 12.56 seconds
virtual host file:
<VirtualHost *:80>
ServerName domain.lan
ServerAlias www.domain.lan
ServerAdmin webmaster@localhost
DocumentRoot /path
<Directory /path/>
Order Allow,Deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
client-side(foreign network)
$ ping domain.lan
PING domain.lan (187.39.*.*) 56(84) bytes of data.
64 bytes from domain.lan (187.39.*.*): icmp_seq=1 ttl=49 time=32.6ms
^C
--- domain.lan ping statistics ---
1 package transmitted, 1 received, 0% package loss, time 1000ms
$ nc -zv 187.39.*.* 22
Connection to 187.39.*.* 22 port [tcp/ssh] succeeded!
$ nc -zv 187.39.*.* 80
nc: connect to 187.39.*.* port 80 (tcp) failed: Connection timed out
apache-httpd webserver phpmyadmin
I've created a simple Apache2 server in my computer, and set my vhost to my folder correctly, and added a phpmyadmin as well.
When accessing from localhost and from any computers inside the LAN, it works perfectly.
Leaving the network makes both apache and phpmyadmin inaccessible. I've changed my Hosts file to translate domain.lan to my internet's IP.
I can access ssh normally, and using domain.lan:8080, I can access my home router settings from outside.
For testing purposes, I've forwarded EVERY port in the router to my server's IP.
Some tests I've run:
Server-side (home internet):
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# ufw status
Status: inactive
$ nmap 187.39.*.*
Starting Nmap 7.60 ( https://nmap.org ) at 2019-01-28 13:50 -02
Nmap scan report for <ISP> (187.39.*.*)
Host is up (0.050s latency).
Not shown: 997 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
161/tcp closed snmp
Nmap done: 1 IP address (1 host up) scanned in 12.56 seconds
virtual host file:
<VirtualHost *:80>
ServerName domain.lan
ServerAlias www.domain.lan
ServerAdmin webmaster@localhost
DocumentRoot /path
<Directory /path/>
Order Allow,Deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
client-side(foreign network)
$ ping domain.lan
PING domain.lan (187.39.*.*) 56(84) bytes of data.
64 bytes from domain.lan (187.39.*.*): icmp_seq=1 ttl=49 time=32.6ms
^C
--- domain.lan ping statistics ---
1 package transmitted, 1 received, 0% package loss, time 1000ms
$ nc -zv 187.39.*.* 22
Connection to 187.39.*.* 22 port [tcp/ssh] succeeded!
$ nc -zv 187.39.*.* 80
nc: connect to 187.39.*.* port 80 (tcp) failed: Connection timed out
apache-httpd webserver phpmyadmin
apache-httpd webserver phpmyadmin
asked Jan 28 at 16:00
Victor Monteiro CunhaVictor Monteiro Cunha
1
1
closed as too broad by Rui F Ribeiro, RalfFriedl, Mr Shunz, jimmij, msp9011 Jan 30 at 18:33
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by Rui F Ribeiro, RalfFriedl, Mr Shunz, jimmij, msp9011 Jan 30 at 18:33
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Do you have selinux enabled ? Also, is the hostname for your Apache configured to be resolved globally. The Apache should be accessible within the network however is the IP statically resolved outside the network. The DNS should be able to understand that your hostname is resolved to certain IP.
– Atul
Jan 28 at 17:17
Try to forward only 80/HTTP for testing. The firewall rules/iptables seem to be all open...e.g. they are not doing anything practical. Also, your foreign network, if corporate/bank, can block direct access to the Internet. Does a nc to a known Internet site works?
– Rui F Ribeiro
Jan 28 at 17:32
@Atul I never installed selinux, and I believe Ubuntu 18.04 LTS doesn't have by default, so no. How do I check if my apache is configured to be resolved globally?
– Victor Monteiro Cunha
Jan 28 at 18:26
@RuiFRibeiro I am indeed testing from a corporate network, but nc'ing to google.com 80 works fine. Since nc'ing to port 80 times out, I believe there's something blocking it involving my computer or my router, not the apache itself.
– Victor Monteiro Cunha
Jan 28 at 18:30
Have you also deactivated the router "management" in the WAN interface?
– Rui F Ribeiro
Jan 28 at 18:35
|
show 1 more comment
Do you have selinux enabled ? Also, is the hostname for your Apache configured to be resolved globally. The Apache should be accessible within the network however is the IP statically resolved outside the network. The DNS should be able to understand that your hostname is resolved to certain IP.
– Atul
Jan 28 at 17:17
Try to forward only 80/HTTP for testing. The firewall rules/iptables seem to be all open...e.g. they are not doing anything practical. Also, your foreign network, if corporate/bank, can block direct access to the Internet. Does a nc to a known Internet site works?
– Rui F Ribeiro
Jan 28 at 17:32
@Atul I never installed selinux, and I believe Ubuntu 18.04 LTS doesn't have by default, so no. How do I check if my apache is configured to be resolved globally?
– Victor Monteiro Cunha
Jan 28 at 18:26
@RuiFRibeiro I am indeed testing from a corporate network, but nc'ing to google.com 80 works fine. Since nc'ing to port 80 times out, I believe there's something blocking it involving my computer or my router, not the apache itself.
– Victor Monteiro Cunha
Jan 28 at 18:30
Have you also deactivated the router "management" in the WAN interface?
– Rui F Ribeiro
Jan 28 at 18:35
Do you have selinux enabled ? Also, is the hostname for your Apache configured to be resolved globally. The Apache should be accessible within the network however is the IP statically resolved outside the network. The DNS should be able to understand that your hostname is resolved to certain IP.
– Atul
Jan 28 at 17:17
Do you have selinux enabled ? Also, is the hostname for your Apache configured to be resolved globally. The Apache should be accessible within the network however is the IP statically resolved outside the network. The DNS should be able to understand that your hostname is resolved to certain IP.
– Atul
Jan 28 at 17:17
Try to forward only 80/HTTP for testing. The firewall rules/iptables seem to be all open...e.g. they are not doing anything practical. Also, your foreign network, if corporate/bank, can block direct access to the Internet. Does a nc to a known Internet site works?
– Rui F Ribeiro
Jan 28 at 17:32
Try to forward only 80/HTTP for testing. The firewall rules/iptables seem to be all open...e.g. they are not doing anything practical. Also, your foreign network, if corporate/bank, can block direct access to the Internet. Does a nc to a known Internet site works?
– Rui F Ribeiro
Jan 28 at 17:32
@Atul I never installed selinux, and I believe Ubuntu 18.04 LTS doesn't have by default, so no. How do I check if my apache is configured to be resolved globally?
– Victor Monteiro Cunha
Jan 28 at 18:26
@Atul I never installed selinux, and I believe Ubuntu 18.04 LTS doesn't have by default, so no. How do I check if my apache is configured to be resolved globally?
– Victor Monteiro Cunha
Jan 28 at 18:26
@RuiFRibeiro I am indeed testing from a corporate network, but nc'ing to google.com 80 works fine. Since nc'ing to port 80 times out, I believe there's something blocking it involving my computer or my router, not the apache itself.
– Victor Monteiro Cunha
Jan 28 at 18:30
@RuiFRibeiro I am indeed testing from a corporate network, but nc'ing to google.com 80 works fine. Since nc'ing to port 80 times out, I believe there's something blocking it involving my computer or my router, not the apache itself.
– Victor Monteiro Cunha
Jan 28 at 18:30
Have you also deactivated the router "management" in the WAN interface?
– Rui F Ribeiro
Jan 28 at 18:35
Have you also deactivated the router "management" in the WAN interface?
– Rui F Ribeiro
Jan 28 at 18:35
|
show 1 more comment
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Do you have selinux enabled ? Also, is the hostname for your Apache configured to be resolved globally. The Apache should be accessible within the network however is the IP statically resolved outside the network. The DNS should be able to understand that your hostname is resolved to certain IP.
– Atul
Jan 28 at 17:17
Try to forward only 80/HTTP for testing. The firewall rules/iptables seem to be all open...e.g. they are not doing anything practical. Also, your foreign network, if corporate/bank, can block direct access to the Internet. Does a nc to a known Internet site works?
– Rui F Ribeiro
Jan 28 at 17:32
@Atul I never installed selinux, and I believe Ubuntu 18.04 LTS doesn't have by default, so no. How do I check if my apache is configured to be resolved globally?
– Victor Monteiro Cunha
Jan 28 at 18:26
@RuiFRibeiro I am indeed testing from a corporate network, but nc'ing to google.com 80 works fine. Since nc'ing to port 80 times out, I believe there's something blocking it involving my computer or my router, not the apache itself.
– Victor Monteiro Cunha
Jan 28 at 18:30
Have you also deactivated the router "management" in the WAN interface?
– Rui F Ribeiro
Jan 28 at 18:35