Virtual host not working externally

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Virtual host not working externally

Postby leecooper2013 » 04. October 2014 07:29

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 :D
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby Nobbie » 04. October 2014 10:13

leecooper2013 wrote:hi my virtual host resolve locally but but not externally only the first container seems to be active.


Could you explain that more precisely?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Virtual host not working externally

Postby leecooper2013 » 04. October 2014 10:21

Hi when access locally i.e http://www.aacomputersandconsoles.co.uk display the index page in DocumentRoot "e:/xampp/htdocs/aacomputersandconsoles"
http://www.guildwebsites.co.uk displays index page in DocumentRoot "e:/xampp/htdocs/guildwebsites" when viewed from the server machine. but when veiwed via an external computer http://www.aacomputersandconsoles.co.uk display the index page in DocumentRoot "e:/xampp/htdocs/aacomputersandconsoles" and http://www.guildwebsites.co.uk diplays the index page in DocumentRoot "e:/xampp/htdocs/aacomputersandconsoles", in esscence the wrong idex page in the wrong location .
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby leecooper2013 » 04. October 2014 10:29

also the dns for both domians point to my external ip address and router is configured to forward port 80 to my lan address.
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby leecooper2013 » 04. October 2014 10:37

correction dns record with the domain name provider points to my external ip address.
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby Nobbie » 04. October 2014 10:44

I cannot see an error, you should watch the access log as well as the error log for more information. It might be possible (very unsure about that), that the router (or whatever) does not pass the host name correctly to your Apache Server. The host name is part of the HTTP 1/1 Standard and was unknown in HTTP 1/0 (therefore namebase VirtualHosts require HTTP 1/1).

If there is kind of that problem, you should find a hint in the log files.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Virtual host not working externally

Postby leecooper2013 » 04. October 2014 14:06

access log shows
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"

error log 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.

any ideas?????
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby emperor » 04. October 2014 16:26

You have a mistake here:

<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>


It should be:

<VirtualHost *:80>
DocumentRoot "e:/xampp/htdocs/aacomputersandconsoles"
ServerName www.aacomputersandconsoles.co.uk
ServerAlias aacomputersandconsoles.co.uk

</VirtualHost>
emperor
 
Posts: 2
Joined: 04. October 2014 16:23
Operating System: Windows Server 2012

Re: Virtual host not working externally

Postby Nobbie » 04. October 2014 16:50

Wow!!

Did you see that:


leecooper2013 wrote:access log shows
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)"


That is an online attack! Someone tries to exploit your server!

Anyway, these are all "last" lines of access log? There is only one request to www.guildwebsites.co.uk:

leecooper2013 wrote: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"


Nothing else?

The error log is completely useless, are you sure you showed up the right one?

I cannot see any hint, the clue from "emperor" is wrong, there is no need for an ServerAlias.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Virtual host not working externally

Postby leecooper2013 » 04. October 2014 18:08

its the only error log in the log files
and with regards to the online attack did they get my passwords in your opinion??
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby Nobbie » 04. October 2014 18:12

leecooper2013 wrote:its the only error log in the log files


Try to specify separate access and error logs for each VirtualHost. The current log is insufficient.

leecooper2013 wrote:and with regards to the online attack did they get my passwords in your opinion??


I have no idea. But it looks scary.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Virtual host not working externally

Postby leecooper2013 » 04. October 2014 18:19

changed access logs and only reporting local access although default log is showing access from external
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby leecooper2013 » 04. October 2014 18:23

in answer to the attack was looking for unix/lunix passwords and didn't get anything
leecooper2013
 
Posts: 8
Joined: 04. October 2014 07:18
Operating System: windows 8.1

Re: Virtual host not working externally

Postby Nobbie » 04. October 2014 22:09

leecooper2013 wrote:changed access logs and only reporting local access although default log is showing access from external


Without more information it is impossible to look further. Good luck, but this is to difficult.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Virtual host not working externally

Postby gsmith » 05. October 2014 06:22

actually using a web forward and not true dns as I explain in thread for same at apache lounge
gsmith
 
Posts: 278
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 10/2012R VS 14,15,16

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 115 guests