CREATE TABLE `reseller_profile` (
`rid` BIGINT( 22 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`profile_name` VARCHAR( 255 ) NOT NULL ,
`edit_ns` INT( 1 ) DEFAULT '0' NOT NULL ,
`limit_type` INT( 1 ) NOT NULL ,
`resnumlimitamt` INT( 25 ) NOT NULL ,
`rslimit_disk` INT( 25 ) NOT NULL ,
`rsolimit_disk` INT( 25 ) NOT NULL ,
`rslimit_bw` INT( 25 ) NOT NULL ,
`rsolimit_bw` INT( 25 ) NOT NULL ,
`acl_list` TEXT NOT NULL ,
PRIMARY KEY ( `rid` ) 
) COMMENT = 'Reseller Profile Table';

ALTER TABLE `plan_specs` ADD `rid` BIGINT( 22 ) DEFAULT '0' NOT NULL AFTER `gid` ;

ALTER TABLE `addon_specs` ADD `private_ns` INT( 1 ) DEFAULT '0' NOT NULL AFTER `extra_webspace` ;

ALTER TABLE `session_history` ADD `pns1` VARCHAR( 25 ) DEFAULT 'ns1' NOT NULL , ADD `pns2` VARCHAR( 25 ) DEFAULT 'ns2' NOT NULL ;
ALTER TABLE `hosting_order` ADD `pns1` VARCHAR( 25 ) NOT NULL , ADD `pns2` VARCHAR( 25 ) NOT NULL ;
ALTER TABLE `plan_specs` ADD `ip_addresses` VARCHAR( 50 ) NOT NULL , ADD `memory` VARCHAR( 50 ) NOT NULL , ADD `processor` VARCHAR( 50 ) NOT NULL , ADD `os` VARCHAR( 50 ) NOT NULL , ADD `display_text` TEXT NOT NULL , ADD `dedicated` INT( 1 ) DEFAULT '0' NOT NULL ;

INSERT INTO email_templates VALUES (34, 'Reseller Welcome Email', 'Your reseller account has been activated, please save and print', 'Hello {{first_name}},\r\n\r\n/\\/\\/\\/\\/\\/\\/\\/\\~~~~~~~~~~[ DETAILS ]~~~~~~~~~~/\\/\\/\\/\\/\\/\\/\\/\\/\\\r\n\r\nYour Package: {{package}}\r\nTotal Quota: {{space}}\r\nTotal Bandwidth: {{bandwidth}}\r\nAccounts Included: {{accounts}}\r\n\r\nThis account is installed on {{server_name}}\r\n\r\n/\\/\\/\\/\\/\\/\\/\\/\\~~~~~~~~~~~~~~~~~~~~~~~~~~~/\\/\\/\\/\\/\\/\\/\\/\\/\\\r\n\r\nThe next areas describe how to access your WHM and cPanel.\r\n\r\nPlease print this email for your records.\r\n\r\n------------------------------------------------------------------------\r\nWeb Host Manager Quicky\r\n------------------------------------------------------------------------\r\nTo Create a new account:\r\n\r\nTo access your Web Host Manager, use the following address:\r\n\r\nhttp://{{ip}}:2086\r\n\r\nUsername: {{username}}\r\nPassword: {{password}}\r\n\r\nFirst thing you need to do is scroll down on the left and click on \'Add Package\'\r\nso that you can create your own hosting packages.  You cannot install a domain\r\nonto your account without a package created.\r\n\r\n1. - click on \'Create a New Account\' from the left hand side menu\r\n2. - put the domain in the \'Domain\' box (no www or http or spaces - just\r\ndomainname.com).  After putting in the domain, it will automatically\r\ncreate a username.\r\n\r\n3. - Your package selection should one that you created earlier\r\n4. - Then press the create button\r\n\r\nThis will create a confirmation page - right click in this area and\r\nselect print (for your records)\r\n\r\n------------------------------------------------------------------------\r\n\r\nPlease do not click on anything that you are not sure what it does.  Please do not\r\ntry to alter the WHM Theme from the selection box - fatal errors will occur.\r\n\r\nYour Domain Information:\r\n\r\nDomain: {{domain}}\r\nIp: {{ip}}\r\nUserName: {{username}}\r\nPassWord: {{password}}\r\n\r\nStarting Space for this domain: 50 megs.  If you need more space, that will deduct\r\nfrom your {{space}} allotted for your client accounts.\r\n\r\nFor FTP:\r\n\r\nHost Address: {{ip}} or {{domain}} if resolved\r\nUsername: {{username}}\r\nPassword: {{password}}\r\n\r\nTo log in to your CPanel (for hosting on this domain) use this address:\r\n\r\nhttp://{{ip}}:2082 or http://{{domain}}:2082 if it has resolved\r\n\r\nUsername: {{username}}\r\nPassword: {{password}}\r\n\r\nUse the IP address if your domain has not resolved to this server yet.\r\nThe http:// must be present in the address to access port :2082\r\n\r\nTo access your Web Host Manager, use the following address:\r\n\r\nhttp://{{ip}}:2086\r\n\r\nUsername: {{username}}\r\nPassword: {{password}}\r\n\r\nYour domain, when you chose one, or if you already have it registered\r\nneeds to point to the following nameservers:\r\n\r\n{{primary_nameserver}}\r\n---&gt; {{primary_nameserver_ip}}\r\n{{secondary_nameserver}}\r\n---&gt; {{secondary_nameserver_ip}}\r\n\r\nAll of your clients will need to point here as well to be hosted in your\r\nreseller block of the server.  If you are creating your own nameservers,\r\nhere is the needed information to register them:\r\n\r\n{{primary_nameserver_reseller}} resolves to {{primary_nameserver_ip_reseller}}\r\n{{primary_nameserver_ip_reseller}} resolves to {{secondary_nameserver_ip_reseller}}\r\n\r\nThanks,\r\n\r\nSupport Team\r\nWeb Hosting Company\r\n\r\n\r\n============================================================\r\nBRIEF OVERVIEW / TUTORIAL of the WHM\r\n============================================================\r\n\r\nlot of the features in the WHM will be used daily, some may not ever be\r\nused at all. This email will explain the first few menu options on the left\r\nas soon as you login to your WHM.\r\n\r\nTo login, use the following method:\r\n\r\nhttp://{{ip}}:2086\r\n\r\nusername: {{username}}\r\npassword: {{password}}\r\n\r\nthe http:// must be in the address line to connect to port :2086\r\n\r\nLet\'s begin:\r\n\r\n============================================================================\r\nWeb Host Manager Tutorial / Explanation\r\n----------------------------------------------------------------------------\r\n\r\nThe web host manager (WHM) is your gateway to the server for installation\r\nand managing of your reseller accounts. I have broken down the WHM in\r\nsections below, with explanations of each feature and what it is good for.\r\n\r\nServer Setup\r\n------------------------------------------------\r\nSetup Remote Access Key\r\n------------------------------------------------\r\nThis function creates a secure key code that will allow perl programs (still\r\nin development) to communicate to your WHM to install,modify and delete\r\nclients without accessing the WHM.  This feature is something that is in\r\ndevelopment and would not be a used feature for your program at this time.\r\n\r\nServer Status\r\n------------------------------------------------\r\nServices Status\r\n------------------------------------------------\r\nThis will allow you to view the heath of the server, at any time.  By\r\nclicking on this link, you will be able to see all the server services\r\nrunning, their status and their usage.  Yellow lights are ok - red lights\r\nare acceptable as long as it is not for long periods of time.  We also\r\nmanage and view these services. If you see a problem, 99% of the time we are\r\nalready addressing it.\r\n\r\n------------------------------------------------\r\nServer Information\r\n------------------------------------------------\r\nThis allows you to see what makes the server.  The processors, hard drive,\r\nserver name, disk usage, etc.\r\n\r\nAccount Functions\r\n------------------------------------------------\r\nList Accounts\r\n------------------------------------------------\r\nThis shows all of your client domains, Server IP, Username, Install Date,\r\nand Space used.  This feature will not show you your clients QUOTA since you\r\nwill be modifying this (if needed) from the \'Quota Modification\' section\r\ndiscussed later.\r\n\r\n------------------------------------------------\r\nCreate a New Account\r\n------------------------------------------------\r\nThis one is pretty much self explanatory but there are some items that need\r\nto be looked out for while installing clients onto the server.\r\n\r\n1 - There cannot be any spaces before or after the domain name.  All that is\r\nneeded is this block is just the domain name (no www. or http://)\r\n\r\n2 - The username cannot start with a number or have any spaces or dashes in\r\nit.  If the username defaults to a name with a dash, remove the dash or\r\nerrors will occur when the user attempts to install scripts included in the\r\nCPanel.\r\n\r\nBad usernames: 123domai or 123-doma or domain-\r\nGood Usernames: domainco or domainxx or domainqt\r\n\r\nTry to keep the username all lower case, as well as the password when you\r\ncreate it.\r\n\r\nTo install a new account, follow these steps:\r\n\r\n1 - input the client domain into the domain box - this will automatically\r\ncreate a username after you press the TAB key when done.  If the username\r\nhas a - in it or starts with a number, please modify the username to be a\r\nclean, acceptable username.\r\n\r\n2 - Create password for the user.  This can be whatever you wish to have as\r\nthe password or the user can request a specific password when signing up for\r\nservices.  A good rule of thumb is to not use an everyday word or, if you\r\nuse an everyday word like \'tree\', modify it with a few numbers -\r\n\'tree78787\'.\r\n\r\n3 - Select your default package (there will only be one package in your\r\ndropdown) and press the create button at the top.\r\n\r\nYour default package will only install the account on 10 megs of space.  If\r\nyou need to modify this space, use the \'Quota Modification\' feature\r\nexplained later.\r\n\r\n********GOOD RULE OF THUMB***********\r\nAfter you press the create button, a confirmation page will come up showing\r\nthe domain installed, the IP, the username and password.  Right click on\r\nthis page and select the print option.  Keep this in your file for this user\r\nsince this will be your only record of the users original password.\r\n*************************************\r\n\r\n------------------------------------------------\r\nSkeleton Directory\r\n------------------------------------------------\r\nThis directory is where you would install a basic index.html page that would\r\nbe installed on all new domains after you have installed them -\r\nautomatically.  If you want to use this feature, you must first click on\r\nthis link to create the cpanel3-skel directory on your reseller domain.\r\n\r\n1 - Create a simple index.html page - Hosted by ______________________ or\r\nsomething a little more feature rich.  If you are using images, host the\r\nimages somewhere else and use full url links to the images IMG\r\nSRC=&quot;http://yourdomain.com/images/welcome.gif&quot;.\r\n\r\n2 - FTP into your main domain and open the /cpanel3-skel folder.  Then open\r\nthe /public_html folder.\r\n\r\n3 - Upload your basic index.html page into this folder.  THAT\'S IT!\r\nEverytime you install an account, this index page will be installed onto\r\nthat domain.  Once the domain resolves, your page will be seen.  The user\r\ncan delete or replace them at their own desire.\r\n\r\n------------------------------------------------\r\nTerminate an Account\r\n------------------------------------------------\r\nPretty much self explanatory.  Only one word of caution - FILES ARE NOT\r\nRECOVERABLE AFTER TERMINATION.\r\n\r\n------------------------------------------------\r\nView Bandwidth Usage\r\n------------------------------------------------\r\nAgain, pretty much self explanatory.  This feature will give you a summary\r\nof all your clients bandwidth usage for the current month.  You have the\r\nability to preview previous months by clicking on the link at the top of the\r\nbandwidth page.  If you notice a client with a highlighted listing (yellow\r\nor red) - Keep an eye on them for they are using alot of bandwidth.\r\n\r\n------------------------------------------------\r\nLimit Bandwidth Usage\r\n------------------------------------------------\r\nIf you want to limit the bandwidth per account, you can do so here.  This is\r\ncounted in MEGS of bandwidth so make sure you use the following method:\r\n\r\nFor 1 GIG of Bandwidth, use 1024 megs, etc.\r\n\r\nOnce this account goes over 1 gig in bandwidth, a page will show up on their\r\ndomain stating bandwidth limit has been reached, contact system admin.  This\r\ngives you total control over bandwidth so nothing gets out of hand.\r\n\r\n------------------------------------------------\r\nSuspend or Unsuspend and account &amp; List Suspended Accounts\r\n------------------------------------------------\r\nSelf explanatory area.  This will allow you to FREEZE a clients domain which\r\nwill product a customized (explained later) page on their website stating\r\nthey have been suspended, please contact system admin.\r\n\r\n------------------------------------------------\r\nModify Suspended Account Page\r\n------------------------------------------------\r\nClicking this will give you a form field with the HTML code of your \'Account\r\nSuspended\' page.  Create a standard \'account suspended\' web page (with full\r\nurl links to images) in a normal web design program. Cut and paste the\r\nsource into this box and press save.\r\n\r\n------------------------------------------------\r\nQuota Modification\r\n-------------------------------------------------\r\nAfter you install and account, and they have been assigned 10 megs on your\r\nreseller area - you can click here to alter that space to meet their needs.\r\nPretty much self explanatory once inside.  Find the domain, replace the 10\r\nwith what they purchases and press the submit button next to the box.\r\n\r\n------------------------------------------------\r\nPassword Modification\r\n------------------------------------------------\r\nIf a user misplaces or forgets their password, you can go here and either\r\nreset it to original (pull out copy of printout from account creation) or\r\nyou can make an entire new password for them.\r\n\r\n------------------------------------------------\r\nList Subdomains\r\n------------------------------------------------\r\nIf an account has been enabled to use sub-domains (unique IP required) - you\r\nwill be able to view all the sub-domains by clicking this link for all\r\naccounts in your reseller block.\r\n\r\n============================================================================', '{{first_name}}|{{package}}|{{space}}|{{bandwidth}}|{{accounts}}|{{server_name}}|{{domain}}|{ip}}|{{username}}|{{password}}|{{generate_date}}|{{primary_nameserver}}|{{primary_nameserver_ip}}|{{secondary_nameserver}}|{{secondary_nameserver_ip}}|{{primary_nameserver_reseller}}|{{primary_nameserver_ip_reseller}}|{{secondary_nameserver_reseller}}|{{secondary_nameserver_ip_reseller}}|');

ALTER TABLE `session_history` ADD `server_hostname` VARCHAR( 255 ) NOT NULL , ADD `root_pw` VARCHAR( 255 ) NOT NULL ;
ALTER TABLE `hosting_order` ADD `server_hostname` VARCHAR( 255 ) NOT NULL , ADD `root_pw` VARCHAR( 255 ) NOT NULL ;

INSERT INTO `email_templates` ( `emid` , `name` , `subject` , `message` , `attr_avail` ) VALUES (36, 'Dedicated Server Activation', 'SUBJECT: Your Dedicated Server has been Activated and is Ready', 'Hello {{first_name}}, /\\/\\/\\/\\/\\/\\/\\/\\~~~~~~~~~~[ DETAILS ]~~~~~~~~~~/\\/\\/\\/\\/\\/\\/\\/\\/\\ Server Name: {{dedicated_server_name}} Operating System: {{dedicated_operating_system}} Server Specifications: {{dedicated_server_specs}} Main IP: {{dedicated_main_ip}} Initial IP Allocation: {{dedicated_ipblock_range}} Root Access Password: {{dedicated_root_password}} This servers rack location is: {{dedicated_rack_location}} /\\/\\/\\/\\/\\/\\/\\/\\~~~~~~~~~~~~~~~~~~~~~~~~~~~/\\/\\/\\/\\/\\/\\/\\/\\/\\ The next areas describe how to access your WHM AVAILABLE DOCUMENTATION: CPanel Manual: http://www.cpanel.net/docs/cp/ WebHostManager Manual: http://www.cpanel.net/docs/whm/ Automate your client installs immediately after they order, visit: http://www.whmautopilot.com/autopilot.php Please print this email for your records. ------------------------------------------------------------------------ FIRST STEPS TO GET THIS SERVER UP AND RUNNING ------------------------------------------------------------------------ This server has been built to \'standard\' specifications and no specific \'user\' related information may be in place. Step One: Log into your Dedicated Servers ROOT WHM: https://{{dedicated_main_ip}}:2087/ Root Password: {{dedicated_root_password}} Username: root [1] Click on \'Edit Setup\' on the left hand frame (A)---> make sure primary and secondary nameservers are correct If yes, assign an IP and create the A record (each) (B)---> make sure hostname is correct. If not, make a note and we\'ll discuss how to change that later. (C)---> If you have AOL IM, we highly recommend putting that information in here so that you can be alerted via AOL IM if something has a problem. After all these have been reviewed, and found to be correct - click submit at the bottom of this page to save your changes to this area. [2] With the above done, and the A Records made for your private nameservers, you will need to register those with your domain registrar. [3] Get to know your WHM by using the manual link above and please, if you do not know what something does - do not click it. Remember, you have root access to this box and that access should never be shared nor given to anyone outside of your trust limits. Root access controls all the configurations of the server and, with the wrong command or edit, can crash your server and entail costs of $75 per man hour to correct. ------------------------------------------------------------------------ BASIC ROOT COMMANDS FOR A DEDICATED SERVER - USE AT YOUR OWN RISK ------------------------------------------------------------------------ These commands are to be run in an SSH Window via login to port 22 as root A good program for this is called PuTTY ----------------------- To restart server : reboot Check Disk Usage : dj -k Stop HTTPD (apache) : /etc/rc.d/init.d/httpd stop Start HTTPD (apache) : /ect/rc.d/init.d/httpd start Restart HTTPD (apache) : httpd restart View current processes : top Display a file : cat /path/to/filename Editing a file : pico /path/to/filename Domain Name Lookup : fwhois yourname.com Ping IP/Domain : ping domain.com or ping 000.000.000.000 Recompile Apache : /scripts/easyapache (use with caution) Fixing Disk Quotas : /scripts/fixquotas ----------------------- Basic File/Script Locations on the server: Admin control scripts : /scripts Admin control interface : /scripts/admin Web Account Directory : /home/username/ Access/Error logs : /usr/local/apache/logs Domain Access Logs : /usr/local/apache/domlogs Apache Conf File : /etc/httpd/conf/httpd.conf We ask that you use any script on the server with caution understanding that anything you do affects all of your users on the server. If there are any scripts/processes found on this server that breaches the AUP for this service, they will be removed/stopped and you could lose root access to your server. If you have any questions, please, don\'t hestiate to contact our support team. Thanks, Support Team Web Hosting Company', '{{first_name}}|{{dedicated_rack_location}}|{{dedicated_root_password}}|{{dedicated_ipblock_range}}|{{dedicated_main_ip}}|{{dedicated_server_specs}}|{{dedicated_operating_system}}|{{dedicated_server_name}}|');

ALTER TABLE `hosting_order` ADD `server_specs` TEXT NOT NULL , ADD `ipblock` TEXT NOT NULL , ADD `rack` TEXT NOT NULL ;

UPDATE `email_templates` SET `subject` = 'Your Dedicated Server has been Activated and is Ready' WHERE `emid` = '36' LIMIT 1 ;

ALTER TABLE `plan_specs` ADD `in_stock` INT( 5 ) NOT NULL ;

ALTER TABLE `email_templates` ADD `default_email` VARCHAR( 255 ) NOT NULL ;