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

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!

Related

Support with hosting an ASP.NET application from my PC at work using IIS Express

I'm fairly new to developing with ASP.NET and in general. I have created a simple data-driven web application that will be used to display images the colors of which will be changed depending on certain criteria. I used Visual Studio 2019 to create it. When I test/run it from within VS 2019 using the "play" button, it runs perfectly and the page opens in my browser just as you would expect.
My issue is that I'm trying to deploy it to the IIS and host it from my machine here at work, so others can access the pages. I have published the application to a local file on my C:\ drive. I then open up IIS Manager and create the website by pointing to that local file. Now, when I choose to browse that site from the IIS manager, at first I was getting an error saying that access is denied.
Then I followed the instructions to configure the security on that local file folder to allow IIS_USRS to access the file, but when I run it, I just get a page that tries to load indefinitely.
What am I doing wrong? If I point the IIS Manager to the files after saving them to a location on my company's network, I again get the access is denied error.
Do I understand it correctly that IIS needs permission to access the files? If so, how do I configure it that way other than what I already tried? If I need to provide further information, please let me know. Thanks so much for your support.

How to configure IIS 7 for localhost website?

I am new in Asp.Net
I have enabled features of IIS 7 on my windows system and able to see IIS manager.
I created an application but build/run application through visual studio it goes to browser and run the application with different port number. When i stop build/run application through visual studio and again i refresh browser application could not run.
I want to run application without visual studio. How to do this.
It gives this : http://localhost:9864/
To configure IIS with a new website follow these instructions:
Open IIS manager, right click Sites (At the right menu) and click Add Website
Give the site a Site Name, The physical path on your machine, and a Host Name
There are some conventions as for what website physical path to choose you can read about it in this SO question
In Windows Explorer go to C:\Windows\System32\drivers\etc and Edit the hosts file
Add this line at the end of the file:
127.0.0.1 your-chosen-host-name-from-iis-ie-localhost.testsite.com
And save the file
Thats about it. You can open your browser and browse the Host Name you chosen for your website or in IIS right click your site and click Manage Website - Browse
Important note
If you wish to use the same address as your VS uses (http://localhost:9864/) then on step 2 leave the Host Name textbox blank and instead change the Port textbox to your desired port (9864). In this case you can also ignore step 3.
As a site note:
If you installed IIS on your machine after the VS installation you might get some conflicts. You might be able by this stage to browse to static content as html but not .NET resources like aspx files. If by browsing to .NET files you get a message saying The page you are requesting cannot be served because of the extension configuration you can solve it with this SO question

Running Classic ASP site on IIS7.5

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.

ASP.NET webapplication deployment - with domain / server name access

I have deployed my ASP.NET web application on IIS (windows 2008 server). I have created a virtual directory (named TestApp) and all the users on local area network are accessing it with the following URL.
http://"SERVERNAME"/TestApp/Default.aspx
My client wants that, it should be accessed as following URL
http://"SERVERNAME"/Default.aspx
There is single application deployed on the server.
Could you let me know how can i implement this thing??
Instead of adding a virtual directory on the existing site, you need to add a new web site
Create a Web Site (IIS 7)
In fact, it's fairly simple.
Remove your current app, including all files and settings in IIS (i.e.: delete everything).
Run the deploy wizard again, BUT be carefull of the path that it's given to your application: by default, you should see "http://SERVERNAME/TestApp/". Remove "TestApp". The wizard will show you a warning message, just continue.
Finish the wizard as usual, and voila!
I did this 2 or 3 times yet.

ASP.NET and IIS 7.5 - HTTP Error 403.14 - Forbidden

I try to configure IIS 7.5 on a new server (Windows Server 2008 R2), in order to run an ASP.NET 4.0 application. Two "domains" are defined on the server (managed with Parallels Plesk), each one appearing as a site in IIS. One domain is for the public site, the other is used for tests. At the present time, the DNS of the test site points to that new server while the DNS of the public site still points to our old server. We transfer the test site first, to see if everything is OK, before transfering the public site to the new server.
Pointing to the test site in IIS, if I run the Browse command on the folder of the application, I get the HTTP Error 403.14, with the message: The Web server is configured to not list the contents of this directory. The strange thing is this: if I put the exact same folder structure in the other domain on the same server, and I run the same Browse command, I see the default page of the application (I don't know if everything works after that but, at least, the first page shows up as expected). I should add:
Both sites use the same application pool.
Both sites have the same permissions (I checked one by one, also compared with cacls)
The default page is not set in IIS but is the authentication form specified in Web.config
So, same setup but different results. I don't know if there is something else that I should check. I am on very shaky ground when I talk about server configuration and IIS; so I hope that this description is clear enough and makes sense.
I think I found it. It probably doesn't work for both sites on the new server. When I run the Browse command, it shows the page in IE using the DNS of the site. Since the DNS of the public site still points to the old server, the page displayed in IE is not from the folder that I clicked, but rather from the old server site.
I can now look for standard solutions to the 403.14 problem on the new server...

Resources