Author |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 11:23 Post subject: virtual hosts apache windows resolve locally but not externa |
|
|
hi my virtual host resolve locally but but not externally only the first container seems to be active.
My windows host file reads as follows and DNS is set to forward to my ip
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
127.0.0.1 www.aacomputersandconsoles.co.uk
127.0.0.1 aacomputersandconsoles.co.uk
127.0.0.1 www.guildwebsites.co.uk
127.0.0.1 guildwebsites.co.uk
127.0.0.1 www.defenderofaszune.guildwebsites.co.uk
127.0.0.1 defenderofaszune.guildwebsites.co.uk
My Httpd reads
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
and my virtual host file reads as follows
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
DocumentRoot "e:/xampp/htdocs/aacomputersandconsoles" #only this directory is active externally all web addresses end up in this directory
ServerName www.aacomputersandconsoles.co.uk
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "e:/xampp/htdocs/guildwebsites"
ServerName www.guildwebsites.co.uk
ServerAlias *.guildwebsites.co.uk
</VirtualHost>
Any ideas why these only resolve locally and why only the first container is active externally as i have spent hours working on this problem.
Thanks in advance
LEE |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 04 Oct '14 11:31 Post subject: |
|
|
By externally I assume you mean other computers on the LAN. Since you're not using DNS, each external computer also has to have those in a host file but pointing to the servers LAN IP. |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 11:33 Post subject: |
|
|
my dns for both domains point to my enternal ip address my router is configured to forward port 80 to my computer on the lan. |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 11:43 Post subject: |
|
|
correction dns record with the domain name provider points to my external ip address. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 04 Oct '14 11:52 Post subject: |
|
|
Are you sure port 80 is not blocked by Virgin?
Do you see a 68.7.xxx.x being blocked in your routers log? |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 11:58 Post subject: |
|
|
apache was disabled |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 04 Oct '14 11:59 Post subject: |
|
|
ok, what is the main hosts document root in httpd.conf
It was timing out when I tried but I see you now
A A Computers and Consoles
Last edited by glsmith on Sat 04 Oct '14 12:07; edited 2 times in total |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 12:04 Post subject: |
|
|
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "E:/xampp/htdocs"
that is the entire httpd.conf file
Moderator's Edit: the rest of the entire conf file |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 04 Oct '14 12:11 Post subject: |
|
|
OK, this is breaking my brain but it is way past my bedtime. in your OP you are showing Xampp on Windows
DocumentRoot "e:/xampp/htdocs/aacomputersandconsoles"
But when your site answers, here is what I am seeing in the headers.
http://www.guildwebsites.co.uk/
GET / HTTP/1.1
Host: www.guildwebsites.co.uk
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:24.0) Gecko/20100101 Firefox/24.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://www.apachelounge.com/viewtopic.php?p=28817
Connection: keep-alive
Cache-Control: max-age=0
HTTP/1.1 200 OK
Date: Sat, 04 Oct 2014 09:45:52 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Content-Length: 596
Connection: close
Content-Type: text/html; charset=UTF-8
You're running xampp behind a proxy it looks to me. If this is the case, your problem lies there. |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 12:14 Post subject: |
|
|
im new to all this how can i tell if it running behind a proxy? and how to i sort it if that is the case? |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 12:47 Post subject: |
|
|
Also if I swap the container in vhosts file you get guildwebsites index instead of aa computers |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 15:14 Post subject: |
|
|
was suggested that my modem/router wasnt http 1.1 compliant
error logs shows
[Sat Oct 04 10:52:47.441031 2014] [mpm_winnt:notice] [pid 5380:tid 404] AH00456: Apache Lounge VC11 Server built: Jul 17 2014 11:50:08
[Sat Oct 04 10:52:47.441031 2014] [core:notice] [pid 5380:tid 404] AH00094: Command line: 'e:\\xampp\\apache\\bin\\httpd.exe -d E:/xampp/apache'
[Sat Oct 04 10:52:47.443034 2014] [mpm_winnt:notice] [pid 5380:tid 404] AH00418: Parent: Created child process 5452
AH00548: NameVirtualHost has no effect and will be removed in the next release E:/xampp/apache/conf/extra/httpd-vhosts.conf:20
[Sat Oct 04 10:52:47.904957 2014] [ssl:warn] [pid 5452:tid 392] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Oct 04 10:52:48.076033 2014] [ssl:warn] [pid 5452:tid 392] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Oct 04 10:52:48.104061 2014] [mpm_winnt:notice] [pid 5452:tid 392] AH00354: Child: Starting 150 worker threads.
acees log shows
127.0.0.1 - - [04/Oct/2014:11:15:19 +0100] "GET /favicon.ico HTTP/1.1" 404 1068 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36"
6.210-157-192.rdns.scalabledns.com - - [04/Oct/2014:11:19:31 +0100] "GET /web-console/ServerInfo.jsp HTTP/1.1" 404 1057 "-" "-"
before.guardshop.info - - [04/Oct/2014:11:19:52 +0100] "GET /web-console/ServerInfo.jsp HTTP/1.1" 404 1057 "-" "-"
78-60-1-101.static.zebra.lt - - [04/Oct/2014:11:22:39 +0100] "GET / HTTP/1.0" 200 219 "() { :;}; echo \"BigBang: \" $(</etc/passwd)" "() { :;}; echo \"BigBang: \" $(</etc/passwd)"
crawl-66-249-67-33.googlebot.com - - [04/Oct/2014:11:29:09 +0100] "GET /robots.txt HTTP/1.1" 404 1057 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
crawl-66-249-67-49.googlebot.com - - [04/Oct/2014:11:29:09 +0100] "GET / HTTP/1.1" 200 219 "http://www.aacomputersandconsoles.co.uk/" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
crawl-66-249-67-41.googlebot.com - - [04/Oct/2014:11:29:28 +0100] "GET / HTTP/1.1" 200 219 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
cpc2-leic17-2-0-cust884.8-1.cable.virginm.net - - [04/Oct/2014:14:08:21 +0100] "GET / HTTP/1.1" 200 219 "http://www.guildwebsites.co.uk/" "Mozilla/5.0 (Linux; U; Android 4.3; en-gb; GT-I9300 Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30" |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 16:35 Post subject: |
|
|
Also if i click admin from Xampp control panel it takes me to aa computers and consoles page rather than the admin page |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sat 04 Oct '14 18:36 Post subject: |
|
|
Sorry, had to get a few hours sleep.
In the name based virtual hosting docs there is an oddly worded paragraph about the first vhost needing to be a duplicate of the main host. Since yours is
c:/xampp/htdocs, try as the first one
<VirtialHost _default_:80>
DocumentRoot c:/xampp/htdocs
</VirtialHost> |
|
Back to top |
|
leecooper2013
Joined: 04 Oct 2014 Posts: 25 Location: uk, leicester
|
Posted: Sat 04 Oct '14 19:09 Post subject: |
|
|
no problem, I appreciate all your help.
added the default host and still no joy at all.
I'm assuming you meant to put it in Httpd-Vhost file??
Regards
Lee |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sun 05 Oct '14 1:21 Post subject: |
|
|
I must ask, did you restart the server after you made the change? You would be amazed how many do not.
78-60-1-101.static.zebra.lt - - [04/Oct/2014:11:22:39 +0100] "GET / HTTP/1.0" 200 219 "() { :;}; echo \"BigBang: \" $(</etc/passwd)" "() { :;}; echo \"BigBang: \" $(</etc/passwd)"
Someone looking for Shellshock, I've yet to see one of these in my logs. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Sun 05 Oct '14 2:28 Post subject: |
|
|
One other thing
DocumentRoot "e:/xampp/htdocs/aacomputersandconsoles" #only this directory is active externally all web addresses end up in this directory
Do not add comments after directives, use the line above. Apache looks at the first non-whitespace character for the # to decide if it's a comment line or not. This can (not saying in your case) cause problems.
http://httpd.apache.org/docs/2.4/configuring.html
Quote: | Directives in the configuration files are case-insensitive, but arguments to directives are often case sensitive. Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on a line after a configuration directive. Blank lines and white space occurring before a directive are ignored, so you may indent directives for clarity. |
|
|
Back to top |
|