The File Structure

It's probably time to talk about the file structure of a coServ website. A coServ server can host multiple websites, and all the websites related files are located under the same "www" root directory. Each website under the same "www" root directory has its own sub-directory. The typical "www" root directory could look like the following:

www/
  + website-A/
  + website-B/
  + ... (more website directories)
  + sites.json

sites.json

Besides those website directory, there is a very important file called sites.json which describes the configurable properties of all websites hosted on the same coServ server. Below shows a sample sites.json file:

{
    "localhost": {
        "caCode": "admin",
        "title": "The coServ Design Console",
        "sitePath": "./admin",
        "locale": "en"
    },
    "192.168.1.100": {
        "caCode": "sampleSite",
        "title": "My First coServ Website",
        "sitePath": "./sampleSite"
    }
}

The above sample shows there are two websites hosted. Each website is differentiated by their hostname (or domain-name or ip-address). For each website, there are several properties associated with it. If you've read the "The Design Console" chapter, you'll notice most of the website properties can be configured with the design console. The possible website properties include:

  • caCode: code name of a website.

  • title: the default title of every web pages of the web site.

  • sitePath: the path of the website directory. If its a relative path, it will be relative to the "www" root directory. However, you can give a full path here which means the website directory can be anywhere of the file system. It does not have to be always under the "www" root directory.

  • local: the default locale of the website. If not specified, it's default to "en".

  • home: the default home page of the website. If not specified, it will be default to "/index".

  • login: the login page of the website. This property will work in tandem with the isProected property. For a protected website, any attempt to access protected webpages will be redirected to the login page specified here.

  • isProected: if this property is set to true, the website will require login to access its pages (except those pages which have denoted themselves as the guest page, such as the login page).

The Website File Structure

We've just explained how to set the properties of a website. Now we can further explore what files make up a website on coServ.

results matching ""

    No results matching ""