Author |
|
Andi04
Joined: 26 Oct 2013 Posts: 6 Location: Sweden
|
Posted: Thu 05 Jan '17 14:58 Post subject: Apache 2.4.23 can't reach server with URL from local compute |
|
|
Hi. I have stubble upon a problem. I have a webadress www.myname.com and I have setup apache so that i can reach www.myname.com externaly outisde my LAN. I also have setup a vHost for site2.myname.com wich I also can reach externaly outside my LAN.
But if I try to access www.myname.com or site2.myname.com from inside on my LAN then I can't access my site. A workaround is to set www.myname.com and site2.myname.com in my windows host file 10.0.0.20 www.myname.com and 10.0.0.20 site2.myname.com.
This works great until I use a device like AppleTV to reach site2.myname.com from LAN. Then the connection times out.
How do I solve this? I need to reach site2.myname.com from LAN, but I can't add the hostname to hosts on AppleTV. Can I change some settings for Apache so I don't have to add the adress to hosts-file? |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Thu 05 Jan '17 15:13 Post subject: |
|
|
If you have access to the DNS config of your domain, try adding a A-record for site2.myname.com, pointing to 10.0.0.20.
Edit: if site2.myname.com is a public website, you should add an entry local2.myname.com ith value 10.0.0.20 and add ServerAlias local2.myname.com to the vhost of site2.myname.com.
Last edited by Jan-E on Thu 05 Jan '17 15:45; edited 1 time in total |
|
Back to top |
|
Andi04
Joined: 26 Oct 2013 Posts: 6 Location: Sweden
|
Posted: Thu 05 Jan '17 15:17 Post subject: |
|
|
even if 10.0.0.20 is on my LAN?
Edit: Tried to set A-record to 10.0.0.20 on my DNS at Loopia. Didn't work.
On my iPhone I can reach my site from site2.myname.com but still not from a device on my LAN
Last edited by Andi04 on Thu 05 Jan '17 15:25; edited 1 time in total |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Thu 05 Jan '17 15:24 Post subject: |
|
|
Yes. Your Apple TV might read the DNS-config, conclude the site is on 10.0.0.20 and try to connect to it.
It is quite common to have a DNS entry for localhost.myname.com, pointing to 127.0.0.1. But you can do the same for other local IP-adresses. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Thu 05 Jan '17 15:26 Post subject: |
|
|
BTW: use other names for the local sites! local2.myname.com or something line that. |
|
Back to top |
|
Andi04
Joined: 26 Oct 2013 Posts: 6 Location: Sweden
|
Posted: Thu 05 Jan '17 15:32 Post subject: |
|
|
Jan-E wrote: | BTW: use other names for the local sites! local2.myname.com or something line that. |
I didn't understand the last part.
Btw
this i my vhost
Code: |
<VirtualHost *:80>
ServerName site2.myname.com
DocumentRoot "c:/www/vhosts/site2"
<Directory "c:/www/vhosts/site2/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost> |
|
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Thu 05 Jan '17 15:32 Post subject: |
|
|
Andi04 wrote: | even if 10.0.0.20 is on my LAN?
Edit: Tried to set A-record to 10.0.0.20 on my DNS at Loopia. Didn't work. |
DNS propagation might take up to a day, depending on the TTL (Time To Live). Be patient or try to flush the DNS cache of your Apple TV and/or your router. I cannot help you with that. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Thu 05 Jan '17 15:37 Post subject: |
|
|
Andi04 wrote: | Jan-E wrote: | BTW: use other names for the local sites! local2.myname.com or something line that. |
I didn't understand the last part. |
If you add 10.0.0.20 to the public DNS for www.myname.com and site2.myname.com, everybody will try to connect to 10.0.0.20 and you might brick your site for outside users.
Edit: Add a ServerAlias local2.myname.com to your VHost config for site2.myname.com |
|
Back to top |
|