 |
|
 |
I love this, works a charm. Thanks for sharing...
|
|
|
|
 |
|
|
 |
|
 |
I understand and have implemented everything here, however it still seems that the multiple definied sites need to be started in order for this to work. What am I missing?
|
|
|
|
 |
|
 |
To tell you the truth i am not using this approach for long time already.
Starting .NET 2.0 there is built in web server into .NET and there is pretty much no difference between it and IIS (from development view)
Here is the command to run your project from root. C:\inetpub\wwwroot\XoopsNet is the folder where web application is (in my case).
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE" /port:103 /path:C:\inetpub\wwwroot\XoopsNet
Then if you hit http://localhost:103 and it will work as from the root.
You will be able to debug it.
1. Start a server
2. In Options for the project, Start Options modify it to 'Use custom server' and Base url put http://localhost:103
(it's for visual studio express), Visual studio will have slightly different name, but has that option.
Luckily Visual Studio (expres or not express) remember that setting, so you do not need to do it everytime, Just start the server first, It runs in the background. So you need to start it again only when you shutdown your machine.
PS: Obviously if you change port 103 to 80, you do not need to specify port number, just make sure IIS is not running since it takes port 80 by default.
PPS: Majority of projects will not even notice that it's not IIS. You need to pay attention when you using security. Built-in servers runs under your account and IIS has his own account, hence the access to files or shared folders... will be different.
|
|
|
|
 |
|
 |
This DLL works well enough, unless you need URLs above about 1KB. Then you'll run into odd 404 errors.
|
|
|
|
 |
|
 |
Running XP Pro SP2 and using Multisite and Config from your Demo file.
Config looks like
[websites]
1.site.com=/Test1
2.site.com=/Test2
Hosts looks like
127.0.0.1 localhost
127.0.0.1 www.1.site.com
127.0.0.1 www.2.site.com
IIS Local Path is D:\Websites
\Test1 one and \Test2 are under D:\Websites
Restarted IIS
www.1.site.com gives error 403
When changing Local Path to D:\Websites\Test1 it works when I type www.1.site.com but www.2.site.com goes to the same website. What am I missing? Do I need a virtual directory? do I need a completely seperate domain name? I'm trying to get this working but am not having little luck.
Your help is appreciated.
Thank you very much.
Michael
|
|
|
|
 |
|
 |
I installed this on my XP pro machine and it seems to work great but on win 2k it doesn't
config file is
[websites]
test.local=/test
when I browse to test.local/default.aspx
I get a .net error saying it can't find the file at
/test/default.aspx
thanks
|
|
|
|
 |
|
 |
Should work on Win2K.
If you are getting .NET error that means the ISAPI filter worked and .NET should have picked up correct file /test/default.aspx which looks like does not exist.
Please test that http://localhost/test/default.aspx works.
George.
My site - Body Jewelry
Not my site - Piercing info
|
|
|
|
 |
|
 |
I have some .net projects i've setup here, and some classic asp. On the classic asp projects when i do an include virtual="/thefile.asp"- it reads it as /website/thefile.asp? give me an error that says it can't find the page
any work around on that, that won't require me go through every page with an include?
|
|
|
|
 |
|
 |
nevermind... this ISAPI filter seemed to buggy and wouldn't work right with classic ASP.
I went and downloaded/installed this http://www.firstserved.net/services/iisadmin.php
works perfect, and all you have to do is edit your host file to go to dev.yoursite.com and use this tool to set up your sites.
|
|
|
|
 |
|
 |
Hi,
I got this to work in IIS and the URL points properly and load via VS.
But when I try to debug, I get the following error:
Error while trying to run project: Unable to map the debug start page URL to a machine name.
Debuggin works fine if I didn't use multisite.dll and go to localhost.
but when I implement this solution.
the site comes up, http://mymachine.com/ perfect
just can't start debugger.
any ideas?
thanks
|
|
|
|
 |
|
 |
Try to modify folowing files
1. projectname.csproj.webinfo
2. project.sln
Change the localhost to mymachine.com
Works for me. Also ou can try following (it will be exactly how i have it setup).
1. Copy sln file to the folder where project is (in Inetpub).
2. Try to drop .com may be that is the problem (I do not use .com)
---------------------------------------------------------
If it does not work you can always use your project as is with localhost but when you start the debugger launch second IE and open up http://mymachine.com/perfect
The debugging will work and i actually find it more convinient. Since that window never closes even when you stop debugging.
George
My site - Body Jewelry
Not my site - Piercing info
|
|
|
|
 |
|
 |
Hi George,
thanks for trying to help.
Yes, i've modified all those files.
and it's just mymachine (not .com)
and so yes, it will open up in VS (if i didn't modify those files at all,
the project wouldn't even load) , but can't start the debugger.
The problem, is the debugger won't start at all..
gives that error.
so I can't even start debugger, and go to IE and open http://mymachine/
but oustide the VS i can go to http://mymachine
all three files are in the folder of the subsite...
It's supposed to be a VirtualDirctory under the Default Web Site right?
all files are in the Folder in the Virtual Dir...
Anything else you can think of?
thanks,
|
|
|
|
 |
|
 |
i got it working now.
first i made the directory, browsable,etc.. so when i do open project from Web it works.
But when Open Project from web, i had chosen the solution (sln) file instead of the (.proj ) file once I chose the proj file it works.
it think part of the problem was the .sln file was not be able to overwrite itself or something, cuz when i did debug this time it ask what to save the .sln file as...
oh well, it works...thanks...
|
|
|
|
 |
|
 |
You can even create a secured WebDAV folder like: https://sub.domain and it will open domain/sub
MS should implement this for subwebs. After all, the main purpose of IIS 5.1 is to test sites before uploading to a production server, so using the same syntax is essential.
|
|
|
|
 |
|
 |
I finally got this working, both in design-time and run-time... For the projects to work in design-time I needed to change the *.webinfo and *.sln files to map to the url defined in the hosts-file. At first I couldn't get VS.NET to open my projects, but after a few restarts of both IIS and the computer it is working as a charm. I will have great use of this functionality in my upcoming projects - so many thanks to you! Best regards, Richard
|
|
|
|
 |
|
 |
Both in the "source" and the "demo" version, a MultiSite.dll is included. The first, in de \Debug folder of the "source" version, has a size of 300kB, the second, "demo" version, is 65 kB.
Which one should be used and what is the difference?
(I'm not familiar with the .Net environment.)
Regards, Arman
|
|
|
|
 |
|
 |
Use demo version. it's a release compiled version. So it work faster than debug version.
My site - www.tersaakov.com
|
|
|
|
 |
|
 |
I tried your ISAPI filter, but I don't get it working. Perhaps I didn't understand your setup instructions completely. My web development environment contains WinXP Pro - IIS 5 - Dreamweaver MX.
This is my situation:
1) On IIS, in the Default Web Site, I have a folder named ABS, this contains a test website.
2) I also have a Virtual Directory called "DEF" in the Default Web Site, pointing to a folder somewhere on a shared drive containing another website.
3) In the "host" file, I added the following lines: 127.0.0.1 www.abc.org and 127.0.0.1 www.def.net.
4) I copied the Multisite.dll and config.ini to a separate folder and added the ISAPI filter to the Default Web Site properties. (Installing it in the Web Sites properties results in a "not loaded" status.)
5) In "your" config file, I added the following lines: www.abc.org=/ABC and www.def.net=/DEF.
6) I restarted IIS.
This is what happens in the browser (IE6):
- address: www.abc.org --> shows the top (wwwroot) default page.
- address: www.def.net --> shows the top (wwwroot) default page.
So, apparently the Multisite DLL doesn't work here.
Please, help me to understand what's wrong.
Regards,
Arman
|
|
|
|
 |
|
 |
I see were problem is.
Change ini file as following.
abc.org = /ABC
def.net = /DEF
The www prefix is stripped out. So it works like in real world with www and without.
But keep in mind that in host file you need to have 2 lines one with www and one without.
Let me know if it's working or not.
I actually forget to mention it in the article. I will modify it.
Thanks
George.
My site - www.tersaakov.com
|
|
|
|
 |
|
 |
I'm still a little new to this filter, but I believe the problem is the following:
Arman2 wrote:
3) In the "host" file, I added the following lines: 127.0.0.1 www.abc.org and 127.0.0.1 www.def.net.
Depending on how the server is attached to the network, 127.0.0.1 will be altered.
I am running a bank of redundant hardware behind a gateway/router firewall using WinXP Pro and the standard IIS 5.1. It requires me to alter the IP address to the LAN address on each host file. And I keep the DLL and INI over on my system32 directory.
Therefore, I alter 127.0.0.1 to the standard LAN format 192.168.[LAN #].[machine #] where I assigned the [LAN #] and the [machine #] in the gateway/router. Its a Linksys wireless gateway/router.
If the server is connected directly to the WAN via a modem only, then I'm guessing the IP address will be the cable IP address.
Once I did this the whole multisite.dll ISAPI filter took off like a big-assed bird. I run over 20 different web sites from my cable connection and the most diverse menagerie of web pages you could ever see, ranging from the mundane [HTML] to ASP, to MS database. I even run concurrent FTP and SMTP servers out of IIS 5.1. No need yet to run the NN server, but the day could come.
My only suggestion is to take the framework of multisite.dll and create another filter that will take the place of the IP address block function that was also removed from IIS 5.1. The new filter could be placed at either a higher or lower ISAPI priority (depending on the situation) than multisite.dll. The INI file could contain a list of specific IP addresses or IP address blocks and an associated file, return code, or null response that is sent (or not sent) to those addresses.
The same type of filter could be used to deactivate certain methods. Additionally, with a little more complicated coding structure repetitive hits on a server from a single IP address in a short period of time could be eliminated with a counter/timer filter. These suggested approaches, of course, would be used to discourage less desireable elements on the internet.
Is Gevorg up to the challenge? If he doesn't have the time he could delegate the challenge. I could get the first filter up in a relatively short period and have it posted here for all.
|
|
|
|
 |
|
 |
This is (almost) a perfect solution for me. I'm trying to get a legacy asp application under control. It runs in the root directory in production and on my development machine (XP Pro) it almost works when I use the MultiSite DLL. There's a url in a Server.Execute() statement that isn't working. I'm new to asp and JScript but I assume the problem is that this is executed in process on the server and never touches the isapi filter. Any suggestions?
|
|
|
|
 |
|
 |
You are correct. The problem with Server.Execute (or Server.Transfer) is that it works on a server so it does not go through ISAPI filter.
The solution is to use it with '~' symbol. Like Server.Execute("~/mypage.aspx") then it will work. ASP.NET will automatically translate it to "/project/mypage.aspx"
If you are using ASP then unfortunatelly there is no easy solution like with ASP.NET. Could not think of any except to hardcode the project folder name there. Or replace Server.Execute with Reponse.Redirect.
My site - www.tersaakov.com
|
|
|
|
 |
|
 |
How is this any different/better than using host headers in IIS 5.0+?
http://www.windowsitpro.com/Windows/Article/ArticleID/21205/21205.html
|
|
|
|
 |
|
 |
Both ways work. Only one thing: HostHeaders will work only on Windows 2000 (or 2003) Server editions. Not on XP or Workstation. IIS does not support multiple Websites on Workstation or XP. So if you are unluky as i am and have XP on your development machine then you simply do not have choice.
My site - www.tersaakov.com
|
|
|
|
 |