Forum Moderators: open

Message Too Old, No Replies

IIS Confusion

Proper setup for testing?

         

ohfiddlesticks

4:38 am on Apr 11, 2005 (gmt 0)

10+ Year Member



I don't know too much about IIS and I don't think I have it setup right for my needs. I just use it to test my dynamic sites locally. I store folders for each website in the Inetpub folder and then access them using the following format

[servername...]

I have never had a problem using this format until now. I'm working with custom error files and need to use links that are relative to the ROOT of the site. Problem is that when I try to do that it thinks the root of the site is the root of the server. The links work on my live site at the webhost, just not with my local test server. Do I need to do something with virtual directories, host files, or something else? I saw some articles online that I thought might deal with this but they were confusing and contradicting each other.

mrMister

6:18 am on Apr 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




[servername...]

I can't really help you here. If you're setting up server in a virtual directory, I can't think of anything server wise that will prevent the browser using the real root in absolute URLs.

Have you tried setting the BASE tag in your documents...

<base href="http://servername/websitename/">

If you set that at the top of each file, it may work.

The best solution I can offer is to stop using virtual directories.

Your development server should be set up with the exact same structure as your live server. if you fail to do this then you can expect problems like this to happen.

If your live site runs from the root eg. [servername...] then your development server should be set up to do the same.

CaseyRyan

2:16 pm on Apr 11, 2005 (gmt 0)

10+ Year Member



ohfiddlesticks,
I develop and test on my local machine. It's a windows 2000 server box. Works well because I'm developing multiple sites at a single time.

What I would suggest doing for you is to create a new website on your local box.
Point the home directory for that website to C:\Inetpub\yourDomain.com\.
Put in a host header for that website called local.www.yourdomain.com where yourdomain is whatever your domain is.
In your C:\winnt\system32\drivers\etc\hosts file make the following entry:
127.0.0.1 local.www.yourdomain.com

Now, put the files for your website into the directory and you should be able to test with the same directory structure as you would have on your production website.

This website will only work from your box.

The great thing about this is that you can develop many sites on your local box without any conflict or reconfiguration when you need to switch to a different site.

Another idea is to have a subdomain called something like test.yourdomain.com which you protect with a challenge response password. This would be your test domain that you can upload and test on.
This is good for shared development environments.

-=casey=-

Xoc

6:47 pm on Apr 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, you can create multiple web sites on one machine [google.com], even in Windows Professional, using a script command. You can only have one running at a time on professional, but you can have them all co-exist.

ohfiddlesticks

7:55 pm on Apr 11, 2005 (gmt 0)

10+ Year Member



I think I'm starting to get it....correct me if I'm wrong. I now use Windows 2000 Pro with IIS 5 and that is only intended to run one website and one ftp site. What I have been doing is having virtual directories under the default website. This works ok for some purposes, but is not really the greatest for testing and making sure things will be the same when I upload them to my webhost.

Windows 2000 Server is designed to run multiple web sites, but not Win 2000 Pro. I can however run a script that will allow me to create more websites using Win 2000 Pro, but I'm not "technically" supposed to do that and the sites won't be able to run concurrently. I found an article that tells how to do this for Win 2000 Pro and Win XP Pro by modifying the IIS metabase. I have not tried it yet, but it seems like what I should do.

I think what was confusing me is that there are so many websites that talk about hosting multiple websites in IIS, but many of them don't specify what versions of IIS and Windows they are even talking about. Thank you everyone for your responses, I got very useful information from all of them.

Xoc

7:01 am on Apr 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's it exactly.

Use the hosts file to set up a local domain name for your public domain.

Use the script to create a local web site for your public web site.

Set the host header in IIS manager to match the local domain name in the hosts file.

(warning: there is a bug in windows XP SP2 using hosts files [google.com] with the frontpage server extensions)

mrMister

12:08 pm on May 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"I found an article that tells how to do this for Win 2000 Pro and Win XP Pro by modifying the IIS metabase. I have not tried it yet, but it seems like what I should do."

A simpler, but not as elegant solution is to set up multiple sites using differnt webroots eg...

d:\mysites\www.site1.com\webroot\
d:\mysites\www.site2.com\webroot\
d:\mysites\www.site3.com\webroot\

Then when you want to switch development to another site, just change the home directory in the IIS console.

topr8

12:26 pm on May 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>just change the home directory in the IIS console.

ditto here and that method works fine, it only takes a minute to make the change.

not suitable if you are working on many sites simultaneously though i guess.