Skip to main content

Site registry and domain management

The site registry is a table in the main Jadu Central database, JaduSiteRegistry. It maps the domain of an incoming request to the database in which that site's content is stored, and determines whether that domain can be used to access the Jadu Central management interface, the Control Center.

The first entry in the site registry is created by the Jadu Central installer using values you provide, and is the default domain that the site and Control Center are served on.

Additional entries are added when Galaxies sites are created and published.

Configuring a separate domain for the Control Center

Jadu Central can be set to serve content to the public on one domain, eg. www.example.com and secure content on a second domain, eg. secure.example.com.

  1. Update each existing site registry entry, set isControlCentre to 0.
  2. Add a new entry to the site registry for the main site and each galaxies site.
    • dbName is the name of the database this site's content is stored in.
    • siteUrl is the domain to server content on.
    • siteName is the name of the site.
    • isMainSite is 1 if this is the main site, 0 in all other cases.
    • isControlCentre is 1 if the Control Center is available on this domain, 0 in all other cases.
    • GUID is the Globally Unique Identifier used on other entries for this database name.
    • preferredConnectionType, dbDSN, dbUsername and dbPassword can all be left blank.
  3. Update the values of the following constants:
  4. Update cookie domain by changing the following constant:
    • TEST_COOKIE_DOMAIN to the wildcard domain
  5. Clear the application's data cache.

The function getSecureSiteRootURL() will return the secure domain of the site, and should be used in templates that link to secure content.

note

After changing the site's configuration in the site registry, Galaxies sites that exist at the point the change is made must be updated manually.New galaxies sites created in Jadu Central will automatically generate the appropriate records.

Changing the hostname of a site

Jadu Central will only serve pages on hostnames that it knows about. Attempting to request pages using any other hostnames will result in an HTTP 404 error page and the following error being written to the PHP error log:

[30-Jul-2019 17:24:02 Europe/London] Unable to find the site my-super-awesome-site.com

The list of hostnames that content will be served on resides in the database table JaduSiteRegistry.

If you have a fresh installation or development image, you should have a single record in this table for the main site. In this case, it is safe to just run an update query to change the hostname to the one you desire.

If you are changing the value of an existing entry on an established site with lots of data, you may wish to perform a database find & replace for any occurrences of the old value within records across the site.

note

If you access a Jadu Central site using an address not present in the site registry, such as the IP address of the server, then an error message will be shown, "site not found", and the page will not be rendered.