Category: How to: Customize The Look of New SiteWorx Accounts by Editing the Skel File and Directory

Share this post...Tweet about this on TwitterShare on Google+0Share on Facebook0

Purpose:

This document will give the reader an overview of how to customize the “look” of new SiteWorx accounts.

Audience:

  • System Administrators of hosting companies and others wishing to customize the look of their new account screen.
  • System Administrators wishing to customize default virtual host configuration file.

Overview:

Each SiteWorx account on a server has a configuration file located inside the /etc/httpd/conf.d directory. The skel file is the file which becomes the template for all new virtual host configuration files. This document will give the reader an overview of what changes can be made and how to change them.

The skel directory is the directory containing the files copied to the html directory of all new SiteWorx accounts.This includes your start screen and any images or other config files (e.g. logos, robots.txt etc.).

In its current incarnation the skel directory contains the contents of the html directory(/chroot/accountname/domainname.com/html ) only, not the user’s entire home directory.

The Skel File

The InterWorx Skel file is located /chroot/home/interworx/etc/vhost-base.conf
Here are its default contents:

<VirtualHost <<IP_ADDR>>:<<PORT>>>

  <<SUEXEC>>

  DocumentRoot <<WEBROOT>>
  ServerName <<DOMAIN>>

  ServerAlias <<ALIASES>>
  ServerAdmin webmaster@<<DOMAIN>>

  # subdomain logic
  RewriteEngine On
  RewriteOptions inherit
  RewriteCond %{HTTP_HOST} !^www.<<ESCDOMAIN>> [NC]
  RewriteCond %{HTTP_HOST} !^<<ESCDOMAIN>> [NC]
  RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-.]+).<<ESCDOMAIN>> [NC]
  RewriteCond %{DOCUMENT_ROOT}/%1 -d
  RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
  RewriteRule ^([0-9A-Za-z-.]+).<<ESCDOMAIN>>/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]

  RewriteCond %{HTTP_HOST} ^www.([A-Z0-9a-z-.]+).<<ESCDOMAIN>> [NC]
  RewriteCond %{DOCUMENT_ROOT}/%1 -d
  RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
  RewriteRule ^www.([0-9A-Za-z-.]+).<<ESCDOMAIN>>/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]
  # end subdomain logic

  ErrorLog <<ERRORLOG>>
  CustomLog <<XFERLOG>> combined

  # php: default don't edit between this and the "end php" comment below
  <IfModule mod_suphp.c>
    suPHP_Engine On
    suPHP_UserGroup <<UNIQNAME>> <<UNIQNAME>>
    AddHandler x-httpd-php .php
    suPHP_AddHandler x-httpd-php .php
    suPHP_ConfigPath /home/<<UNIQNAME>>/etc
  </IfModule>

  <IfModule !mod_suphp.c>
    <IfModule mod_php5.c>
      php_admin_flag engine On
    </IfModule>
    <IfModule mod_php4.c>
      php_admin_flag engine On
    </IfModule>
  </IfModule>
  # end php

  # cgi: <<CGISTATUS>> don't edit between this and the "end cgi" comment below
  <Directory <<WEBROOT>>>
    AllowOverride All
  </Directory>

  <Location />
    Options <<CGI1>> <<SSI>>
  </Location>
  <<CGI2>>
  # end cgi
</VirtualHost>

When the account is created, InterWorx replaces all of the values in <<BRACKETS>> with actual account data when the virtual host configuration file for that domain is created.

AllowOverride is set to ALL in httpd.conf by default so you can add any Apache 2 directives that you wish to this file but anything here will be placed in EVERY virtual host configuration file created from that point on. These values, in turn, can be overridden on a directory by directory basis using .htaccess

Editing this file WILL NOT make any changes to existing virtual host config files. If you need to make changes to all of your files they will need to be manually edited one at a time.

Variables and their Explanations:

DEFAULT VARIABLES

  • «IP_ADDR» — the IP address that the domain is assigned to
  • «PORT» — the port that the website is accessed on (normally 80)
  • «SUEXEC» — SuexecUserGroup permissions (the system user and group that have ownership rights over the domain. In InterWorx every SiteWorx account has its own system user based upon the first 8 characters of the default domain.)
  • «WEBROOT» — full system path to the html directory (e.g. /home/account/domainname.com/html/)
  • «DOMAIN» — the fully qualified domain name of the account (e.g. mydomain.com, sub.mydomain.com)
  • «ALIASES» — a list of alternate names for the domain (e.g. www.mysite.com ftp.mysite.com mail.mysite.com sub.mysite.com)
  • «ESCDOMAIN» — an escaped version of the domain, to be used with Apache directives that use a regular expression. For example, use «ESCDOMAIN» with the RewriteRule directive. What this looks like is the account domainname separated from its extension by a slash (e.g. mysite.com )
  • «ERRORLOG» — path to the error log
  • «XFERLOG» — path to transfer log
  • «CGISTATUS» — status of cgi on the account (1 = enabled 0 = disabled)
  • «CGI1» — full system path to cgi-bin directory (normally /home/account/domainname.com/html/cgi-bin/ )
  • «CGI2» — script aliases to the cgi bin (normally /cgi-bin/ /home/account/domainname.com/html/cgi-bin/

The Skel Directory

The InterWorx skel directory is located in /chroot/home/interworx/etc/skel and contains the following files by default

1.gif
2.gif
3.gif
index.html
interworx_logo.gif
robots.txt

You are free to edit or replace any or all of these files. These changes WILL NOT be overwritten by an InterWorx update.

The Default Index File

index.html is your new account start page. This page exists to show your clients that their account is set up and DNS is resolving. It is also a gateway to places to get help with their new hosting account and the control panel.

It is strongly recommended that you leave this file in place in an edited form. Hosting companies are encouraged to put their logo and contact information here in place of ours to “brand” the new accounts to your company. This page is generally deleted or overwritten by webmasters when they create their homepages, but looks nice for your clients.

robots.txt

robots.txt tells search engine spiders who is allowed to search your site and who is not; it can also exclude certain directories from the search (e.g. the images directory) if desired. This is in accordance with the Robots Exclusion Standard. [More info: Wikipedia ]

The default configuration allows all search engine spiders to index the site and allows the spiders to index the entire site. The config file (below) gives a basic explanation of its syntax.

#****************************************************************************
# robots.txt
# : Robots, spiders, and search engines use this file to determine which
# content they should *not* crawl while indexing your website.
# : This system is called "The Robots Exclusion Standard."
# : It is strongly encouraged to use a robots.txt validator to check
# for valid syntax before any robots read it!
#
# Examples:
#
# Instruct all robots to stay out of the admin area.
# : User-agent: *
# : Disallow: /admin/
#
# Restrict Google and MSN from indexing your images.
# : User-agent: Googlebot
# : Disallow: /images/
# : User-agent: MSNBot
# : Disallow: /images/
#****************************************************************************
User-agent: *
Disallow:

For more info on the Robots Exclusion Standard and other allowed exclusions and syntax visit http://www.robotstxt.org/

SKEL
Nov 16, 2012, 8:15 pmBy: InterWorx
How to: Customize The Look of New SiteWorx Accounts by Editing the Skel File and Directory
1 vote, 4.00 avg. rating (71% score)
(0) Comments

Leave a Reply
Surround code blocks with <pre>code</pre>

Your email address will not be published.

Comments

Top Rated

Broken Link