9

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:

  1. Is my analysis of mime-type being the issue correct (based on update, probably not)?
  2. 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:

  1. 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)?
  2. 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)?
  3. 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.

HackToHell
  • 6,408
ScottS
  • 153
  • 1
  • 2
  • 9

5 Answers5

1

Do you perhaps have a .htaccess file that is causing images to be served as text/html?

 <filesMatch "\.(htm|html|css|js|png|jpg)$">
 ForceType 'text/html; charset=UTF-8'
 </filesMatch>
Scott C Wilson
  • 2,454
  • 5
  • 23
  • 33
0

If you can provide your access.log files (at least a couple of lines showing the 404 status for the image requests), we would be able to check what goes wrong. I suspect that it simply might be a domain name issue, or your site may use absolute paths for images (just guessing...) which apache handles incorrectly

0

The thread IIS redirect to Apache contains a very simple solution, which goes in the opposite direction to yours.

The writer of the last entry says that redirects in IIS are too limited to do the job.

Using his solution, you would set up IIS to receive requests from another port than 80, for example 90. Then put Apache as the receiver for both ports 80 and 8080, with a redirect of port 80 to port 90. Apache apparently manages to do what IIS cannot.

harrymc
  • 498,455
0

Since you've tracked it down to a DNS issue the basic result is that you need a local DNS server that you can configure. You also mention a Linksys E1200 router and Windows Home Server, so there are two approaches you can take.

First, you can consider running a third-party firmware (e.g. DD-WRT, OpenWRT, Tomato) on your router. The one you have is using a Broadcom chipset and should have adequate flash; DD-WRT lists it as supported. My biggest concern is that somehow the third-party router firmware community appears to have devolved down to the point where it's like trying to run Linux back in the early '90s. You can try to dig through the forums to find what you need, but don't trust the router database on the DD-WRT site because it'll direct you to the wrong things. Overall this option fails to fill me with confidence, and unless you have a second router available I'm not sure I can recommend it unless you like tweaking this kind of thing.

Second, you can RDP into the WHS and turn on the DNS server as described in this forum thread. Basic approach, RDP in, Control Panel, Add/Remove Programs, Add/Remove Windows Components (button), select DNS Server checkbox, get back out. What I'm not sure about is whether you get the DNS management console with this, and I don't have a WHS box to test it on. If you DO get that console, it'll be under Administrative Tools / DNS. To use it as you're going to want it, you'll need to add new forwarding zones; for the kind of thing you're doing I'd add a zone for each host (e.g. add a zone for www.samplesite.whatever) then add an A record entry to it with no name specified which will make it the default for that zone. The other approach would be to add a zone for samplesite.whatever, then add named A records (e.g. "www" or "mail"), but that may end up blocking things you don't want blocked. The more targeted zone keeps you from affecting things you don't want redirected. You'll then point all of your systems at this box as the DNS server. By default this will do its own external DNS resolution completely bypassing your ISP's DNS servers; if you want to use those as the next stage you can specify their addresses as Forwarders in the DNS server properties (right-click and hunt around).

Third, if option Two doesn't work and option One frightens you, you can set up a Linux box internally and set it up as a DNS server. There's plenty of instruction out there for how to do so; a cursory search turned up this article by Mark Kolich that appears to be decent instructions to do exactly that. If you're so inclined, this may also offer you the resources you need to experiment with Linux-based hosting (unless you're doing Windows-based development e.g. .NET or the like).

This Wikipedia Comparison of DNS Servers may also be of use. Of possible note are Simple DNS Plus (commercial), Posadis (free, stale? 2004), MaraDNS (free, non-GUI, worth looking at), and Unbound (free, does have Windows binary downloads, didn't dig further). All of these should run on Windows.

fencepost
  • 1,106
0

you need to have

<directory>
</directory>

before </VirtualHost> to allow.

something like this

<Directory "C:\Apache24\htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

i use 192.168.1.100:80 for iis and 192.168.1.200:8080 for apache in the Internet Protocol v4 IPv4 Settings (Advanced IP Settings) have 2 class C ip 192.168.1.100 and add 192.168.1.200 this also helps in SEO because of class C ip addresses for 2 different websites linking to each other.