[SOLVED] Unable to login when installing CS to a subfolder

  • (   By mistake, I originally posted this in the Getting Started thread.  I am unable to move it / delete it, perhaps a moderator can delete itWink 

     Hello,

       I'm having this problem:  I used the webinstaller to install CS to www.mysite.com/cs . 

       I think many others are having this problem, and I spent hours searching these forums and trying various solutions, so I figured I'd post and see if we can get a difinitive resolution.

       I must run it as a subfolder so please don't suggest I run it from the root folder!  ;-)

       My forum is installed at the following locaiton if you want to check it out:  http://www.sendtoperson.com/cs/

     

    Details:

    CS is definitely talking to my database to perform the login.  I know my login and password.  If I enter it correctly then I end up at the home page, but the site still thinks I'm a guest.  If I enter an incorrect username / password combination CS tells me that my logon / pw are not correct.  Since there is different behavior between correct and incorrect passwords, I am confident CS is communicating with my database.  I think its a cookie problem or something.  All the pages of the site are there, blogs, forums etc. 

     Things I tried to do already:

    •  I made sure IIS recognizes my folder as an ASP.NET 2.0 application. (This is CS 2007)
    • Ran aspnet_regiis -c
    • Checked web config.
      • In parent asp.net folder, wrapped system.web with <location path="." inheritInChildApplications="false"> tag to block inheritance
      • Added machineKey tags to both parent and /cs web.config files, made sure they are both the same. Used onlinekey generator from another post on this forum.
    • Ran  iisreset to restart my webserver
    • Tried to login from Firefox and IE on 2 different computers
    • Tried to create a new user account.  Account gets created but then it thinks I'm a guest again
    • Checked cookies in firefox:
      • .CommunityServer cookie:  host: sendtoperson.com, path: /

    To me it seems like some sort of cookie problem.  I think somewhere I need to make sure that CS knows that it's in a subfolder but I haven't figured out how to do that yet.

     

    Please advise!

     

    Thank you!

     

    David Berman

     

    David J. Berman Executive Business Consultant Resources and advocacy for Entrepreneurial Ventures: DavidJBerman.com
  • Hi David,

    Should'nt the machine validation and decryption keys be different for each app ?

    Regards

    Dave

     

    Dave Stokes On Graffiti
    Dave Stokes

  • Hi Dave,

       Thanks for writing me back, I'm a big fan of your work ( http://davidjberman.com/blogs/cs21/archive/2006/10/19/Community-Server-Gurus.aspx Wink!  I don't really know about the machinekey thing, I thought I read they needed to be the same, but after reading your post I changed it so that the parent web app and the cs web app have different validation / decryption keys.  Still, the same problem persists.

       Any other ideas I could try?  It seems to be a cookie / security issue perhaps?  Yesterday I enrolled an account but then the new account was still on the site as GUEST after enrollment.  I can see under 'most active users' the name of the new user account; so database access isn't the problem and I know I have the right username / passwords.

        This is an 'out of the box' install really, I just downloaded the latest version a few days ago.


    David

     

    David J. Berman Executive Business Consultant Resources and advocacy for Entrepreneurial Ventures: DavidJBerman.com
  • Hi David,

    Thank you for those kind words. 

    I do know that getting CS to work in a sub folder of an existing .net application can be very problematic which is why we always recommend that it is installed at the root.  Have you tried experimenting with the cookie and anonymous settings in the membership section of the control panel.  Maybe setting the cookie domain value to may help.

    Let us know.

    Regards

    Dave

     

    Dave Stokes On Graffiti
    Dave Stokes

  • I know what you're thinking... It's probably user error.

     Well.. you'd be right.  *sigh*  BUT ITS FIXED.... YEEEAH BABY YEAAAH!  Smile

     This was the problem:

     When I originally was trying to get the site up in a sub folder I was having problems with my web.config file inheriting stuff from the app in the parent folder.  To try to resolve this I had put a CLEAR directive at the top of my http modules section of my web.config file.

    SO.... the lesson learned here is that setting up Community Server to run in a sub-folder is actually quite easy:

    A) Install CS using the web installer like you normally would, in a sub-folder like /CS

    B) Tell IIS that your web folder is an ASP.NET applications

    C) Follow the setup instructions for CS like you normally would, granting all the permissions to the right folders

    D) In your parent folders web.config file, wrap your <system.web> section with this location tag:  (don't forget to put the close tag after the </system.web> tag).

    <location path="." inheritInChildApplications="false">

    That stops the inheritance problem.

    That's it.  You don't need the machine key stuff for the typical install.

    Thanks for trying to help! 

     David

     

    David J. Berman Executive Business Consultant Resources and advocacy for Entrepreneurial Ventures: DavidJBerman.com