Help with setting up the development environment

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/13/2011 11:16:14 PM
Gravatar
Total Posts 137
When enough isn't

Help with setting up the development environment

Hi
I'm successfully running 5 MojoPortal sites as hosted solutions. They run .net 4 on IIS7 using MySql. I do not work with the source files, but I do a lot of custom pages and custom modules.

Due to increasing traffic I can not let my production environment run in debug mode any more as it will decrease performance and occasionally introduce breaks for users on the sites.

Now I have copied all my MojoPortal files from the production host to a folder on my local pc to create a development environment there, where I can change my local web.config file to allow debug. I'm still connecting to the hosted MySql production database, but I could as well make a hosted copy as a development database and change my connection strings if needed.

Ready to go I open my local web site with Microsoft Visual Web Developer Express 2010 and test a new local page clicking "View in browser".Next what happens is:

- The browser opens and it tries to connect to: http://localhost:number/localwebsitefolder/localpage.aspx
- And then (probably controlled by the Mojoportal database) it redirects to http://www.mysite.dk/localwebsitefolder/localpage.aspx

I get two questions in my mind, which I don't know how to answer:
1. How can I make it stay on the localhost? I have heard of things like virtual directory and local IIS ... is that a way to go ... and how? Or will the Visual Web Developer be ok to handle the issue with the right kind of settings?
2. Do I have to make further changes to my local web.config file and to the site data in a hosted development copy of the MySql database to make it work?

I hope you can guide me in the right direction, please.

Thanks a lot,
Lars
Denmark
 

1/14/2011 6:50:56 AM
Gravatar
Total Posts 9

Re: Help with setting up the development environment

It sounds like you have set up your production site to force 'www'.   Since your development site is using the production database, it's forcing your development site to redirect to your production site.

I'd make a local copy of the database, change your config strings to point to that.  Then, you still need to stop the redirection to your production server - I believe this setting is stored in the 'mp_Sites' table, in the 'ApikeyExtra5' field.  Just clear that field.

The redirection is also stored in web.config, search for <add key="AllowForcingPreferredHostName" value="true"/> and  set it to false.

(You might be able to just set "AllowForcingPreferredHostName" to false and leave the database alone - I've never tried that...)

Jim

1/14/2011 7:43:19 AM
Gravatar
Total Posts 137
When enough isn't

Re: Help with setting up the development environment

Thanks, spot on smiley.

I am using forced redirect to www. But it can be solved as you suggest with "AllowForcingPreferredHostName" set to false in web.config and user.config.

So now I'm up running and so so happy ...

I think for safety I will also work on a copy of the production database.

Thanks a lot Jim

You must sign in to post in the forums. This thread is closed to new posts.