TT Web Site Manager How to install the TT Web Site Manager (2)
How to install the TT Web Site Manager (2)

Step 1 Set up the database.

Your copy of the TT Web Site Manager will require a database to be set up on your MySQL server. It will also require a MySQL user to be set up with rights to the database and the relevant permissions to allow the TT Web Site Manager scripts to do their stuff.

Creating a database and a user on your MySQL server is beyond the scope of this document. Both subjects are covered in detail in the MySQL documentation as well as in a multitude of MySQL books so you are advised to look at those sources if you are the MySQL server administrator, or to your MySQL administrator if you aren't.
Most ISPs who provide access to a MySQL database will create a MySQL user to go with your account and provide you with the database access and user details.

You may want to consider the rights you give to your MySQL user. The TT Web Site Manager will need a user with at least SELECT, INSERT, UPDATE and DELETE rights. In addition, if you are using the TT Web Site Management scripts to create and modify table structures you may also want to grant CREATE, DROP and ALTER rights to your user. However you may want to be cautious before you let these rights loose as their misuse can cause havoc.

Step 2 Set up database access variables in PHP files

In step (1) you created a database and a user. You will now need the name of the database, the username and password of the user and the hostname of your MySQL server to tell the TT Web Site Manager how to get at the database. If you open the build.php, install/config.php and tt/poptasticdb.php files with a text editor you will see 4 variable definitions at the top of each file as in the example that follows:

# MySQL connection settings
$tt_host="My_MySQL_server's_hostname_or_IP_address";
$tt_user="My_user_name";
$tt_password="My_password";
$tt_database="My_database";

Edit these variable definitions in all three files to the values appropriate for your database and save the files. The two sets of variable definitions will now have something like this ficticious example:

# MySQL connection settings
$tt_host="192.168.1.42";
$tt_user="ttuser";
$tt_password="w23Hsx9A";
$tt_database="websitedata";

Step 3 Copy the files to your www server and configure the subdirectory path.

Copy build.php, ttbuild_lang.php, the install folder and the tt folder with their contents into the web visible directory on your web server that you wish to serve your web site from. This is usually the document root but can be almost any web visible subdirectory.

If you are installing build.php in the web root of your server you can proceed to the next stage. However if you are running the TT Web Site Manager from a subdirectory there is a further configuration step to be performed before you can continue. After the first public release of this software it became clear that running build.php from the web root imposed some limitations on its use. For example, someone whose web space was a subdirectory of someone else's domain, perhaps in the form http://domain/~username, could not use the TT Web Site Manager in this way. As a result the build script was modified to allow pages to be correctly resolved when build.php is put in a subdirectory.

If you have no need to run build.php from a subdirectory or run several different TT Web Site Manager sites from within one web space then you need not perform the following steps.

On line 15 of build.php you should find the following code:

$tt_subdir = "";

This variable represents the subdirectory of the web root in which the TT Web Site Manger's build script has been placed. Because the default placement is in the root of the web tree its default value is the empty string, however if build.php lives in a subdirectory this variable should be edited to reflect this.

Edit this line to include the sub directory path if needed. Include a leading slash but not a trailing slash. For example if the build script is in http://domain/foo, the line of code should look like this:

$tt_subdir = "/foo";

If your build.php is changed in this way, set up your TT Web Site Manager site with a base URL reflecting the path to build.php including the subdirectory path. On the TT Web Site Manager site management page edit the details of your site with the full path.

In the case of our example site above, the base URL would be http://domain/foo

Step 4 Run the install scripts.

Point your browser at the install folder in your web server's root. For example if your server is http://localhost, point your browser at http://localhost/install. This should give you a menu with two options, Create database tables and Create an admin user. Click on "Create database tables". This script creates the eleven TT Web Site Manager tables and lists the tables in the database. If it is unable to create the tables, it returns an error message for each table it could not create.

Once you have created the tables, go back to the install menu and click on "Create an admin user". This script creates a TT Web Site Manager admin user. It will only do this if no other admin users have been created, i.e. if this is a fresh installation. To create your admin user, fill in the required details in the form. There are 4 boxes, "Full name" in which you can enter your full name, "Username" in which you must enter your desired username, "Password" in which you must enter your desired password and "Confirm password" in which you must enter your desired password again. Click on the "Create this user" button to create the admin user. If there are any form errors or it detects that a user has already been created it displays an error and does not create the user.

Once you have run these two scripts, creating the TT Web Site Manager database tables and admin user, Delete the /install directory and its contents from your web server. This is very important, to leave these files on your server could be to compromise its security.

How to install the TT Web Site Manager (1) Contents To redirect or not to redirect?