Image files not found for installation on local IIS in Windows 7

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
2/9/2010 2:43:53 PM
Gravatar
Total Posts 3

Image files not found for installation on local IIS in Windows 7

My webhoster changed my domain to a new server with IIS 7, Windows 2008 and MS SqlServer (previously MS SqlServer Express was used on the old server).

As the site gave an error I decided to upgrade to the newest mojoPortal version (2.3.3.4b - mssql, deployment files).

This still gave errors so I decided to do a test installation on my own Windows 7 machine.

First a made a virtual directory manually with IIS Manager. MojoPortal did not run because of security problems.

So next I created a virtual directory by creating a new web project with VisualStudio 2008. I deleted all files in this virtual directory and copied the mojoPortal 2.3.3.4b-mssql installation files to it. I also copied all styling an image files of my old site to the correct places under the Data directory.

The virtual directory is:  C:\Users\Johan\Documents\Visual Studio 2008\Projects\mojoTest\mojoTest

The application still gave security errors. Someone on internet suggested to change the Identity of the ApplicationPool to NetworkServer (in Windows 7 the default Identity is AppPoolIdentity!). Now finally the application was able to get running and executed the setup/default.aspx file succesfully.

My original styling was in place, but no images were displayed. I have all my images in the following directory under the new virtual directory:

C:\Users\Johan\Documents\Visual Studio 2008\Projects\mojoTest\mojoTest\Data\Sites\1\Images\

I discovered that mojoPortal looks for the images in the following directory:

C:\inetpub\wwwroot\Data\Sites\1\Images  (of course this directory did not exist).

After creating this directory and copying all images to it, all worked fine!

If I now upload a new image as an admin of my local site, it is placed in the expected folder under the virtual directory. But it is not displayed on a page because mojoPortal looks for it in the wrong place in the images folder under inetpub\wwwroot.

Of course I can manully copy new images to the mentioned images folder, but this behavior is so strange that I want to fix it. Does anybody have the same experience and more important, does anyone have some advice to get this fixed?

I am using Ms SqlServer 2005 Express on my local machine.

Thanks in advance for any help,

 

Johan Stringer

 

2/10/2010 4:26:23 AM
Gravatar
Total Posts 18439

Re: Image files not found for installation on local IIS in Windows 7

Hi Johan,

It is a very simple matter. If you want to run a copy of your production site on your local dev machine, you must use the same url structure in the dev environment as you have on production. If it is a root level site on production it needs to be a root level site on your dev/test environment. If it is running in a virtual directory on production then it must run in a virtual directory with the same name on a dev/test environment.

So for example when I run a copy of www.mojoportal.com on my local machine I have to run it as http://localhost/ I cannot install it as http://localhost/mojoportal and expect it to work correctly with content that was created on production.

When I create content with images here on mojoportal.com the image gets a relative url like src=/Data/Sites/1/somefolder/someimage.png

The thing you need to understand about a relative url is that it is relative to the root of the site not the root of the virtual directory. So for example if I setup my site at http://localhost/mojoportal/ and then I add an image to the content, it will have a relative url like src=/mojoportal/Data/Sites/1/somefolder/someimage.png, again it is relative to the root of the site not the root of the virtual directory.

So in your case http://localhost/ points to inetpub\wwwroot, therefore a relative url for an image that was entered into the content on production is going to have an url like src=/Data/... and naturally that resolve to the root of the web site and a folder named /Data.

mojoPortal can run happily as a root site or as a virtual directory site, but once you start adding content you cannot go back and forth without breaking urls in your content. It is just how urls work.

Hope it helps,

Joe

3/6/2010 5:45:17 AM
Gravatar
Total Posts 8

Re: Image files not found for installation on local IIS in Windows 7

Hi Joe,

Thanks for your clear explanation.

Actually the production site is installed in a subdomain :   home.tfodotnet.nl
(on the production server, the home directory is a subdirectory inside the root directory).

I always use subdomains to install mojoPortal in production situations. If I install in the root, the mojoPortal web.config in the root makes it impossible to install other webapplications inside the root of the domain.

How do I simulate a subdomain on my developer PC? Your explanation sounds as if the behaviour of an installation in a subdomain works the same as an installation in the root of a website.

Of course I want to be able to install multiple webapplications in the IIS of my developer machine. I see two possibilities, but I don't know how to implement them:

1. Use subdomains under the default website of my developer PC.  Can this be done? If so, how?

2. Create multiple websites on my developer PC.  If I try to add a new website, I must enter a domain name, and an IP address. Is there some trick to add new websites without acquiring extra domains for this purpose?

 

Greetings,

Johan Stringer

3/6/2010 6:06:42 AM
Gravatar
Total Posts 18439

Re: Image files not found for installation on local IIS in Windows 7

Hi Johan,

What you are calling a sub domain is what I call a host name, it is a root level site. www.somedomain.com is a host name just as foo.somedomain.com is a host name, they are both root web sites so you can either run them directly at http://localhost/  (localhost is also a host name) and change that to point to whichever site you are working on at the time (that is what I do) or you could possibly create additional Web Sites in IIS. You can easily do it without acquiring extra domains, you really can't use a domain on a dev machine unless it has a public facing ip address, but you can easily spoof any host name on your local machine. I recently made this screen cast about hosting multiple sites using host names and how to test it on your local machine, I think this will help you:

http://www.mojoportal.com/video-hosting-multiple-sites-based-on-host-name.aspx

Best,

Joe

3/6/2010 11:08:50 AM
Gravatar
Total Posts 8

Re: Image files not found for installation on local IIS in Windows 7

Hi Joe,

Thanks a lot! spoofing via the hosts file works fine for me.

The developer version of the production now correctly finds its images in the virtual directory.

Johan Stringer

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