Path of image gets changed to localhost, even on production server, in Orchard CMS - orchardcms

Problem
I uploaded an image using the inbuilt tool and added it to a blog post. All this on the production server, across the pond in Montana, US.
It displays fine (using the correct absolute path it should: "/Media/Default/BlogPost/...") in the preview of the blog post. But once I publish it, I get a broken image in the live site. The reason being that the path renders as:
http://localhost:[port number]/Media/Default/BlogPost/...
Obviously, if running on a Dev machine, this will still work, but once on the live web server, this no longer works.
History
I downloaded WebMatrix onto my machine, downloaded orchard, installed the Minty theme, made a new theme that uses Minty as the BaseTheme. Then, once everything was almost there, uploaded onto the live web server.
I can't see how this can affect how the server interprets an absolute path, but maybe I am missing something?
Fudged solution
I can fudge a solution by using the URL of the site i.e. I open the image picker and in the URL for the image resource text box I put:
http://blogs.mysite.co.uk/Media/Default/BlogPost/...
With this full URL, the problem goes away, but it is a fudge and I shouldn't need to do this.
Any suggestions?

#gelistir from the Orchard discussion pages answered this.
It is caused by a module, the Vanderlay Relative URL Filter module. Disabling the module (that I wasn't using anyway, not even sure what it does...) solved the issue.

For whatever this is worth, more than 2 years have passed since the question was asked. Anyway, if the problem described here happens to you, on the dashboard go into Settings and under "General", set your base url to your "http://www.yourdomain.com", instead of to "http://localhost[portnumber]". This is where the Vanderlay module gets the url to rewrite from.
Regards,

Related

Kentico GetAzureFile.aspx badhashtext error

I've recently copied a Kentico 10 environment to a new development environment, and upgraded it to Kentico 12. I believe the problem occurred after the upgrade, not after the copy (of the site and database). The new environment is also using a different URL than the original, and I have a valid license key for the new URL.
The site functions correctly, except for images. Unfortunately, all media library images that are loaded using GetAzureFile.aspx are failing to load. Attempting to access one causes a redirect to
/CMSMessages/accessdenied.aspx?resstring=dialogs.badhashtext&hash=...
I assumed the problem might be a different CMSHashStringSalt in the new environment's web.config, but it is the same as that of the original environment.
Per this documentation, I have attempted to re-save some of the images to see if they would begin loading but that did not help.
Does anyone have any suggestions on how I might tackle this problem?
Thanks
I don't believe that GetAzureFile() is something you should be using "publically", I believe that's meant to be an internal handler. You should be using the permanent URLs for media libraries hooked up to external storage.
Also, your provider code could need to be updated. Check out the documentation.

Crafter CMS 3.0 - deleted status pages

After start Crafter CMS Authoring mode successfully, I create a new site as instructed at Crafter CMS Your First Website, but the results are not the same as the description of the tutorial, all pages have status "Deleted". See the screenshot here.
Please let me know what's wrong and how to solve it. Thanks.
It's difficult to know what the issue is here because there is no log file (link does not work) but I do notice on the image a couple of things:
Everything is showing a deleted status, typically if the item is NOT in the repository it does not show at all. The deleted status typically shows up on historical dashboards.
Everything is lower cased/filename rather than internal name from the file
Hieu:
Anything you can tell us like:
OS version
Java version
Steps you took / how to reproduce
Other servers running for anything else?
I believe the correct answer to this is that there is an error in the Windows binary. I tried installing on 3 different Windows machines and had the same issue as the original poster. Plus the OP stated that the Linux distribution worked for them. I hope the Crafter people will look at this and make the correction.

iis 10 Static Website: Deleting default site and creating completely new site (how to access new site)

This post needs help from experienced iis administrators, but must be explained in details for EXTREME newbies.
What I am doing:
I have two computers, both running Windows 10. One is a desktop and one is a laptop.
iis is enabled on both computers. Each computer can access the iis web server from the other and pull up a page from the other - using the ip address.
There is no DNS or host files being used (this is by ip address only), nor do I want to use any sort of naming.
Both computers are running an identical website, and the website files are in a different directory than the default. The structure is like this:
C:\inetpub\ROOT\myWebsite\myIndex.html
web.config
Changes I've made - now a few problems.
On both computers I have deleted the DefaultAppPool and the default website that comes installed with iis. This has not stopped the website from completely working, so adding that back seems unlikely to fix my problem.
I have deleted my application pool and website from iis (never deleting the actual files from the file system) several times, and added it several times. Each time I do this, my site comes back, but with the same problem I am having.
I have deleted all of the default documents, and the only default document listed in iis is myIndex.html.
myIndex.html initially displays a graphic image (using the standard tag), and this image comes up. Sort of. See explanation below.
The problem I am having
Before I started this project, I had iis working on the desktop with the default site and app pool and simply added some of my own files with really simple text content and some pics. I had replaced the default iis splash image with my own image, and all that worked with no problem.
the image that comes up is a link to another page that has a list of links to other stuff in my website. It all works no problem there.
Now, with the setup I have now, on the desktop I was originally using (in the paragraph above) if I pull up my website locally, myIndex.html loads in the browser and my image comes up, and everything works fine.
The same is true on the laptop, when I access the site locally.
However, if I attempt to access the desktop site (using its ip address) from the laptop, it pulls up the old splash image from the default site I deleted.( I left those files there even though I deleted the site from within iis). All those files are in the default location C:\inetpub\wwwroot.
If I move those files to another directory, thus leaving C:\inetpub\wwwroot completely empty, then when I access the site on the desktop (via the ip address) from the laptop, my new site comes up without a problem.
While it seems I may have solved my problem by moving the file from the previous project, doing that does not teach me how iis is actually working, and why files from a website that no longer exists in iis are still being accessed from remote computers.
So, please teach me something about the internal workings of iis, and how it chooses to access the different application pools and websites.
Again, please word your answers for complete newbies, because I know a little but not enough to get real technical.
I have been reading posts on stackexchange.com and other sites; links to microsoft docs etc. That's not helping as those docs are expecting too much prerequisite knowledge, and speaking in terms that are not really explaining things in a way I can understand.
You have described several different problems. I will try to address each of them (contrary to S/O recommendations).
First, when you make changes, and they don't seem to show up, it is usually because of caching. IIS always wants to cache files/configs. So does your web browser. So, to force an accurate test, you need to dump your browser cache and cycle IIS (to make sure it drops its cache and loads new files and configs). Start there.
Second, IIS is designed for settings inheritance. Which means, each app and each folder will inherit settings and permissions from the parent, unless you override them. Overriding them can be done by files and/or IIS configs (application vs folder). The IIS configs are the stronger of the two.
Also, the IIS config for "default files" might have come into-play for your test. If you didn't set up MyIndex.html as the top-most default file, then IIS would look for other files first. In fact, if you don't have MyIndex.html in the list of default files, IIS would have to depend on your app to choose that as a default page (MVC routing, etc).

SiteMapPath empty after upgrade to MVCSiteMap 4

I just attempted to update the site map provider from 3.3.6.0 to 4.0.14. I followed the instruction on the wiki however my SiteMapPath now renders empty. I made no changes to the mvc.sitemap file other than updating the schema to 4.0. When I debug into the SiteMapPathHelperModel I find that the model has no nodes defined. I am using the internal DI container (I would like to get this working before switching over to the application container).
When I check the sitemap.xml file it is well populated which makes me think that the mvc.sitemap is being read.
I'm out of ideas on this one and would be happy to provide any additional information which may be useful. I'm not even sure where I can hook into debug this problem. Literally the only thing I changed between a working 3.3.6.0 and a not working 4.0.14 was what was prescribed on the wiki.
Ok, since your /sitemap.xml endpoint appears to be working, you are correct the sitemap is being populated and loaded correctly.
There are a couple of things I know of that can cause this to happen:
If you are using Dynamic Node Providers, they must be added to a node that is not otherwise part of the sitemap. See my question here - I am trying to figure out why this is the case as well.
Your routes don't match your nodes - please read Routing Basics and/or post your routes and Mvc.sitemap XML.
If you check the above and everything appears to be correct, please make a small demo project showing a sample of your configuration and open an issue on GitHub, as it is highly likely your specific configuration has something to do with the problem.
BTW - You can debug by cloning the current repo on your system or downloading the solution as a zip, enabling NuGet package restore on your solution (right click the solution > Enable NuGet Package restore), add the MvcSiteMapProvider project to your solution, and then in your project remove the reference to MvcSiteMapProvider and add the reference to the newly added MvcSiteMapProvider project from your MVC project. Then you can add breakpoints and step through the code. I suggest making a backup of your solution (or ensure you can roll back another way) before doing this, and reverting back to your current state when done.
I have documented the whole procedure here: http://www.shiningtreasures.com/post/2013/08/21/debugging-an-mvcsitemapprovider-configuration

Drupal menu items and blog entries disappeared for anonymous users

I've been struggling with a problem now for a few hour and I cannot find any answers or anyone with the same problem -
Some menu items are missing on my site www.namhost.com (Drupal 6.22) and when viewing the blog it shows "No blog entries have been created". When I log in as admin everything works fine, so this problem only occurs for anonymous/guest users.
I've changed nothing on the site which may have caused this problem and here comes the really strange part - When viewing a copy of the site locally everything works 100% even for anonymous/guest users.
I've tried:
flushing caches
rebuilding permissions
checked if the "anonymous" user is present in the database
viewing on different browsers
None of these yielded any results.
Because the problem doesn't occur locally I'm starting to believe this could be a problem on the server the site is hosted on (Linux with PHP5.2), but the admins had a look and couldn't find anything.
Any help/insight would be highly appreciated.
================FIXED<<<<<<<-----------------------------
I am not allowed to answer my own question and it was suggested that I edit the question to include my answer so here goes:
Firstly, thanks for all the responses.
I disabled the "ACL" module (http://drupal.org/project/acl) and the problem was solved. It was previously used for our forum which was also disabled a few months back, so it's not needed any more.
I still have no idea why this module caused the site to work locally but not on the server. I will be in contact with the server admins to find out if they changed/updated anything on the server which may have caused this module to cause a malfunction.
Any insight could still be helpful top prevent this from happening again.
Check your Drupal config:
Are you using node_access, content_access, or any other permissions-related addon mods? Disable them and see if the problem persists. If that doesn't work, disable all non-core mods and re-enable them one-at-a-time until you find the offender.
Compare your hosting configs:
If it's not related to Drupal, compare the local and remote server configurations. Do both use the same versions of php, apache, apc, cgi, etc.? A phpinfo(); on both servers should give you the most important details for comparison. Do a similar comparison of the MySQL setup and content. Finally, check for differences in your .htaccess files (if any) between the two locations.
Test another hosting enviornment:
Download a virtual appliance like QuickStart which is already configured to host Drupal sites for development and non-production purposes, and see if the site works correctly in that. If it does, you could do an additional validation by porting to a new host who offers a trial/money-back-guarantee and see if it works correctly there.
If your site works fine elsewhere, give your current host a good thrashing for making you go through all of this to figure out the problem lies on their end.

Resources