Showing posts with label Web application. Show all posts
Showing posts with label Web application. Show all posts

20 June, 2018

Deploying a Web Application using IIS, HTTP Error 401.3 Solved

IIS 7's redesigned management console
IIS 7's redesigned management console (Photo credit: Wikipedia)
Deploying a web application using IIS in Windows was a problem for me after I have completed the task of developing the web app. Publishing it is easy following the File System or FTP method. And there are many articles that you can find on the web telling the same thing.

So why doesn't the web application run right away?

Here's my application structure:
The simple web application I created used bootstrap and CSS, and some jQuery and Javascript functions. It uses some database tables running in MSSQL Express. Now if I remember, I have set up my MSSQL Express to run on mixed authentication mode.

I checked my connectionstring values, and everything seems to be in place. In fact, I am able to perform web application deployment smoothly. Only that I get into an error when I click on a page that accesses the database. Even just querying data and no transactions yet.

I asked a fellow developer, and I was told to add in a logger. That is to help me identify what wrong thing could be happening that isn't normally seen or shown.

But I didn't do that. I am already so close and getting impatient. All static pages working, and only those dependent on the database have issues. I was near to pulling my hair!

But my patience took the better of me. I continued searching, and I found some more articles, randomly, which I tried one by one.

That fixed the issue, and I was able to run the web application if full spectrum.

Here's what I have done, and hopefully, it would help others, too.

1. The usual web application deployment methods, but in my case, File System.
2. In particular, I get HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL set on the requested resource.

Now remember, MSSQL Server was set up using mixed authentication mode, so I have sa account and also Windows account. The latter is the key. Windows account is not authorized, so database access fails.

What's the fix?

Open up IIS Manager (type 'inetmgr' in Cortana/search box).
Open up Sites, then click on the Web Site you are fixing.
In the middle pane, under IIS section, double-click on Authentication.
Right click on Anonymous Authentication, then select Edit.
Instead of Application pool identity, select now Specific user and specify IUSR (or IIS_IUSR).
(In some cases, selecting Application pool identity would do the trick.)
Click on Set and enter the credentials, if needed.
Then OK.

Now go back to the folder where the web site is deployed and give proper priveleges for the IUSR account. For my case, that is what fixed the problem. So I'm logging this discovery via my blog.

Anyway, if this doesn't work, it is 99.99% an issue of the account being used to access the database that is the cause, so just play around these settings. So much so if all static pages already work.

Hope it helps others, too.

Till then!

23 May, 2018

Enable the Design and Split Buttons in Visual Studio

23-May-2018

The ActiveReports designer as it appears in Vi...
The ActiveReports designer as it appears in Visual Studio, with important areas labeled. (Photo credit: Wikipedia)
Enable the design and split buttons in Visual Studio. That was something that I needed to do about a month ago as I was tasked to create a small web application, a submodule of a bigger application. But only source view is enabled and is the default.

So how to enable it?

2 ways:

First Way:
Click on File >  New > File
Choose General on the left pane, then HTML Page at the middle pane.
At the bottom right area of the New File dialog, click on the down-pointing arrow beside Open.
Click on Open With.
Select HTML (Web Forms) Editor, then on the right side, click Set as Default.
Click on OK.

No, that may not show the Design | Split | Source buttons yet. You need to restart Visual Studio first.

Second Way:
Click on Tools > Options > Web Forms Designer
Make sure box on Enable Web Forms designer is ticked.
Start pages in Source View, Design View, Split View, you choose that.
Click on OK.

Again, that may not show the Design | Split | Source buttons yet. You need to restart Visual Studio first.

Hopefully, one of these methods would enable the design and split buttons in your Visual Studio.

Till then!

04 May, 2013

ORA-12154: The other uncommon cause, and the solution

Image representing Oracle Corporation as depic...
Image via CrunchBase
ORA-12154: It is not always due to the listener down, or something...
-----


04-May-2013

2 weeks ago, while I was preparing my arsenal of personal computers (now 9, with 1 laptop and 8 desktops) at work, one requirement is to be able to synchronize the TNS file across all the 9 computers.

This would need me to have a read/write priv to the Ora folder in the 9 PCs, and so I opened it up for me by sharing the folders. This, in turn, closed the folder access to everybody else, because I shared the folder only to me – I removed access for Everybody/Everyone. The priv then was full control.

That began the issue of all users of the web apps running in these computers, where ORA-12154 is being thrown. I didn’t see it, and I could just imagine their shock that suddenly, the application doesn’t work properly. Until one of the customer service personnel came over to ask something, and just remembered to check with me why the web apps aren’t working.

Thinspiration - Weight Loss Method

I quickly checked, and I got ORA-12154. Since that same day I got to sync all the code files and accessory files in all of the computers, I didn’t know where to start at first. I gathered my wits, and thought of checking the particular web apps having problem. Problem was there. Half a day passed, and the problem persisted. Then I thought of verifying the web apps from my laptop. It was working! So I got even more confused, believing that it was the file transfer that I run which caused the problem.

A few more check here and there on the web apps having problem, and still no luck. I then started to check on the other web apps and Windows apps using the same files and libraries, and to my surprise, they are all working!

What now?

At this point, I knew I had to break away from the pressure, so I called up the Oracle DBA, and asked him about ORA-12154, and since I can’t do desktop sharing on any of the affected computers (yes, all having problem, actually, and on the same web apps), he came over. He checked a few items, and he is also stuck. Told him all that I‘ve done so far, and I said the other Web and Windows apps are running, to which he checked with me, “And these are running under your account?”

I said “Yes.”

At that queue, he checked the Ora folder, looked at the sharing setup, and opened it to “Everybody”.

That PC worked. After that, he went on his way, trusting me to be able to manage the rest.

So there you are. ORA-12154 error. It is not always that the listener at the server machine is down, or whatever. For my case, it was the access privilege that got screwed up. Anybody running the web apps that uses Oracle client must have access to the installation folder, at least “Read” access.

Hope this helps anybody there running into the same problem, but is not due to the listener down or not running.

Till then!
Enhanced by Zemanta