Recent Discovery
With IIS set back to port 80
, when I put in http://localhost/
on the WHS computer, it gives me the "There is a problem with this website's security certificate" warning page. If I "Continue" anyway, this url comes up https://localhost/Remote/logon?ReturnUrl=%2fremote
for a Windows Home Server 2011 Remote Web Access for a username
and password
. Now, I cannot recall for sure, but I do not believe that originally just a http://localhost/
brought up this issue. However, it seems as though this might affect any attempts to access localhost (no matter the port).
What may actually be the main issue
Oh the intricacies of networking! One thing that kept bothering me was why two of the sites would "partially" come up, and the others not at all. Then, running Firebug's NET tracking revealed to me that my main issue is that my ISP is acting as DNS proxy, and of course it is not finding my test sites. But it does find the two sites that are live at the www.
(not test.
) address, and appears to serve up those, but the images are blocked because (I assume) I have set up blocks to accessing the image files if not from the www.
for the particular site.
That explains the mystery of the images not showing (expect on direct localhost:8080
call) and the odd behavior in "partially" finding those specific two of the five sites.
Now I need to figure out how to correctly configure either my router or a proxy file to redirect to back to my WHS computer. I am on Wildblue satellite internet service, as I am outside the area of any faster service connections. They have an "optimizer" file (I don't know if it is viewable to everyone or not, if not, it is basically the same as this version), that I may be able to modify and put on my local system to achieve what I need, but I am uncertain exactly what I may need to do there.
If anyone has any suggestions on either modifying that file, or how to configure my Linksys E1200 router to avoid sending to the proxy if it is a local site, then that may be the first (and possibly last) step to me solving my issues.
Representative code based on harrymc's recommendations... still not working
IIS port set to :90
.
httdp
file:
Listen *:80
ServerName localhost:80
vhosts
file:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
ProxyRequests off
ProxyPass / http://127.0.0.1:90/
ProxyPassReverse / http://127.0.0.1:90/
</virtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Users/Public/LocalWebsites/site1.net/httpdocs"
ServerName test.site1.net
ProxyRequests off
ProxyPass / http://127.0.0.1/
ProxyPassReverse / http://127.0.0.1/
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Users/Public/LocalWebsites/site2.net/httpdocs"
ServerName test.site2.net
ProxyRequests off
ProxyPass / http://127.0.0.1/
ProxyPassReverse / http://127.0.0.1/
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Users/Public/LocalWebsites/site3.com/httpdocs"
ServerName test.site3.com
ProxyRequests off
ProxyPass / http://127.0.0.1/
ProxyPassReverse / http://127.0.0.1/
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Users/Public/LocalWebsites/site4.com/httpdocs"
ServerName test.site4.com
ProxyRequests off
ProxyPass / http://127.0.0.1/
ProxyPassReverse / http://127.0.0.1/
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Users/Public/LocalWebsites/site5.com/httpdocs"
ServerName test.site5.com
ProxyRequests off
ProxyPass / http://127.0.0.1/
ProxyPassReverse / http://127.0.0.1/
</VirtualHost>
Previous Update: What I had believed to be the main issue (may be a sub issue)
How do I make Windows Home Server (running IIS) forward specific localhost URL's to port 8080
so that Apache (not IIS) running on the same machine picks the request up to serve the page?
The c:\Windows\System32\drivers\etc\hosts
file has been changed (see below), but I assume that has nothing to do with rerouting to a new port. IIS, I also assume, is picking up the particular test.whatever
url request on port 80
and routing to its own local host on the same port.
I downloaded Application Request Routing from a tip on a site I found in researching, but in looking at it, I'm not sure whether it will help or not (my hope was to set up some url based forwarding to port 8080
by it). I am a web designer, not a network wizard. So how all this works is somewhat elusive to me.
A Possible Direction to Go
Based off this link (found after searching more based off erikxiv's first comment below) I attempted the following in IIS as a URL rewrite:
Outbound Rule:
Match: .*
(seemed to test okay)
Conditions:
Match Any of... (these seemed to test pattern match okay)
{HTTP_HOST} Matches the Pattern test\.site1\.net
{HTTP_HOST} Matches the Pattern test\.site2\.net
{HTTP_HOST} Matches the Pattern test\.site3\.com
Rewrite Action:
http://localhost:8080/{R:0} (it would not let me put R:1 like the example)
But there appears to still be no forwarding!
The information below is now all background behind the new, above, request.
Background Info
I recently changed an old desktop that was running Windows XP to be a Windows Home Server (2011). The old computer was also the host for local test sites running on an Apache install. Doing some research unveiled that running Apache on a WHS machine would not be as difficult as I first thought (many sites say that the IIS of WHS and Apache would cause issues, but a few I found mentioned no problems at all if set up correctly--basically, make sure there is no port conflict).
So I installed a WAMP (64-bit version) to the WHS computer, and changed the settings in the Apache httpd
config file to listen at port 8080
so there would be no conflict with IIS. I set up my virtual host file as on the XP computer, only with the port change as well.
Basically, everything seemed to be running fine (however, see update), except...
The (Original) Issue
While the pages to the local sites pull up fine, and all css and javascript are functioning, every image file is not showing. The path info is correct as evidenced by right clicking and selecting View Image Info
(in Firefox... by the way, the images do not show in any browser, so it is not a browser bug).
What I have noticed, however, is that the Type
in the image info box is showing text/html
, rather than PNG Image
or JPEG Image
etc. This is in the information below where it shows the path (address) info--in that section, it recognizes that the file itself is of Type
either Image
or Background
.
But despite that fact, it appears that rather than recognizing the correct mime-type (I assume) of the image within the html (actually php generated html), it is instead trying to process the image (whether an img
element or a css background-image
) as text, and thus giving me nothing! But I cannot figure out why. The mime
file controlling the Apache mime-types is correct. The pages have the following headers...
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
...but those should not be causing the issue (they did not when running on XP, nor do they on the live site).
So I am seeking thoughts on:
- Is my analysis of mime-type being the issue correct (based on update, probably not)?
- Where else can I look that might be causing the issue, and how to correct it? Could it still be a conflict with IIS on the WHS, and if so, what? Could it be anything in the php (this seems unlikely), and if so, what? What else can I check in Apache?
Updated Info (with more [related?] Issues)
Doing some more messing around, I've come to the conclusion that at least part of the issue seems to be the change to port :8080
. First, I came to realize not all was as well as I thought in getting to all my sites. I have this representation in my c:\Windows\System32\drivers\etc\hosts
file:
127.0.0.1 localhost
127.0.0.1 test.site1.net
127.0.0.1 test.site2.net
127.0.0.1 test.site3.com
127.0.0.1 test.site4.com
127.0.0.1 test.site5.com
And this representation in my apache vhosts
file:
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "C:/Users/Public/Documents/LocalWebsites/site1.net/httpdocs"
ServerName test.site1.net
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/Users/Public/Documents/LocalWebsites/site2.net/httpdocs"
ServerName test.site2.net
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/Users/Public/Documents/LocalWebsites/site3.com/httpdocs"
ServerName test.site3.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/Users/Public/Documents/LocalWebsites/site4.com/httpdocs"
ServerName test.site4.com
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "C:/Users/Public/Documents/LocalWebsites/site5.com/httpdocs"
ServerName test.site5.com
</VirtualHost>
Here's the behavior: site1
and site4
are showing up, but without images. The other three do not show up at all, but give Network Error (dns_unresolved_hostname)
.
However, if I access the first site in the vhosts on the WHS machine by using localhost:8080
in the url, then the images do show up, and whichever site is first in my vhosts file also shows up (which is expected); however, it does so even if it was one that previously would not (so if I move site2
to the first position, it starts "working" via localhost:8080
call).
I know my image files are returning a 403
(corrected, originally I said 404) error when accessed via test.site4.com
syntax in the url, and I suspect that my images are showing up as text/html
because the files are returning that error (so I don't think it is a mime-type issue now as much a failure to find the images). But the odd thing is that the paths are correct, and non-image files (javascript and css) are coming up fine.
So in my mind it seems like it maybe something with the port switch to 8080
. My issues now are:
- Why are my hosts and vhosts files not correctly finding all the sites (is there some other file I need to modify on a Windows Home Server)?
- On those sites it does work for, why do the images specifically not get found (with the 403 error, that is "forbidden" I believe, which makes no sense if the other files in the website folders are being allowed access)?
- Why does the
localhost:8080
access work no matter what in relation to the first two issues?
Some Further Info
A request was made for me to post log files. However, I discovered there were no logs occurring except (it appears) in those instances when I had accessed via the direct localhost:8080
call to the "default" site.
So I turned off the WAMP services, and went to the url's and discovered the same behavior as when WAMP was running. This would seem to indicate that IIS is still controlling the domain names, rather than Apache picking them up (can someone confirm my assumption there?), and thus the issue may well be something still with getting control itself over to the WAMP server.