Running Classic ASP site on IIS7.5 - asp-classic

I've tried everything I can think of (and read online) and hit a brick wall.
Bought a new PC, Windows 7 and turned on IIS7.5 and Classic ASP. Downloaded my classic asp site and database (an Access database - yes I know, Access!). I downloaded my whole site wwwroot for local developing and testing.
Any asp page residing in the top level directory (localhost/index.asp) runs fine in the browser. But click on a link to any page within a directory (eg localhost/blah/index.asp) gives me a 404 error.
The files are DEFINATELY there. If I create a simple test asp page and place it in a directory, it works fine in the browser. And it's not a coding issue - the site works online and on my old XP machine.
Could it be to do with permissions of the files and folders when they were downloaded (BTW, I tried downloading via filezilla and FTPrush, but it made no difference). I'm no expert on PCs, and I've already experienced a few problems with permissions (and I'm logged into PC as Administrator)
Any ideas please?

So are the files based in c:\inetpub\wwwroot\blah? Does c:\inetpub\wwwroot\blah\index.asp exist?
Try giving IISUR and IIS_IUSRS admin access over the folder and its contents.

Related

Why have my pictures disappeared (404) in a previously working website?

I created a IIS website about a year and a half ago with a lot of pictures on various aspx/asp tabbed pages. My development PC is Windows 8.1 Pro with IIS version 8.5.9600.16384 website. The website was developed using Visual Studio 2012. The website was published onto the same Windows PC.
The published website was then copied onto a Window Server 2012R2 on an IIS Version 8.5.9600.16384 web and worked well. Gradually search engine bots found the site and all was well.
This week I went to make some updates to the website and found none of the pictures working. They are all returning a 404 html code. When I view the .jpg files individually from IIS Firefox returns "cannot be displayed because it contains errors". Chrome and Edge both say the file can't be found. If I view these files from Windows File Explorer they look fine.
So I deleted the files on the server and then copied the published website from my development PC. Still no pictures.
I have another similar web application on the same server so moved one of the jpg files to that directory and tried to view it via IIS - still 404. I copied a picture from the other website to my "broken" directory and the other picture was viewable via IIS. All of these pictures were reduced in the same manner using Photoshop 7.0.
I went back to my development PC and viewed the original website via IIS. The pictures were viewable so I republished the website, copied it to the server - no pictures.
I then found the original picture (not reduced) and moved it to the server. Still 404.
My problem doesn't seem to be permissions because I can view pictures copied from another web to that directory.
The website had been working for over a year but the pictures now return 404's.
The pictures can be viewed on the development PC using IIS but not after publishing them and then copying the website to the server.
Another website with essentially the same code with pictures reduced in the same manner is displaying pictures fine.
I'm really perplexed and would love to hear some of your ideas as to what might be my problem. Thanks for taking the time to read this.
The first place I always start with missing images is to View Source and make sure the path to the image is actually what I think it is.
Could you have done something so the path is now built relative to the machine's file structure instead of relative to the site? That could cause the image to be found locally, but not on your server.
It might be easier for someone to get an idea if you included the URL so we could examine the page displayed.
I'm pretty sure I figured out the problem but it leads to other questions.
I shortened the filename and now I can browse to it via IIS.
So here are my current questions:
Why had the pictures been browse-able originally but not now? Has there been some kind of internet change about acceptable file length? Or possibly some kind of Server 2012R2 update that caused this change?
Why are these pictures browse-able on my Windows 8.1 PC via IIS but not on the Server 2012R2? I can also open the website and see all of the pictures on Windows 8.1.
It's nice to have tackled one problem but I would still like to know the cause if anyone should have any suggestions.
I FINALLY figured out why my pictures disappeared. Yes renaming my .jpg files did fix the problem but that wasn't the cause. The problem was that I had added /2018, /2019 and /2020 to my IIS Request Filtering denied. All of my picture files had dates on them. When I renamed/shortened the file names I removed the /year. Phew! The stupid things I do! This also explained why I could view these webpages on my development PC but not the server - no request filtering. Hopefully my error helps someone down the line.

How to setup existing asp site in ISS with MS Access database?

I need to migrate an old .asp site onto our new server (Server Essentials 2016).
The site runs off an Access database and is currently hosted in IIS on a windows 7 pro machine.
I have enabled asp.net 4.6 on the new server and copied the whole website from the old server (Windows 7 Pro) into an equivalent directory on the new server, (C:\inetpub\wwwroot - I know it's not best practice to store the site here but I am eliminating variables to get the site working - once it works, I'll move it...).
Plain HTML pages now work fine, so the sites folder is clearly accessible but any page that needs to access the database gives an error 500 - both from the server's own browser and from other PC's on the network... The site and it's database are both in the same wwwroot folder and have an identical filepath to that on the windows 7 machine so the only thing different is the computer name and OS.
I have multiple other (php) sites running on the new server but cannot get this asp site to work!
What am I doing wrong? Short of rewriting the whole site in php I'm stuck!
Thanks in advance!
Fixed it, I needed to change the connections file from "Provider=Microsoft.Jet.OLEDB.4.0;" to "Provider=Microsoft.ACE.OLEDB.12.0;" None of the error messages hinted at this but we got there in the end!
So to recap for anyone else in this situation:
Step 1: In IIS highlight the site in the left hand pane and double click the "ASP" icon, then change "Enable Parent Paths" to "True"
Step 2: Download and install the Microsoft Access Database Engine (https://www.microsoft.com/en-us/download/details.aspx?id=13255)
Step 3: Change the code in your connections file to "Provider=Microsoft.ACE.OLEDB.12.0;"
Thanks for the guidance!

ASP.NET Web Pages Administration page

I'm not sure if it's the best place to ask this question. But it's conсerned aspютуе and iis and so i'll ask it.
I have web application hosted in iis (really it's tfs which i try to get up). Main page is normally opened with my windows credentials but if i go to admin page "server_name/tfs/_Admin" (to create project in project collection) I redirected to "server_name/tfs/_Admin/Login.cshtml?ReturnUrl=~%2f_admin" and get strange page (see screen).
What is the page and where is it in filesystem or why is it shown?
Seems the TFS site was messed by something that which escaped our monitoring. Seems it redirected to other site page.
You can try to back current TFS site files first ,then copy the site files from another normal machine which installed the same version of TFS, then overwrite current site files. Then try it again.
If that still not work, I'm afraid that you have to uninstall and reinstall the TFS to fix that.
In you case, I suggest you to Move or Clone Team Foundation Server from one hardware to another then upgrade the new server to 2017.

Deploying a Web Site project did not work

I was Working through Microsoft's example on Deploying a Web Site Project. As the example suggested, I used the tool to place the compiled website in a local directory, and then creating a virtual directory in IIS and pointing it to that directory. Then I converted the virtual directory to an application. I tried browsing to the local website (http://localhost/TestSite03/SamplePage.aspx) but got an error that it could not access the config file due to permissions. I read this post and decided that I should add IIS_IUSRS to the site. I did this by right clicking on TestSite03 in IIS Manager and choosing "Edit Permissions". After that it just stopped working. The browser would spin when I went to the site, and eventually display a 'page not available' page. Same thing when I go to http://localhost now also. I tried removing the application, but localhost is still not working. I did look at other values while I was trying to get the TestSite03 working, but I don't think I made any other changes. Anyone know what I might have done wrong here?
Things I tried for localhost not working:
Reordering the default page configuration.
Restoring the default page order to inherited value.
Adding a default.htm page.
Making the directory browsable.
Restarting the Default Web Site
Rebooting the computer
Checking permissions
-
Possibly Relevant info:
Windows 10,
Visual Studio 2013
.Net Framework 3.5 used for the test site
Chrome and edge browsers.

IIS Windows Authentication does not work with Webmatrix / Razor CSHTML

I need to use IIS Windows Authentication instead of Anonymous so that I can get the visitors username. The server and all the pages are on a local domain and all visitors are logged into the domain. The problem I am having is that Windows Authentication does not work with Webmatrix pages.
On IIS we just have one site and there are various pages and sections. Some are ASPX and now we also started creating CSHTML with Webmatrix/Razor. When enabling Windows Authentication and disabling Anonymous, any page that you try to load (ASPX, CSHTML, etc...) automatically redirects to /Account/Login?ReturnUrl= which does not exist and results in a 404 error.
I don't know why this happens.
Windows Authentication worked fine before the Webmatrix files were added.
I have tried numerous suggestions and nothing has resolved the issue.
I found several posts online saying that there maybe a bug in Webmatrix and that the WebMatrix.Data.dll and WebMatrix.WebData.dll are causing the issue. So just as a test I deleted these files from the Bin folder and right away the ASPX files started to load fine and authentication worked OK. Problem is that without these DLL's none of the CSHTML pages work which is what we really need.
Is there a fix for this? Removing the DLL's I mentioned is not an option for us since it breaks the most import functions which is querying and displaying data from SQL but at the same time I really need Windows Authentication to work with Webmatrix and CSHTML because we need to know who is using the pages and its impossible when IIS is running in Anonymous mode.

Resources