how to view the site after deploying it - asp.net

This might be a really stupid question and make you guys laugh. I've deployed my whole website using the copy website tool to my FTP server, but then how do I go and visit the site that I just deployed?
The domain name is: H204716.dreamsparkhosting.com however when I navigate there through my browser it says
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

What is the file name of your default page? Its possible that if it's odd enough (ie, not home.html or default.aspx or index.html etc.) that the site doesn't know what page to load.
Have you tried
http://H204716.dreamsparkhosting.com/myDefaultPageName.html?

You may also want to log into your DreamHost account and explicitly set the default page for your website. That way your users can just type in http://yourdomain.com/ as opposed to ...yourdomain.com/i-know-the-defaultpagename.aspx

Related

How to block access to directory listing and certain pages in asp.net?

I have several issues with how I am configuring my web.config due to my inexperience.
I want to set a page, login.aspx, as my default page. If the user logs in successfully, he will be redirected to a page in a protected folder /Protect/Edit.aspx . All users can still access a page in root folder named Show.aspx, will be redirected to login.aspx if they try to click or write the path to Edit.aspx, and I am unsure on how to do this.
My other problem is that if I write just localhost it shows me the directory listing, and I want to avoid this, but setting
still gives me the directory listing. What am I doing wrong?
You need to implement forms authentification for your app. Here is a tutorial
Seems like you don't have a default.aspx page, so IIS couldn't find any document to load first. You can either configure IIS to use Show.aspx as a default page, or just add default .aspx.

"401 Unauthorized" on a directory

I assume this is an IIS error, as this doesn't happen if I run the project on my local machine.
I have my stylesheets at ~/Content/css
Any files in that directory won't load on the page, and when I navigate to them directly, I get a server error:
401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.
This only happens with that directory, I have no problem accessing any other files. Is there something I need to do in IIS7 to stop this?
Open IIS and select site that is causing 401
Select Authentication property in IIS Header
Select Anonymous Authentication
Right click on it, select Edit and choose Application pool identity
Restart site and it should work
It is likely that you do not have the IUSR_computername permission on that folder. I've just had a quick scan and it looks like you will find the information you need here.
If that isn't the case, are you prompted for your username and password by the browser? If so it may be that IIS is configured to use Integrated authentication only, as described here.
Open IIS
select site where you are facing the problem
Select Below
- Right click on Anonymous Authentication and click on edit and follow below
You do not have permision to view this directory or page using the credentials that you supplied.
This happened despite the fact the user is already authenticated via Active Directory.
There can be many causes to Access Denied error, but if you think you’ve already configured everything correctly from your web application, there might be a little detail that’s forgotten. Make sure you give the proper permission to Authenticated Users to access your web application directory.
Here are the steps I took to solve this issue.
Right-click on the directory where the web application is stored and select Properties and click on Security tab.
Click on Click on Edit…, then Add… button. Type in Authenticated Users in the Enter the object names to select., then Add button. Type in Authenticated Users in the Enter the object names to select.
Click OK and you should see Authenticated Users as one of the user names. Give proper permissions on the Permissions for Authenticated Users box on the lower end if they’re not checked already.
Click OK twice to close the dialog box. It should take effect immediately, but if you want to be sure, you can restart IIS for your web application.
Refresh your browser and it should display the web page now.
Hope this helps!
You need to check the folder permissions on your server and check that the account that you are using to run your application has access to that folder.
For me the Anonymous User access was fine at the server level, but varied at just one of my "virtual" folders.
Took me quite a bit of foundering about and then some help from a colleague to learn that IIS has "authentication" settings at the virtual folder level too - hopefully this helps someone else with my predicament.
In our case it was Windows-integrated authentication specified in the app's web.config
BUT the windows-auth module was not installed on the IIS machine at all.
Just adding another possible reason.
Another simple fix I found was to delete the local IIS site (from within IIS Manager) and then re-create the virtual directory from the "Properties" of your web project in Visual Studio.

How to set default page of ASP.NET website

I need some help, I have purchased a domain and I am using visual studio to publish the website via FTP. It publishes successfully but when I go into the website I get the Directory Listing Denied error, and I am assuming that this is due to the fact that there is no home page because when I go the address and append /Page.aspx to the address it works fine.
Is there any way that I could set the default page for the website I am publishing to point to the default page?
Please help.
Thanks in advance.
Easy answer: rename your default page to Default.aspx.
Or, if you have access to IIS configuration settings, you can specify the default documents.
YOU need to spesify what page you want to use as your default based on the iis Default Document
You should have access to a ISP control panel where you can specify the default page.
They are usually the same pages in most ISPs:
Default.aspx
Index.aspx

How can I set the default page for https requests?

We have a website which has a Virtual Directory containing the secure portion of the website.
If users come to http://www.mydomain.com, they should get directed to default.aspx of the main site, but if they go to https://www.mydomain.com, they should go to default.aspx of the virtual directory.
The default page for the main site works fine, as does the secure page if I navigate to it using the full name, however I can't figure out how to set the default page for https traffic that doesn't specify a specific page.
http://www.mydomain.com - Works
https://www.mydomain.com - Page Not Found
https://www.mydomain.com/myvirtualdirectory - Page Not Found
https://www.mydomain.com/myvirtualdirectory/default.aspx - Works
What do I need to do to make links 2 and 3 load the default page show in 4?
My website is running on IIS 6.0 in Windows Server 2003
Overall, this is an anti-pattern as you state the entire behavior of the site changes based on the port. I am not stating definitively you are doing this, but consider the following:
If you are redirecting due to a user needing to see other things, you can make conditional controls that display only when in HTTPS. The same can be done for authenticated and authorized versus not.
If you are redirecting because an HTTP user needs to log in, the more consistent pattern is to have them click a log in button. And, you can force HTTPS at this point without breaking the pattern.
If you really need to redirect for some reason, there are a couple of ways of handling this:
In IIS
HTTP Handlers
URL Rewrite - requires the URL Rewrite bits for IIS 7
I imagine there are some other ways to solve this.
I finally figured out my issue. In my case, it turns out the problem was an old URL Rewrite rule I wasn't aware of that was transferring all https traffic that didn't have a file name specified to index.php, which of course didn't exist.
I found this out by viewing the IIS error logs, which was telling me the 404 was being caused by index.php

Credentials prompt for an aspx page configured for anonymous authentication

From Flex we call a Upload.aspx page which is configured for anonymous authentication. Most of the time, it works like a charm, but once in a while, the browser does prompt a enter credentials popup...
The whole site is configured for Windows Authentication, but some pages and folders are set to use anonymous authentication. This is done using the location tag in web.config.
What could be the reason for this?
UPDATE:
Only happening in Internet Explorer... they should deport it.
If you use FireFox with FireBug, open up the Net panel, it will show you the request making the permissions request. If you cancel it, it will show an access denied in red, and that will easily help you hunt the issue down.
Maybe it's because a file (image, css, etc.) is being referenced that doesn't exist?
A couple of things I would check out:
Are there any images/other files that are added to your page using the FQDN? If so, are any of these pointing to an external site or staging site that might require credentials?
Is it possible that someone has removed permissions from the application pool credentials on the web server for some specific file or files the site is requesting?
Is the site load balanced or part of a farm? It could be that one or many servers are configured incorrectly, and the rest are ok. Then if by chance you hit the bad servers, you could get the prompt.

Resources