PDA

View Full Version : Default Login when using IIS



HankFay
2018-05-16, 13:05
In using the LCS by itself, there is an option to name the default page so that a URL like this:

http://mylcsapps.com

becomes effectively

http://mylcsapps.com/login.rsp

I am using IIS because I need SSL. I've tried a few things in IIS to make login.rsp the default page but without success.

So, I'm wondering whether this has been worked out by anyone.

thanks,

Hank

barrymavin
2018-05-16, 18:11
Hi Hank

Have you tried this:
https://blog.arvixe.com/how-to-set-the-default-page-in-web-config/

or setup a redirect.

https://support.microsoft.com/en-ca/help/324000/how-to-redirect-urls-to-different-web-sites

HankFay
2018-05-16, 20:55
Hi Barry,

I had already tried putting login.rsp in the inetpub/wwwroot directory and setting it as the default document (easily done in the IIS UI), as that directory is the root directory in IIS (after the LCS install).

thanks,

Hank

barrymavin
2018-05-16, 22:02
Hi Hank,

A simple solution would be to write a small default.asp page that just does a redirect to login.rsp and set that as your default page.



<%
Response.Redirect "login.rsp"
%>

HankFay
2018-05-16, 22:14
Hi Barry,

thanks: that look promising. But alas, no joy: 404 error. I confirmed that the file (I named it defaultlogin.asp to not conflict with the inherited default.asp) was properly declared in web.config.

thanks,

Hank

barrymavin
2018-05-16, 23:43
Hi Hank,

Try as described in this link:

https://stackoverflow.com/questions/10949592/set-up-301-redirects-from-old-classic-asp-pages-to-new-asp-net-webforms-pages

HankFay
2018-05-17, 14:21
Hi Barry,

No joy there either.

I'll keep playing around with it as I have time. It's not a need, just a desire that whether using the LCS or IIS that the same URL could be used.

At my present rate of progress, LCS V6 with SSL will be out before I succeed. <s>

thanks,

Hank

barrymavin
2018-05-17, 19:02
Hi Hank,

Ok, try this.
https://stackoverflow.com/questions/16522057/how-to-set-web-config-default-page-for-php-index-file

but specifying login.rsp

HankFay
2018-05-18, 01:41
Hi Barry,

Perhaps the <clear /> will help. The rest I've done.

Note that the login.rsp will be in the default web directory (inetpub/wwwroot), as that remains unchanged in the Lianja setup for IIS.

thanks,

Hank

HankFay
2018-05-18, 01:56
Hi Barry,

nope: the default setting is working (tested by having it hit another file), but when I set it to login.rsp, still getting a 404 not found error.

thanks,

Hank

barrymavin
2018-05-19, 01:32
What have you set the Lianja wwwroot directory to?

https://www.lianja.com/doc/index.php/Lianja_Server_Manager_on_Windows

You can enable debugging by setting DB_WWWDEBUG to ON in the registry. This will create a firecat_debug_xxxx.txt file which may help you see what’s going on.

OTOH if you can point to the login.rsp and it runs the issue is not Lianja it’s IIS redirection not behaving as expected.

HankFay
2018-05-19, 02:24
Hi Barry,

The Lianja Server Manager http settings are correct.

What should the default directory for the IIS Site be? I see no mention of changing it from its default in the IIS setup instructions. Yet that's where the redirect stuff goes.

thanks,

Hank

barrymavin
2018-05-19, 04:24
Hi Hank,

The ISAPI extension filters requests and if there are any for Lianja Cloud Server it processes them.
https://www.lianja.com/doc/index.php/ISAPI_Extension_for_IIS

The requests are proxied to the cloud server listening on port 8001.

From there on it uses its normal settings.

Any file extensions it cannot handle e.g .aspx are rejected and IIS continues passing the requests down to other extensions until one is found that handles that file extension.

As I asked previously, if you can access login.rsp when it is specified in the URL then IIS is properly configured.

The redirection is is an internal IIS configuration issue only to do with changing the default home page.

If you followed the PHP configuration I posted earlier then it should work exactly the same.

HankFay
2018-05-19, 13:16
Hi Barry,

yes, I can log in with login.rsp when it is specified in the URL. Sorry if I didn't mention that.

When I specify login.rsp, I get a

403 - Forbidden: Access is denied.

You do not have permission to view this directory or page using the credentials that you supplied.


I hadn't noticed this previously. This is actually closer than I got before. <s>

Hank

Here's a more detailed error:

HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Detailed Error Information
Module DirectoryListingModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x00000000
Requested URL https://devcloud.dataworksinc.com:443/
Physical Path C:\inetpub\wwwroot
Logon Method Anonymous
Logon User Anonymous
Failed Request Tracing Log Directory C:\inetpub\logs\FailedReqLogFiles

Based on some research, I set DefaultAppPool to have rights to the Lianja\cloudserver directory (overkill: I figured I'd see if less worked later, once it worked) using this article (since it's not straight-forward): https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities Step 7 is the key. But, no joy.

And yes, both web.configs, for the itnetpub/wwwroot and ...public/wwwroot under cloud server, have a default document specified:



...
<defaultDocument>
<files>
<clear />
<add value="login.rsp" />
</files>
</defaultDocument>
</system.webServer>

barrymavin
2018-05-19, 20:37
Try specifying a non existent login.html file instead of login.rsp.

if you get the same error then place an empty login.html file in the IIS document root.

If that works, specify login.rsp again and rename the login.html empty file as login.rsp.

IIS May be possibly looking to see if login.rsp exists before redirecting.

You May want to look at the log file as detailed in your previous post.

HankFay
2018-05-19, 23:23
Hi Barry,

1) specifying non-existent login.html: same error
2) empty login.html, default set to login.html. Result: empty page.
2) empy login.rsp, default set to login.rsp. Result:

HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Module StaticFileModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x80070032
Requested URL https://devcloud.dataworksinc.com:443/login.rsp
Physical Path C:\inetpub\wwwroot\login.rsp
Logon Method Anonymous
Logon User Anonymous



I had to switch tracing on, and so went back to using default of login.rsp without that file in the home directory. I created a rule for 403.14. Restarted IIS, hit the URL in the web browser, got the error, and no file appeared in the specified folder.

Enough for today...

Hank