403 - forbidden error when add class library to WCF web role on Azure Project - wcf

Open VS as admin, I create a solution, add new Cloud Azure Project then pick WCF service web role and then run it, everything is fine, I could access default services through browser nicely, however, when add new blank class library as new DAL project to the solution and run it, I have 403 error says "You do not have permission to view this directory or page using the credentials that you supplied."
what is going wrong?
thanks
P.S (with or without adding EMDX with proper db access to class lib, it came out something)

I tried to answer here https://stackoverflow.com/a/9411719/182371:
As for the Access Denied error:
it could be just an IIS default setting to disable browsing. To resolve that, just navigate to that web site in IIS, find Directory
Browsing icon, and press Enable. You will at least see the files
inside that directory.
Also try not only 127.0.0.1:81, buta specific document inside that folder, like 127.0.0.1:81/Default.aspx
Take into account the fact that there's sometimes some mess with the ports. You see that in the error message it's port 82, but in your
browser it's port 81. So make sure you're using the right port. Or,
even better, in your service definition try to use some non-standard
port for this to avoid remapping.

Related

MAMP PRO: The 'Path' to your remote document root is incorrect. but is not true - all files are there

The problem is incorrect path to remote host, but is not true. I have acces to my server via ftp without problems. All WP files are there and the site is working fine (frontend/backent). I have also access to phpMyAdmin to MySQL datepase binded to this site.
I have notce that paht to the web files is differ depend on FTP or SFTP is. In FTP app is such stright:
/[all wp files]
in editor app (such TextWrangler), after the samy access id/pass, I have got such path:
/home/[accountname]/public_html/[all wp files]
After click on detect button, app changing the path filed on:
- blanc - under FTP connection
or
- public_html - under SFTP
so it mean conection between MAMP and my server is working. Fine. But after this when I trying to Check URLs & credentials or when I trying Import Host... I received:
Error code: -3010 (The 'Path' to your remote document root is incorrect. The 'Path' field on the remote tab is the document root of your remote site that will be accessed via your Public Site URL (e.g.: 'public_html').) - Start auto detect not solved the problem.
or
Error code: -3113 (The 'Path' to your remote document root is incorrect. The 'Path' field on the remote tab is the document root of your remote site that will be accessed via your Public Site URL (e.g.: 'public_html').)
But it is not true! All files are there!
Please help. Should I use some special code under Apache tab (Additional parameters for VirtualHost directive or Directory directive?
Should I know something more from my serverprovider (home.pl) and solved this problem with them (there is no, in my subscription plan, access via cPanel or so, to set up something)?
Should I change something in https.conf file?
I'm not so using server coding so please forgive me but I have no idea where is the problem (but I'm trying to learn) :o)
My environment is:
MacOS X: 10.13.6
MAMP Pro: 5.2.2 (17923)
Thanx for any help or redirection to the answers someware else (I used searching ;o) but without success or I used wrong ask).
Just ran into this and found a solution that worked for me. I just had to switch the Public URL from https to http and it worked.
I had this error too.
Here's what I did to fix it:
Logged into my remote CPanel account
Created an FTP account for user#sitename.com
Defined the user directory in the FTP user settings similar to this /home/[site]/public_html
Ensured that this user had read/write permissions on the remote server (otherwise importing a site in MAMP Pro might fail)
Then, in MAMP Pro (v 6.0.1) created a new host following these steps:
https://documentation.mamp.info/en/MAMP-PRO-Mac/Create-a-new-host/Import/
I found that once the correct FTP permissions were set at the server, MAMP was OK and functioned as planned.
Good luck, hope this works for you too.

Virtual Directory to navigate to http://localhost/MyWebsite instead of http://localhost:8080

I have deployed an ASP.NET MVC 4 application to a new site I have created in IIS 7.5, which I have bound to port 8080. I can reach it by navigating to http://localhost:8080, but I want to reach it via http://localhost/MyWebsite.
I have added a Virtual Directory under my website, which points to "C:\inetput\wwwroot\MyWebsite\". However, when I navigate to http://localhost/MyWebsite, I am presented with a configuration error:
"It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS."
Here is what my IIS hierarchy looks like (this is a demo since I have no internet access on the server I am working on).
I have two questions:
Why am I getting this error?
Is this the best way to go about achieving what I want? It seems messy to have the list of files and folders underneath the website and then again underneath the Virtual Directory. If there is better practice then please tell!
Virtual Directories cannot execute scripts, reason why you are getting that error. You need to make your MyWebsite folder an Application. Also, you don't necessarily have to create a separate website for your website, you can use the Default Web Site and create an application MyWebsite in there (it might be less confusing maybe?).

PUT and DELETE getting 404 in WCF REST service .net 4 when running in IIS 6.0

I've added the wildcard application mapping for c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll and unchecked the "verify that file exist" checkbox. This gives me GET and POST ability but not PUT and DELETE.
I have both prohibited and allowed WebDav under the web service extensions.
Application works like a champ when running in development environment. PUT and DELETE don't work when running app in IIS.
Any help is appreciated.
Have you defined the extra verbs in the ISAPI extension that is linked to WCF? To do this, open up IIS and edit the properties of the website. From their click on the Home Directory tab, and then the configuration button. In the mappings tab find the appropriate extensions, and double click it. In the new window you will find a field called "Limit To" which should have the HTTP Verbs you wish to use defined.
Old Question but worth a potential solution:
Check you don't have http://www.iis.net/downloads/microsoft/urlscan installed, by default it disallows PUT and DELETE amongst other verbs.

404.0 error on remote web service, but not local on IIS

I have a web service I have written and am trying to publish to a production server. The strange thing is, when I pushed it on the server and set up a virtual folder for the service, it doesn't want to work when accessed from the Internet!
If I open up IIS 6 admin, look at the folder, right click on the .asmx file and select browse; it opens in Internet Explorer fine! If i change the URL to the public URL name, it works ok, but only on the server. If I try to access it from my desktop, I get a 404.0 error! I know the file is there, it works fine on localhost on the server!
I'm pulling my hair out! Any suggestions?
It was a stupid error on my part. When i deployed the web service, i put it in it's own folder on the server. I didn't check permissions on the folder though. When accessing it on localhost, my logged in user had administrative privileges and could see the file. Remotely, as anonymous, it couldn't. Once i matched permissions to what wwwroot had, it worked fine.
List item

Can't access any ASPX files on my new Win Server 2008 SP2 install, enabled folder permissions/added users but still no go

Just installed Windows Server 2008 SP2
Installed IIS, ASP.NET and other necessary roles.
For my site folder I edit the permission to include
users: Network Service and a bunch of other IIS user names
a long with that Internet guest one. Fiddled around with the
application pool (Load user profile:True , Identity Network Service etc.
Also only change I made from the default fresh install settings
was installing the .Net 4 framework.
I can view regular html files etc. But should I want to make use of ASP.NET and access an aspx page, I get the following:
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.
When running a settings test I get:
The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again.
Any ideas?
THanks..
I don't have an answer I know is the solution, but here are my suggestions:
First, have you mapped the IIS default web site to the folder containing your site?
Second, check your basic apppool settings, and make sure it's set to use .Net 2.0. It'll be 2.0 even if you're using a later version, like 4.0.
Barring that, make a new folder in wwwroot and map the default web site to that. Do not mess with the permissions. Then, make a new apppool, don't fiddle with it's settings, and assign that to the default web site. Point here is that you shouldn't have to mess with any of those settings: IIS will take care of that and the permissions.
Final thought, if that doesn't help: check your isapi filter mappings to make sure it knows what to do with .aspx. That should have been set up by default as well, but it's worth a look at that point.