Adding a new web site to an existing shared hosting account on Pair Networks

Some clients underuse their web host’s resources and so multiple web sites and clients can be hosted on a single account. Here’s how.

PREPARATION
Everything described in this section only has to be done once. If you’ve already done these things, skip to the next section, “Adding a new client”.

Prepare the existing hosting account
In the Pair Account Control Center (ACC), upgrade the account to at least Advanced. What is needed is dedicated IP domain hosting plus whatever specific features the new client requires.

Prepare the existing web site
This section assumes there is an existing web site in the Apache docroot of the hosting account to be shared and the domain existing.com points to it.

Insure there is no file in the Apache docroot named favicon.ico. If there is, rename it (perhaps to example.ico) and modify the headers on the existing web site’s pages to reflect the favicon’s new name. See the favicon notes for details and a caveat about user agent support.

Review the files .htaccess and php.ini in the Apache docroot for anything that needs to be modified to accommodate additional sites.

There probably was an existing bookmark for the original web site in your FTP/SSH application; make sure it exists and points to his docroot. Make a new bookmark called “shared hosting” and point it to the account root (e.g. /usr/home/USERNAME). Test the bookmarks.

Separate the web logging of the existing site
By default, Pair will merge web log statistics of all domains in the account. Separate the existing client’s logs in the ACC by going to Domain Hosting Management – Manage Your Domain Names. Select the existing client’s principal domain and click “Manage Domain Hosting Web Logs”. In the “Web Logs Currently” drop-down box, select “separated”. You should see that the web log will now be given the name of the new client’s domain; accept this by pressing “Modify Web Log Settings”.

Repeat this step for any additional domains the existing client may have. You will usually want to change the name of each domain’s web log for that of the principal domain, thus merging all of the existing client’s logs into one, but keeping it separate from any new clients’ logs.

In your FTP/SSH application, go to the hosting account’s web log configuration directory, /usr/home/USERNAME/log_config/. Download the Pair-created default configuration file http://www.cfg to your local box and copy it, naming the copy existing.com.cfg. Add it to the appropriate project file of your development environment (e.g. Bluefish) and edit it, changing or adding the following variables:

LOGFILE /usr/home/USERNAME/www_logs/existing.com*
OUTFILE /usr/www/users/USERNAME/ANALOG_REPORTS/existing.com.html
CHARTDIR existing.com/
LOCALCHARTDIR /usr/www/users/USERNAME/ANALOG_REPORTS/existing.com/

In http://www.cfg, set OUTFILE to /dev/null to suppress its output. Then upload both http://www.cfg and existing.com.cfg.

ADDING A NEW CLIENT
This section assumes a new domain name of new.com.

Set a docroot for the new client
In the docroot of the shared hosting account (e.g. /usr/www/users/USERNAME), create the directory “_new”. This will be the new client’s docroot. Now add this new directory to the existing site’s robots.txt so that robots scanning the existing site will not index the new site as part of the existing site:

User-agent: *      # applies to all robots
Disallow: /_new/   # subdirectory for new site

In your FTP/SSH application, create a bookmark for the new client using SSH2. Point it to the new client’s docroot and test it. This would be a good time to upload the new site’s files.

Pair provides a backup directory, /usr/home/USERNAME/backup. Create here the directory _new. Use this for the new client’s WWW backups. (You do have a backup plan for the new client, don’t you?) You need make no special provision for mail backups; they will be mixed up with the original account’s mail backups.

Point the new client’s domain to his new docroot
This section assumes the new client already has one or more domains. If not, obtain the domain(s) first.

Enter the Pair ACC, using the existing client’s account. Go to Domain Hosting Management – Add a New Domain Name – Add a Domain Name That is Already Registered. Enter the new domain, select the dedicated IP option, and click “Proceed”. Select “Mapped to a subdirectory of your hosting account” and provide the path to the new client’s docroot.

If the new client has any additional domains, repeat the previous step but using the cheaper shared IP option, sharing the IP of the domain entered above.

Set up web logging for the new site
Separate the new client’s web logs from the existing client’s by going in the ACC to Domain Hosting Management – Manage Your Domain Names. Select the new domain and click “Manage Domain Hosting Web Logs”. In the “Web Logs Currently” drop-down box, select “separated”. You should see that the web logs will now be given names based on the new client’s domain such as “example.com.YYYYMMDD”. Accept this by pressing “Modify Web Log Settings”.

Repeat this step for any additional domains the new client may have. You will usually want to change the name of each domain’s web log for that of the principal domain, thus merging all of the existing client’s logs into one, but keeping it separate from the new client’s log.

Finish your work in the Domain Hosting Management section by returning to the “Manage Domain” page of the new domain (Domain Hosting Management – Manage Your Domain Names, and click on the new domain). Print this page for reference, and do likewise for any additional domains the new client may have.

Go to the hosting account’s web log configuration directory, usually /usr/home/USERNAME/log_config/. The ACC should have created a new configuration file named new.com.cfg. If it did not for some reason, make one yourself by copying the original client’s configuration file existing.com.cfg, giving it the name new.com.cfg. Download it to your local box and add it to the appropriate project file of your web development environment (e.g. Bluefish). Edit it, changing or adding the following variables:

LOGFILE /usr/home/USERNAME/www_logs/example.com*
OUTFILE /usr/www/users/USERNAME/_new/ANALOG_REPORTS/example.com.html
CHARTDIR example.com/
LOCALCHARTDIR /usr/www/users/USERNAME/_new/ANALOG_REPORTS/example.com/

Make any other changes as desired and upload new.com.cfg.

Finally, using SSH we need to create the output directory of the new client:

% cd /usr/www/users/USER/_new/
% mkdir ANALOG_REPORTS/
% cd ANALOG_REPORTS/
% mkdir new.com/
% ln -s /usr/local/share/analog/5.0/images images

The URL of the log report page will be of the form http://new.com/ANALOG_REPORTS/new.com.html. Take note of the URL for your records and inform the client.

Set up email for the new client
In the Pair ACC, go to Email Management and create all needed recipes and mailboxes, using the “create…” buttons. Remember to impose appropriate storage quotas and to enable junk filtering. Once set up, print them out for reference.

Consider customizing your junk mail handling. As you do so, do not be alarmed if SSH or FTP reveals that the new mailboxes do not yet exist. This is normal; they will be created by Pair in time to receive mail.

ASSOCIATE NEW DOMAIN WITH NEW NAME SERVERS
The final step is to modify the name servers of the domain, thus pointing it to the new hosting account. How this is done depends upon your domain registrar. Again depending upon the registrar, you may have to unlock the domain before modifying the name servers.

REFERENCES
Analog logfile analyser project page

Advertisements

About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s