HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


ocPortal Tutorial: Advanced configuration

Written by Chris Graham, ocProducts
This tutorial will cover various advanced aspects of ocPortal configuration.


Configuration

Many advanced configuration options are presented and described in the main Admin Zone configuration module. As these are self explanatory, they will not be explained here in depth.
Advanced configuration options include (but are not limited to):
  • Enabling and disabling cacheing
  • Setting up details for an external SMTP server, if PHP can not itself send e-mails
  • Configuring details for various optional ocPortal features, such as the Point Store and galleries
  • Configuring details for logging
  • Configuring the Admin Zone todo-list block

Add-ons

ocPortal is split into a series of addons. All the addons are installed when you install ocPortal but it is recommended that you should remove any that aren't needed once you are familiar with the software. This is so as to make sure the non-required/unconfigured functionality doesn't accidentally get discovered by your visitors, and that any unnecessary complexity is removed. Less is more when it comes to good design, and if you ensure you have only the right set of features on your site then you can better tailor it for your visitors.

To uninstall addons go to the Structure section of the Admin Zone, then the Add-ons icon. Any addons that are uninstalled will be archived so you can restore them later if you wish (although any data you created for the addons, such as entries, will be permanently lost).

Modules

Information for programmers only

Add-ons usually contain modules (and/or blocks) and these serve a dual-purpose:
  • providing access screens to the addon functionality (this is when the module is behaving as a page)
  • installing and uninstalling database structure
Modules/blocks that are not locked may be un-installed and re-installed from a module management page that is burried underneath the addon management page. We do not recommended working on a module level but if you are a programmer it is sometimes useful to be able to uninstall/reinstall your own modules during testing.

Note

Re-installing or un-installing a module will generally delete all data associated with it, including uploads and entries.
If a module has been upgraded (i.e. The on-disk file has been replaced with a newer version), you may upgrade it (to upgrade/create on-disk and on-database data) in 3 ways:
  • Simply use the module, and it will upgrade itself
  • Run the <base-url>/upgrader.php script, which will upgrade all modules on your site that need it, as well as clearing caches
  • Use the module management interface to upgrade the module
There is also a concept of a 'hacked' module (a module modified as a part of an unofficial addon): the process of performing any upgrades an on-disk file needs for this is the same as for a conventional module upgrade.

Supplementary features

For licensing reasons there are some minor features ocProducts cannot include in the standard ocPortal.
You can get the following addons:

Permissions

ocPortal has a rich, multi-layered, permission system. In creation of this system we have tried to strike a balance to keep all of these factors high:
  • power
  • ease-of-use
  • quickness of configuration

Thumbnail: Privileges are set like this

Privileges are set like this

ocPortal has two main types of permission:
  1. privileges
  2. access permissions (for defining what may be viewed)

ocPortal uses a "best of" permission system, meaning that a member has the best possible access that the combination of all usergroups that they are in could give them. The one exception to this is when permissions are overridden for a page/catalogue/category the user will be limited by the override even if only a subset of their usergroup set is overrided at that level.

Privileges

Privileges allow the assignment of permissions to usergroups via check-boxes. Privileges have a very specific meaning, rather than perform a higher level role of deciding whether something may be viewed.
Broadly, privileges are used to grant things like 'whether a member can access the site when it is closed', as well as to define sweeping permissions for content classes.
Sweeping permissions are there so that instead of making you specify who can control (edit/delete/etc) each/every content-item/type-of-content/category-contents individually, you can specify them by impact-class.
The 'impact' scheme is used to classify content according to its impact to the website and prominence. The following privileges may be set for usergroups for each of adding, editing and deleting content:
  • low impact content (things most people will probably not notice, like forum posts, Wiki+ posts, calendar events)
  • medium impact content (things most people are likely to notice, like downloads, banners, gallery images and videos, author profiles, catalogue entries, inactive polls, inactive IOTDs, forum topics)
  • high impact content (things on the front page, like active poll, active IOTDs, Comcode pages, news, quizzes)
  • (for editing/deleting only) only their own low impact content
  • (for editing/deleting only) only their own medium impact content
  • (for editing/deleting only) only their own high impact content

You can optionally override privilege settings in almost all the places where you may set access permissions. This provides a far greater degree of control but is completely optional, because if you do not choose to do any overriding then the global privileges will be used. You have the power of fine-grained control, and the simplicity of only having to do fine-grained control when you need to set a special case.

Using the Permissions Tree Editor you may configure access and privileges for almost any aspect of the system, as well as make batch changes with great efficiency.

For a good real-world example of how to set up privileges, see the 'Setting bypass-validation access' section of the organising discussion forums tutorial.

Access permissions

ocPortal access permissions do not work via an 'inheritance' system as such. Think of the above levels as barriers, not inheritance points. You need to get past each barrier to access a resource.

Access permissions are also configured by check-boxes. ocPortal supports a layered system of access permissions, where to access an entry, you need permissions to certain things 'above' the entry:
  1. Zone access permissions
  2. Page access permissions
  3. Catalogue access permissions (catalogues only)
  4. Category access permissions (where forums and galleries count as categories in this context)
To configure access permissions, you may edit the resource the permissions are for, or use the Permissions Tree Editor. For example, to edit zone access permissions, you need to edit the appropriate zone, or browse to the zone in the Permissions Tree Editor.

Installation options (base-configuration)

If your core configuration settings change, if you move servers for example, then ocPortal may cease to function. To ameliorate this, an external configuration editor is provided that can reconfigure the info.php that stores core configuration settings, such as database access details.

To launch the external config editor, go to the Setup section of the Admin Zone and choose the 'Installation Options' icon.
If you are locked outside ocPortal, you will need to open up the <base-url>/config_editor.php URL manually.

The password to enter the config editor is the password you specified during installation (the 'Master password'). If you have forgotten it, you will need to edit info.php by hand.

Note

If you change servers you will also need to set file permissions. Please read the advanced installation tutorial for details on this. If you upload new themes, you will need to set permissions on the templates_cached/<lang> and *_custom directories after uploading.
You may use the config editor to:
  • Change the default site language
  • Change the database driver
  • Change the forum driver
  • Change the e-mail domain
  • Change the base-URL
  • Change forum and site database details
  • Change cookie details
  • Force 'short URLs' to be disabled, if you enabled it, but it failed to function correctly, locking you out of ocPortal

Pages (advanced information)

You may delete, and move pages using the Site-tree editor .

If you are moving a page from one zone to another, any page links to that page (for example, in the menus or via 'page' tags) will become invalid, unless they were specified as being in the zone named '_SEARCH' (which is used to create a link by dynamically searching all zones for the named page). You may wish to temporarily set up a redirection from the page as named in its original zone, to the page as named in the new zone. Details of this are given in the 'Creating Sub-communities' tutorial. Setting up a redirection is also advisable if the page being moved is already well-indexed on search engines.

It is recommended that you never move pages because it complicates the upgrade process. It is advisable to use the redirects feature instead (Structure section of the Admin Zone, Redirects icon).

.htaccess

Thumbnail: Finding how to change your settings

Finding how to change your settings

You can try and get PHP and the web server to use an optimal configuration, via a special file named '.htaccess'. If you want the 'short URLs' option to be enabled, this step is necessary.
Note that the file may already exist, potentially for either of two reasons:
  1. It was already there from before ocPortal was installed.
  2. ocPortal's quick installer automatically created an optimal file for you.

To try this, use FTP (or an equivalent tool) to rename the included 'recommended.htaccess' to '.htaccess' (or if the file already existed, manually copy & paste in the extra lines). Our recommended options will tighten up your security where possible, and make sure ocPortal has certain PHP and Apache features turned on.
There are three caveats here:
  1. it will only work on an Apache (basically, Linux) server. Windows IIS servers are either managed from the IIS Administrative Tools, or from a web hosting control panel.
  2. CGI server configurations can not use .htaccess files to configure PHP settings. On CGI servers (and note this works on IIS CGI servers), you need to create special php.ini files. For more information, see our FAQ ("How do I set PHP settings on a CGI server?"). This said, you can probably still set the non-PHP settings in your .htaccess (see below).
  3. some web-hosts do not allow .htaccess files to be used to change any options, resulting in an error message. To test for this try plain.htaccess instead of recommended.htaccess:
    • If this succeeds, you are running CGI and you can't set PHP options from your .htaccess, so read (2) above. Keep your .htaccess file though, it's still worth having even without the PHP options.
    • If this fails too you will need to rename the file back and consult your web-host.

Short URLS

ocPortal supports clean URLs in Apache. These clean URLs can improve your search engine rankings in some cases. ocPortal can also do clean URLs on the following web-servers:
  • Apache (using mod_rewrite, and our rules in recommended.htaccess)
  • Litespeed Server (as above)
  • IIS7 (due to the rules in our web.config)
  • IIS6 and below, if the IIRF extension is installed (details below)
  • HipHop PHP

Apache

Perform the following steps:
  1. If you haven't already got a working ocPortal .htaccess file (the quick installer may have made it for you automatically), rename recommended.htaccess to .htaccess. If your site gives errors after doing this, try simple.htaccess instead. If you still get errors, your server probably doesn't have mod_rewrite available, which is required for this functionality to work.
  2. If things go wrong, you can disable clean URLs via an emergency shut off option in the config_editor.php script. Make sure you see where it is before proceeding to the next step.
  3. Enable clean URLs from your site options (Setup section of the Admin Zone, Configuration icon, Site options, Advanced box).

IIS6 and below

You need to be a server administrator of your server, to install the free IIRF ISAPI module available from:
http://cheeso.members.winisp.net/IIRF.aspx

ocProducts cannot take responsibility or provide support for this feature. We're happy to answer questions, but fiddling with your web server is only for those in the know. It is best you try things out on a test website before your live one.

To install IIRF:
1) Copy IIRF.dll into your Inetpub folder

2) In IIS manager add the dll as an ISAPI filter, but only to the website that runs ocPortal. This means that the IIRF plugin will only affect the ocPortal website, which is important because the IIRF configuration file is not modular – if it were applied to all websites on the server, it could cause serious problems.

3) Make an IirfGlobal.ini file in your Inetpub folder containing the following:

Code

# These have a specially reduced form (no need to make it too explicit that these are Wiki+)
#  We shouldn't shorten them too much, or the actual zone or base url might conflict
RewriteRule ^/([^=]*)pg/s/([^\&\?]*)/index\.php$ /$1index.php\?page=cedi&id=$2 [L,U]

# These have a specially reduce form (wide is implied)
RewriteRule ^/([^=]*)pg/galleries/image/([^\&\?]*)/index\.php(.*)$ /$1index.php\?page=galleries&type=image&id=$2&wide=1$3 [L,U]
RewriteRule ^/([^=]*)pg/galleries/video/([^\&\?]*)/index\.php(.*)$ /$1index.php\?page=galleries&type=video&id=$2&wide=1$3 [L,U]
RewriteRule ^/([^=]*)pg/iotds/view/([^\&\?]*)/index\.php(.*)$ /$1index.php\?page=iotds&type=view&id=$2&wide=1$3 [L,U]

# These are standard patterns
RewriteRule ^/([^=]*)pg/([^/\&\?]*)/([^/\&\?]*)/([^\&\?]*)/index\.php(.*)$ /$1index.php\?page=$2&type=$3&id=$4$5 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?]*)/([^/\&\?]*)/index\.php(.*)$ /$1index.php\?page=$2&type=$3$4 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?]*)/index\.php(.*)$ /$1index.php\?page=$2$3 [L,U]
# This one is weird... apache strips out // and turns to /, thus requiring an extra pattern...
RewriteRule ^/([^=]*)pg/index\.php(.*)$ /$1index.php\?page=$3 [L,U]

# Now the same, but without any additional parameters (and thus no index.php)
RewriteRule ^/([^=]*)pg/s/([^&\?]*)$ /$1index.php\?page=cedi&id=$2 [L,U]
RewriteRule ^/([^=]*)pg/galleries/image/([^\&\?]*)$ /$1index.php\?page=galleries&type=image&id=$2&wide=1$3 [L,U]
RewriteRule ^/([^=]*)pg/galleries/video/([^\&\?]*)$ /$1index.php\?page=galleries&type=video&id=$2&wide=1$3 [L,U]
RewriteRule ^/([^=]*)pg/iotds/view/([^/&\?]*)$ /$1index.php\?page=iotds&type=view&id=$2&wide=1 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?]*)/([^\&\?]*)/([^/\&\?]*)/$ /$1index.php\?page=$2&type=$3&id=$4 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?]*)/([^\&\?]*)/([^\&\?]*)$ /$1index.php\?page=$2&type=$3&id=$4 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?]*)/([^/\&\?]*)$ /$1index.php\?page=$2&type=$3 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?]*)$ /$1index.php\?page=$2 [L,U]

# And these for those nasty situations where index.php was missing and we couldn't do anything about it (usually due to keep_session creeping into a semi-cached URL)
RewriteRule ^/([^=]*)pg/s/([^\&\?\.]*)&(.*)$ /$1index.php\?$3&page=cedi&id=$2 [L,U]
RewriteRule ^/([^=]*)pg/galleries/image/([^/\&\?\.]*)&(.*)$ /$1index.php\?$5&page=galleries&type=image&id=$2&wide=1&$3 [L,U]
RewriteRule ^/([^=]*)pg/galleries/video/([^/\&\?\.]*)&(.*)$ /$1index.php\?$5&page=galleries&type=video&id=$2&wide=1&$3 [L,U]
RewriteRule ^/([^=]*)pg/iotds/view/([^/\&\?\.]*)&(.*)$ /$1index.php\?$3&page=iotds&type=view&id=$2&wide=1 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?\.]*)/([^/\&\?\.]*)/([^\&\?\.]*)&(.*)$ /$1index.php\?$5&page=$2&type=$3&id=$4 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?\.]*)/([^/\&\?\.]*)&(.*)$ /$1index.php\?$4&page=$2&type=$3 [L,U]
RewriteRule ^/([^=]*)pg/([^/\&\?\.]*)&(.*)$ /$1index.php\?$3&page=$2 [L,U]

# These have a specially reduced form (no need to make it too explicit that these are Wiki+)
#  We shouldn't shorten them too much, or the actual zone or base url might conflict
RewriteRule ^/(docs|site|forum|adminzone|cms|collaboration)/s/([^&\?]*)\.htm(\?(.*))?$ /$1/index.php\?page=cedi&id=$2&$4 [L,U]

# These have a specially reduce form (wide is implied)
RewriteRule ^/(docs|site|forum|adminzone|cms|collaboration)/galleries/image/([^\&\?]*)\.htm(\?(.*))?$ /$1/index.php\?page=galleries&type=image&id=$2&wide=1&$4 [L,U]
RewriteRule ^/(docs|site|forum|adminzone|cms|collaboration)/galleries/video/([^\&\?]*)\.htm(\?(.*))?$ /$1/index.php\?page=galleries&type=video&id=$2&wide=1&$4 [L,U]
RewriteRule ^/(docs|site|forum|adminzone|cms|collaboration)/iotds/view/([^\&\?]*)\.htm(\?(.*))?$ /$1/index.php\?page=iotds&type=view&id=$2&wide=1$4 [L,U]

# These are standard patterns
RewriteRule ^/(docs|site|forum|adminzone|cms|collaboration)/([^/\&\?]+)/([^/\&\?]*)/([^\&\?]*)\.htm(\?(.*))?$ /$1/index.php\?page=$2&type=$3&id=$4&$6 [L,U]
RewriteRule ^/(docs|site|forum|adminzone|cms|collaboration)/([^/\&\?]+)/([^/\&\?]*)\.htm(\?(.*))?$ /$1/index.php\?page=$2&type=$3&$5 [L,U]
RewriteRule ^/(docs|site|forum|adminzone|cms|collaboration)/([^/\&\?]+)\.htm(\?(.*))?$ /$1/index.php\?page=$2&$4 [L,U]
RewriteRule ^/([^/\&\?]+)/([^/\&\?]*)/([^\&\?]*)\.htm(\?(.*))?$ /index.php\?page=$1&type=$2&id=$3&$5 [L,U]
RewriteRule ^/([^/\&\?]+)/([^/\&\?]*)\.htm(\?(.*))?$ /index.php\?page=$1&type=$2&$4 [L,U]
RewriteRule ^/([^/\&\?]+)\.htm(\?(.*))?$ /index.php\?page=$1&$3 [L,U]

4) Reset IIS

5) Test a clean URL (e.g. http://mybaseurl/site/pg/downloads) – if it doesn't load, you've got a IIRF/IIS configuration problem.

6) If things go wrong, you can disable clean URLs via an emergency shut off option in the config_editor.php script. Make sure you see where it is before proceeding to the next step.

7) In OcCLE, type:

Code

:set_value('ionic_on','1');
to cause ocPortal to generate short URLs for links within the website.

Domain structuring

You can make it so you have a single ocPortal site that runs across different subdomains. You can also make it so that zones appear to be structured hierarchically.

This is an advanced feature that is not fully supported by ocProducts. It requires server administration access to work (i.e. it's unlikely to work on most shared webhosts). It only works with Short-URLs enabled.

The procedure is as follows:

a) It is strongly recommended, for simplicity and user-friendliness, that you operate ocPortal from the root of your domain name, e.g. having http://example.com as your base URL.

b i) For multiple sub(domain) names, each representing a different zone…
Set up multiple website profiles in IIS manager (or the Apache configuration file, if you're using Apache). These profiles must all point to the ocPortal installation directory (not the zone you're linking the subdomain to).

b ii) For complex hierarchies:
Set up virtual directories in IIS manage (or the Apache configuration file, if you're using Apache). These virtual directories must all point to the ocPortal installation directory (not the zone you're linking the subdomain to).

c) ocPortal is now set up to receive requests on the various domain names / paths that you have configured. Extra information needs adding to the ocPortal info.php, to tell ocPortal how to map these individual source locations, into zone accesses.
Let's pretend we've added a new subdomain 'forum.mydomain.com' (for the forum zone), and a new virtual directory under our normal website entry, under 'example/path'; we'll point this to the 'xyz' (i.e. we'll map to a zone unrelated to the subdomain name or virtual directory path). You would add this to info.php
Please note it is essential to configure your cookie domain to be encompassing of all the subdomains you use. In the above example you would need .mydomain.com to be set as the cookie domain. You cannot use a blank cookie domain.

Code

$SITE_INFO['ZONE_MAPPING_forum']=array('forum.mydomain.com','');
$SITE_INFO['ZONE_MAPPING_xyz']=array('mydomain.com','example/path');

d) Now ocPortal links point to the proper complex URLs, and the complex URLs are properly recognised as zones.

Please note it is essential to configure your cookie domain to be encompassing of all the subdomains you use. In the above example you would need .mydomain.com to be set as the cookie domain. You cannot use a blank cookie domain.

Many sites, one install (not supported, very advanced)

ocPortal has some residual support for running many websites of a single install, although not officially supported. We informally refer to this functionality as 'MyOCP', named after our non-extinct ocPortal-based web hosting service.
If run like this, certain functions of ocPortal, such as email settings, or addon management, are disabled.

The support is activated by setting options in the info.php, like:

Code

$SITE_INFO['throttle_space_complementary']=100; // Allow 100MB of disk space per user
$SITE_INFO['throttle_space_views_per_meg']=10; // Every MB of disk space must be accessed 10 times to justify it
$SITE_INFO['throttle_bandwidth_complementary']=500; // Allow 500MB of monthly bandwidth per user
$SITE_INFO['throttle_bandwidth_views_per_meg']=1; // There must be at least one page view for each MB downloaded

$SITE_INFO['custom_base_url_stub']='http://mydomain.com/sites'; // This should be the same as the 'base_url', with '/sites' on the end
$SITE_INFO['custom_file_base_stub']='sites'; // This should always be 'sites'
$SITE_INFO['custom_share_domain']='mydomain.com'; // This should be the same domain name used in 'base_url'
$SITE_INFO['custom_share_path']='sites'; // This should always be 'sites'

$SITE_INFO['custom_user_someuser']=1; // This enables the 'someuser' subdomain

$SITE_INFO['custom_user_someuserwithdomainname']=1; // This enables the 'someuserwithdomainname' subdomain
$SITE_INFO['custom_domain_mypersonaldomain.com']='someuserwithdomainname'; // And this maps mypersonaldomain.com to be equivalent to the 'someuserwithdomainname' subdomain
and splitting up the ocPortal directory structure so all the site-specific directories (uploads, zone custom pages, etc) are located like sites/someuser. For example, for 'someuser', the following directory structure would exist under the base directory:

Code

sites
sites/www
sites/www/adminzone
sites/www/adminzone/pages
sites/www/adminzone/pages/comcode_custom
sites/www/adminzone/pages/comcode_custom/.htaccess
sites/www/adminzone/pages/comcode_custom/EN
sites/www/adminzone/pages/comcode_custom/EN/.htaccess
sites/www/adminzone/pages/comcode_custom/EN/index.html
sites/www/adminzone/pages/comcode_custom/index.html
sites/www/adminzone/pages/html_custom
sites/www/adminzone/pages/html_custom/.htaccess
sites/www/adminzone/pages/html_custom/EN
sites/www/adminzone/pages/html_custom/EN/.htaccess
sites/www/adminzone/pages/html_custom/EN/index.html
sites/www/adminzone/pages/html_custom/index.html
sites/www/cms
sites/www/cms/pages
sites/www/cms/pages/comcode_custom
sites/www/cms/pages/comcode_custom/.htaccess
sites/www/cms/pages/comcode_custom/EN
sites/www/cms/pages/comcode_custom/EN/.htaccess
sites/www/cms/pages/comcode_custom/EN/index.html
sites/www/cms/pages/comcode_custom/index.html
sites/www/cms/pages/html_custom
sites/www/cms/pages/html_custom/.htaccess
sites/www/cms/pages/html_custom/EN
sites/www/cms/pages/html_custom/EN/.htaccess
sites/www/cms/pages/html_custom/EN/index.html
sites/www/cms/pages/html_custom/index.html
sites/www/data_custom
sites/www/data_custom/errorlog.php
sites/www/data_custom/index.html
sites/www/data_custom/modules
sites/www/data_custom/modules/admin_backup
sites/www/data_custom/modules/admin_backup/index.html
sites/www/data_custom/modules/admin_stats
sites/www/data_custom/modules/admin_stats/index.html
sites/www/data_custom/modules/index.html
sites/www/data_custom/spelling
sites/www/data_custom/spelling/index.html
sites/www/data_custom/spelling/personal_dicts
sites/www/data_custom/spelling/personal_dicts/.htaccess
sites/www/data_custom/spelling/personal_dicts/index.html
sites/www/exports
sites/www/exports/backups
sites/www/exports/backups/index.html
sites/www/exports/index.html
sites/www/exports/addons
sites/www/exports/addons/index.html
sites/www/forum
sites/www/forum/pages
sites/www/forum/pages/comcode_custom
sites/www/forum/pages/comcode_custom/.htaccess
sites/www/forum/pages/comcode_custom/EN
sites/www/forum/pages/comcode_custom/EN/.htaccess
sites/www/forum/pages/comcode_custom/EN/index.html
sites/www/forum/pages/comcode_custom/index.html
sites/www/forum/pages/html_custom
sites/www/forum/pages/html_custom/.htaccess
sites/www/forum/pages/html_custom/EN
sites/www/forum/pages/html_custom/EN/.htaccess
sites/www/forum/pages/html_custom/EN/index.html
sites/www/forum/pages/html_custom/index.html
sites/www/imports
sites/www/imports/index.html
sites/www/imports/addons
sites/www/lang_cached
sites/www/lang_cached/.htaccess
sites/www/lang_cached/EN
sites/www/lang_cached/EN/.htaccess
sites/www/lang_cached/index.html
sites/www/lang_custom
sites/www/lang_custom/.htaccess
sites/www/lang_custom/EN
sites/www/lang_custom/EN/.htaccess
sites/www/lang_custom/EN/index.html
sites/www/lang_custom/index.html
sites/www/pages
sites/www/pages/comcode_custom
sites/www/pages/comcode_custom/.htaccess
sites/www/pages/comcode_custom/EN
sites/www/pages/comcode_custom/EN/.htaccess
sites/www/pages/comcode_custom/EN/index.html
sites/www/pages/comcode_custom/index.html
sites/www/pages/html_custom
sites/www/pages/html_custom/.htaccess
sites/www/pages/html_custom/EN
sites/www/pages/html_custom/EN/.htaccess
sites/www/pages/html_custom/EN/index.html
sites/www/pages/html_custom/index.html
sites/www/site
sites/www/site/pages
sites/www/site/pages/comcode_custom
sites/www/site/pages/comcode_custom/.htaccess
sites/www/site/pages/comcode_custom/EN
sites/www/site/pages/comcode_custom/EN/.htaccess
sites/www/site/pages/comcode_custom/EN/index.html
sites/www/site/pages/comcode_custom/index.html
sites/www/site/pages/html_custom
sites/www/site/pages/html_custom/.htaccess
sites/www/site/pages/html_custom/EN
sites/www/site/pages/html_custom/EN/.htaccess
sites/www/site/pages/html_custom/EN/index.html
sites/www/site/pages/html_custom/index.html
sites/www/text_custom
sites/www/text_custom/.htaccess
sites/www/text_custom/EN
sites/www/text_custom/EN/.htaccess
sites/www/text_custom/EN/index.html
sites/www/text_custom/index.html
sites/www/themes
sites/www/themes/default
sites/www/themes/default/css_custom
sites/www/themes/default/images_custom
sites/www/themes/default/templates_cached
sites/www/themes/default/templates_cached/EN
sites/www/themes/default/templates_cached/index.html
sites/www/themes/default/templates_custom
sites/www/themes/default/templates_custom/.htaccess
sites/www/themes/default/templates_custom/index.html
sites/www/uploads
sites/www/uploads/attachments
sites/www/uploads/attachments/index.html
sites/www/uploads/attachments_thumbs
sites/www/uploads/attachments_thumbs/index.html
sites/www/uploads/auto_thumbs
sites/www/uploads/auto_thumbs/index.html
sites/www/uploads/banners
sites/www/uploads/banners/index.html
sites/www/uploads/catalogues
sites/www/uploads/catalogues/index.html
sites/www/uploads/downloads
sites/www/uploads/downloads/.htaccess
sites/www/uploads/downloads/index.html
sites/www/uploads/filedump
sites/www/uploads/filedump/index.html
sites/www/uploads/galleries
sites/www/uploads/galleries/index.html
sites/www/uploads/galleries_thumbs
sites/www/uploads/galleries_thumbs/index.html
sites/www/uploads/grepimages
sites/www/uploads/grepimages/index.html
sites/www/uploads/index.html
sites/www/uploads/iotds
sites/www/uploads/iotds/index.html
sites/www/uploads/iotds_thumbs
sites/www/uploads/iotds_thumbs/index.html
sites/www/uploads/ocf_avatars
sites/www/uploads/ocf_avatars/index.html
sites/www/uploads/ocf_photos
sites/www/uploads/ocf_photos/index.html
sites/www/uploads/ocf_photos_thumbs
sites/www/uploads/ocf_photos_thumbs/index.html
sites/www/uploads/watermarks
sites/www/uploads/watermarks/index.html
sites/www/uploads/website_specific

ocPortal internally differentiates between the "base URL"/"base directory" and the "custom base URL"/"custom base directory", so as to know when to load shared files, and when to load custom ones that relate to a specific site.

In addition, each site must have a database of it's own:
  • This should be named the same as the normal site database is named, except with a suffix or an underscore followed by the username (e.g. examplesite_someuser).
  • The database username should be formed by taking the normal site database username and then suffixing with an underscore and then the username, and then generating the MD5 hash of that, and then taking the first 16 characters. This is intentionally obfuscated, to make it slightly harder to hack.
  • The database password should be the same as for the normal database.

For the server configuration side of things you need to configure Apache to accept all page requests to a single IP address regardless of domain name, and set up a "wildcard DNS" entry – which is just a normal subdomain entry to that IP address, except a '*' is in place of the normal subdomain name.

ocPortal does not contain a way for individual sites to be set up automatically out-of-the-box, but ocProducts have in the past set up code for clients to do this; for example, via an eCommerce product. In these scenarios it is common to create the new sites automatically be extracting a TAR file to create the 'sites/whateveruser' directory automatically, and also importing an SQL file into the new correctly-named database; together the TAR and SQL would form a template for each new site.





See also