Mura

From Hostek.com Wiki
Jump to: navigation, search

Introduction

Here you'll find a compilation of issues or tips related to the Mura content management system.

To fix many Mura issues, upgrading Mura itself may be your best solution. Find more on that below.


Upgrading Mura

If your ColdFusion site runs Mura CMS, you should ensure it's "Core Files" are always up-to-date. This is easy to do from the Mura Admin section and will help improve performance and security. Follow the directions below to update your Mura Core Files:

Update/Upgrade Mura by running the auto-aupdate feature from your admin section:

  • Click the Settings link at the very top of the Mura admin page.
  • Click Update Mura Core in the dropdown menu that appears
  • In the popup that appears, click Yes to proceed with the automatic upgrade.

Mura will confirm when the update completes. Please note, this will not update your site files.

For more info on this topic, see the Mura Best Practices Guide.

Editing Mura SEO SEF URLs - Overview

How to enable different SEO/SEF URL settings for Mura

The URLs used by Mura are controlled by two settings in the configuration file /config/settings.ini.cfm:

siteidinurls=0
indexfileinurls=0

A settings of '0' disables the option, and a setting of '1' enables the option.

siteidinurls

This option tells Mura to put the siteid in the URLs for links. Enable this option if you would like the name of the site to appear in the URL. Otherwise, disable it.

indexfileinurls

This option controls whether Mura puts index.cfm in the URLs for links. Enable this option if you want index.cfm to appear in the URL or do not want to use URL rewriting. Disable this option if you would like to use URL rewriting or do not want index.cfm shown in the URL.


Site ID and index.cfm in URLs

This option is easy to enable. Simply configure both URL settings in the /config/settings.ini.cfm as follows:

siteidinurls=1
indexfileinurls=1


Remove Site ID and index.cfm from URLs

This is the most common SEO/SEF setting. Configure both URL settings in the /config/settings.ini.cfm as follows:

siteidinurls=0
indexfileinurls=0

Then, do one of the following:

IIS 6:

Rename the file htaccess.txt to .htaccess.


IIS 7+:

Rename the file web.config.txt to web.config.

Remove Site ID from URLs but include index.cfm in URLs

This option is easy to enable. Simply configure both URL settings in the /config/settings.ini.cfm as follows:

siteidinurls=0
indexfileinurls=1


Include Site IDs in URLs but remove index.cfm from URLs

Configure both URL settings in the /config/settings.ini.cfm as follows:

siteidinurls=1
indexfileinurls=0

Then, do one of the following:

IIS 6:

Rename the file htaccess.txt to .htaccess. Then, edit the .htaccess file and follow the instructions in the file for enabling SiteIDs in URLs.


IIS 7+:

Rename the file web.config.txt to web.config. Then, edit the .htaccess file and follow the instructions in the file for enabling SiteIDs in URLs.


Mura Problems and Solutions

Fixing Mura links with Hyphens in the URL

When enabling SEO-friendly URLs, sometimes you run into pages that need multiple words in the URL. This requires the use of a hyphen, which often breaks Mura's redirection system. Below is an overview on the problem.

Overview

Example situation:

http://www.example.com/ has a few pages on their Mura site that look like this:
http://www.example.com/mura-page
http://www.example.com/links-and-examples

With the default Mura redirection rules, these links will cause IIS to parse the links instead of the Mura CMS, which takes the user to a 404 page. The fix is simple, but can be tricky to implement if you're unfamiliar with .htaccess files.

.htaccess Fix

The hyphen has to be the last character in the .htaccess character expression. Otherwise, it signifies a range between two characters.

So, you just have to move the hyphen to the end of the character expression in your .htaccess rewrite rules. Below is what the .htaccess file should look like with the change:

# This is for rewriting urls "WITHOUT" siteIDs
# To remove the Mura siteID directory and index.cfm from urls you must also set both siteIDInURLS and indexFileInURLs to 0 in your /config/setting.ini.cfm and reload Mura.
Options +FollowSymLinks
RewriteEngine On 
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^([a-zA-Z0-9/-]+/tag/.+|tag/.+)$ /index.cfm%{REQUEST_URI} [PT]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^([a-zA-Z0-9/-\s-]+)$ /index.cfm%{REQUEST_URI} [PT]

The last line has a hyphen added right after the 's':

RewriteRule ^([a-zA-Z0-9/-\s-]+)$ ...

Once this change has been made your URLs with hyphens should now be functional! Below is a full, fixed .htaccess file. Make sure to remove the single #'s for whichever rewrite is currently enabled on your site:

## This is for rewriting urls "WITHOUT" siteIDs
## To remove the Mura siteID directory and index.cfm from urls you must also set both siteIDInURLS and indexFileInURLs to 0 in your /config/setting.ini.cfm and reload Mura.
# Options +FollowSymLinks
# RewriteEngine On 
# RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
# RewriteRule ^([a-zA-Z0-9/-]+/tag/.+|tag/.+)$ /index.cfm%{REQUEST_URI} [PT]
# RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
# RewriteRule ^([a-zA-Z0-9/-\s-]+)$ /index.cfm%{REQUEST_URI} [PT]

## This is for rewriting urls "WITH" siteIDs
## To remove the Mura siteID directory and index.cfm from urls you must also set siteIDInURLS to 1 and indexFileInURLs to 0 in your /config/setting.ini.cfm and reload Mura.
# RewriteEngine On
# RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
# RewriteRule ^([a-zA-Z0-9-]{1,})/^([a-zA-Z0-9/-]+/tag/.+|tag/.+)$ /$1/index.cfm/$2 [PT]
# RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
# RewriteRule ^([a-zA-Z0-9-]{1,})/([a-zA-Z0-9/-\s-]+)$ /$1/index.cfm/$2 [PT]

Mura loading incorrect URL

If your Mura site redirects to an invalid URL or the wrong domain, use the steps below to correct the issue.

How to Change Domain Via Mura Admin

Steps:

  1. Log into your site's Mura Admin
  2. Hover over the Site Config icon, then click the Site Settings link
  3. In the Primary Domain field, enter the correct domain (without the http:// prefix or trailing slash)
  4. Scroll to the bottom of the page and click the Update button.
  5. Hover over the Settings link at the very top of the page, and click the Reload Application link

Mura should respond as expected when you visit the correct domain now.

How to Change Domain When Mura Admin Won't Load

If your Mura Admin site won't load because of this issue, you can change the domain in the database. Mura stores its domain name in the ‘tsettings’ table of its database.

Steps:

  1. Log into phpMyAdmin (mysql) or myLittleAdmin (ms sql)
  2. Find the tsettings table and edit it
  3. Edit the domain field and change its value to the correct domain name (don't put the http:// prefix or trailing slash)
  4. After saving your changes reload Mura (hit the URL with /?appreload at the end)

The site should now load from the correct domain.

Mura 404 Errors

Ensure the Page Exists Within Mura Site Manager

If you encounter a 404 error on a Mura site, the first thing to check is that the page giving the error is actually created in Mura. A common example of this is some links on Mura's default site (the sample site loaded upon installation) such as the Sitemap link will give a 404 error. This is because the page needs to be created within Mura's Site Manager.

Check the Site's Rewrite Rules

If you've already made sure the URL giving the 404 has a corresponding page within Mura's Site Manager, then you'll need to make sure your rewrite rules are correct. If the page giving a 404 consists of two words, then you may just need to implement the ".htaccess" fix described above to ensure Mura rewrites the dashes between words properly.

Mura Error - Element SERVICEFACTORY is undefined in APPLICATION

When this error occurs, you'll need to manually update your Mura files for the version running on your site.

Finding your site's Mura version

To find the version of Mura running on your site, open the /requirements/mura/configBean.cfc.

Around line 51 of that file, you should see your site's version listed within a tag that looks like:

<cfset variables.instance.version="6.1"/>

The line could read 6.1, 6.0, 5.6, etc. This is your site's Mura version.

Manually update Mura 6.1+ files

  1. Download the latest version of Mura
  2. Back up your /config/settings.ini.cfm file
  3. Unzip the Mura Master zip then copy and paste everything except the default directory over your existing Mura install.
  4. Make a Reload/DBUpdate request to the Mura root (eg. http://yousite.com/?appreload&applydbupdates)

Manually update Mura 6.0 files

  1. Download Mura 6.0
  2. Back up your /config/settings.ini.cfm file
  3. Unzip the Mura 6.0 zip then copy and paste everything except the default directory over your existing Mura install.
  4. Make a Reload request to the Mura root (eg. http://yousite.com/?appreload)

Manually update Mura 5.x files

  1. Download Mura 5.x
  2. Back up your /config/settings.ini.cfm file
  3. Unzip the Mura 5.x zip then copy and paste everything except the default directory over your existing Mura install.
  4. Make a Reload request to the Mura root (eg. http://yousite.com/?appreload)

After performing those steps you should no longer see the Element SERVICEFACTORY is undefined in APPLICATION error.

Mura Error - key [FIELDNAMES] doesn't exist in struct (keys)

When uploading items through the Mura file uploader, you may encounter the error: key [FIELDNAMES] doesn't exist in struct (keys)

This error means that the buffer size for your Web server connector is larger than the buffer size for your servlet container (Tomcat in Railo and ColdFusion 10+). This means that the Web server sends more data in a POST request than Railo/ColdFusion can handle, and the POST request fails.

Our shared servers have been configured to prevent this from happening, but if your VPS has custom settings for its Web server connector and Tomcat AJP connector, check the following:

Railo VPS and Dedicated Servers

  • Open the open the configuration file for the BonCode IIS/Tomcat connector which ships with Railo. This is located at C:\Windows\BonCodeAJP13.settings
  • Check for a PacketSize setting. It may look like this: <PacketSize>65536</PacketSize>
  • Now open the Tomcat server.xml configuration file located here: {Railo Install Dir}/tomcat/conf/server.xml
  • Find the line for the AJP/1.3 connector. Ensure the packetSize attribute is present and that it is set to the same value as the Boncode connector.
    Example
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" maxThreads="250" connectionTimeout="120001" packetSize="65536"/>
  • After making the packet size the same within the Boncode connector and Tomcat, restart IIS and Railo for the new settings to take effect

ColdFusion 10+ VPS and Dedicated Servers

  • Open the open the configuration file for the JK IIS/Tomcat connector which ships with ColdFusion 10+. By default, this is located at {CF Install Dir}/config/wsconfig/1/workers.properties
  • Check for a max_packet_size setting. It may look like this: max_packet_size=65536
  • Now open the Tomcat server.xml configuration file located here: {CF Install Dir}/cfusion/runtime/conf/server.xml
  • Find the line for the AJP/1.3 connector. Ensure the packetSize attribute is present and that it is set to the same value as the JK connector.
    Example
    <Connector port="8012" protocol="AJP/1.3" redirectPort="8445" maxThreads="250" packetSize="65536"/>
  • After making the packet size the same within the JK connector and Tomcat, restart IIS and ColdFusion for the new settings to take effect

java.lang.IllegalArgumentException: wrong number of arguments

Fixed Issue for CF2016 in Mura

CF2016 has some compatibility problems with how JavaLoader.cfc works. This has been fixed in Mura, but some plugins for Slatwall and Mura may include their own JavaLoader.cfc that needs the fix.

JavaProxy.cfc around line 67

 
 		constructor = _resolveMethodByParams("Constructor", _getClass().getConstructors(), arguments);  
 
-		instance = constructor.newInstance(_buildArgumentArray(arguments));  
+		if (StructCount(arguments) > 0){  
+			   instance = constructor.newInstance(_buildArgumentArray(arguments));  
+		} else {  
+			   instance = constructor.newInstance(JavaCast("null", 0));  
+		}  
 
 		_setClassInstance(instance);

Mura 500 Errors

siteConfig method was not found