MAXdev
INSTALLATION

Installing MDPro

How To Install Modules

A Guide to Upgrading Customized Sites



Installing MDPro

Part 1 - Terminology and Preparation

PLEASE READ ALL OF THIS DOCUMENT BEFORE INSTALLING, UPGRADING OR USING MDPro

About These Instructions

These instructions are not MDPro Installation for Dummies. If you are a dummy, you have no business getting involved with databases. You can think of them as MDPro Installation for the Uninformed if you like.

They were written, however, for those new to databases who are merely ignorant of a few things, will read, can reason, and can follow instructions. They were written by someone who too was ignorant of some of these things. I've written these instructions so as to spare others any aggravation and frustration in installing MDPro and to enable them to get it installed on the first attempt. Consequently, the easiest way of doing things will be covered here. I had problems with the CMS I used before MDP because of inadequate instructions and would like to spare people any similar problems with MDP. You may not even need these instructions as the semi-automated installer in MDP has many details you will need to know, possibly everything you'll need to know.

If you are an advanced user, you may find these instructions too simple for you or may wish to use alternate methods in some areas, such as command line administration of the MySQL server. Do as you wish. These instructions were not written for people at your level of knowledge.

TERMINOLOGY

Before we proceed, you may find it helpful to become familiar with a few basic terms you will see mentioned over and over.

Database - A collection of information stored in a program for easy accessibility. (See field and table.)

One example is the Internet Movie DataBase at http://imdb.com It has a huge database of information about movies and television shows that can be accessed and provide answers in a matter of seconds.

Field - A place for specific information in a database or form, usually designated by type. For instance, this site has a contact form. There is a text field for the sender's name, another for their e-mail address and a text area field for the message. Other field types include date and money (currency), which tells the program how the information should be formatted.

Table - A table is a collection of fields in a database or on a page, usually grouped in the same table because they are all needed for a function or group of functions or because they are related by topic.

MySQL - An open source database program. The SQL stands for structured query language.

PHP, PHP3, PHP4, PHP5 - Hypertext Preprocessor - PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly. Some languages do things, others get things done. PHP is commonly known as the latter of these two. Many PHP programs use a database as a back end (the PHP program does the work up front and MySQL or some other database program collects and keeps the information in the back end.)

phpMyAdmin - A program that acts as an interface (control panel if you will) using PHP to administer MySQL databases. Databases can be complex things to administer and phpMyAdmin makes the job easier.

MDP - An abbreviation for MDPro

PREPARATION

You need to be certain that you have PHP and MySQL available to you. Unless both are installed on the server you use, you will be wasting your time if you proceed any further. If you are on shared server hosting (you rent space on a server and do not have your own server), you may need to check with your host. Do so if necessary.

If your host does not have PHP and MySQL, you will need to either have them add it if they will or find a new host that offers it. If you have your own server, you can download and install them or have someone install them for you.

The easiest way to administer MySQL databases is with phpMyAdmin. If you do not have it installed already, download it and install it. Be sure to check your PHP version number first as later versions of phpMyAdmin require later versions of PHP. Run http://yourdomain.com/info.php to determine the version of PHP you have installed. Alternately, if you have phpMyAdmin installed already, there is a link entitled Show PHP information under the phpMyAdmin heading on the opening page that will reveal the PHP version installed.

Some web hosts offer a control panel that allows creation and administration of databases. If you have and use such a control panel, you can adjust these instructions accordingly.

Download MD SOS. You will find it in the maxdev.com download section. It can help you out of some difficult situations if you make a critical mistake.

You need to be certain that you have GD libraries installed if you wish to use the graphical security code features in MDPro. If you enable this feature and don't have the libraries installed, you can lock yourself out of your site. This is one of the things that MD SOS can fix.

Download Programs

If you need to download any of the three programs, click on their names here and find the version you want on their websites.

MySQL PHP phpMyAdmin

When you have confirmed the presence of all three programs or installed them, you are ready to proceed.

After downloading the current MDPro (MDP) distribution, unzip the file on your server or local personal computer. If you have a robots.txt file, download it and add it to the MDP robots.txt file if it contains any instructions beyond those of the default file from MDP.

If you can create your own databases, click here

If you are on shared server hosting and cannot create your own databases, click here




Part 2 - Creating and Preparing the Database using phpMyAdmin

Part 2 - Creating and Preparing the Database using phpMyAdmin

The biggest problem many people have in installing MDPro is establishing the database connection. It is not enough to create the database. Proper access and usage permissions must be set for it. Some people will have databases created and access set up by their host. This information is primarily for those who have their own servers or virtual servers and may install their own programs, including MySQL, PHP and others. Some people on shared server hosting have a control panel that allows them to create databases. These instructions include them as well as people with their own servers.

This same information will apply to any MySQL databases, not just the one for MDPro. Thus, if you install a forum on your site that uses its own database or any other PHP/MySQL program, the same instructions will make setup easier for you with those other programs.

What you will be doing next is creating a database user name and assigning access privileges to the database for that user.

So as to minimize or eliminate confusion, where a word is to be entered in a field, it is shown here emboldened rather than in "quotation marks". This should eliminate any doubt about including the quotations marks (don't unless they are shown also).

Once you have installed phpMyAdmin and it is working properly, follow these steps to set up a database:

  1. At the phpMyAdmin main page, just under Create new database, enter the name of the database you wish to create and then click on Create. I suggest the default name of mdpro rather than any db names that include a version number. This can prevent confusion from having a database named after an older version while you are using a newer one that has had no database changes. The database name does not change as you upgrade your version of MDP so it makes no sense to include a version number as part of its name. There will never be any doubt or forgetting what program uses that database. If you expect to have multiple installations of MDP, you can preface it with a few initials to indicate its relationship to a particular site, such as dlmdpro, lpmdpro, etc., where the dl and lp are initials for the site names that correspond to their respective databases.
  2. At the phpMyAdmin main page, click on Privileges. You will be taken to the User Overview page. Click on Add a new User.
  3. Under Login Information, for User name enter the MDPro database user name in the field to the right. It may be the same as the server account name and that is a good choice. This same user may have access to other databases (such as forums). In the Host field, use the drop down menu to change the % sign to local. The field to the right will now show localhost (the usual value). In the field below, enter the password you wish to give use. This password is only for access to the MySQL database and is unrelated any other passwords you may have. Enter it again in the second password field. Skip the global privileges and click Go. Use a combination of alphanumeric characters and other allowed characters, vary the case, and make it impossible to be guessed. BigBob2 is a bad password. !52TuvX! is a good one. Once you have your password, write it down! Remember that your password is part of your account security!
  4. You are now taken to the Privileges page. Scroll down to the Database-specific privileges section. It says: Database-specific privileges, In the dropdown menu to the right that says text-field, select the name of the database you created in Step 1.
  5. Click on Privileges. Under database specific privileges, select a database and select SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP. Click on Go directly underneath the Database-specific privileges section.
  6. Click on Home and then Reload MySQL . This is essential for MySQL to recognize the changes you have made. Note that on some systems this does not work and the MySQL server must be stopped and then started to initialize the changes. We have completed our work with phpMyAdmin and setting up the database.
  7. Locate and open the config/md-config.php file as you will need to be familiar with the information in it. It must be a perfect match for the MySQL information. About half way down, you'll see a section that looks like this (except for the color instructions which you should follow)

    $pnconfig['dbtype'] = 'mysql'; do not change
    $pnconfig['dbtabletype'] = 'MyISAM'; do not change
    $pnconfig['dbhost'] = 'localhost'; do not change (unless your system calls for it)
    $pnconfig['dbuname'] = 'root'; change to the database user name you selected in step 3
    $pnconfig['dbpass'] = ''; enter the password you decided on and have written down
    $pnconfig['dbname'] = 'mdpro'; do not change unless you are doing multiple installations of MDPro (see step 1)
    $pnconfig['system'] = '0'; do not change
    $pnconfig['prefix'] = 'md'; do not change
    $pnconfig['encoded'] = '1'; do not change

    When you have finished editing the config.php file, keep it open in a window or write it down. The database name, database user name and password entered in MDP must match the information entered in the database or you will not be able to establish a connection. You will be shown some of this information and enter the rest later on in the installation process. By understanding it now it won't be confusing when you are asked for it later.

  8. If all goes well and no trouble shooting is involved, the hardest part is now over.

Note that the instructions above apply to setting up databases for other programs as well. However, some steps will not have to be repeated when adding other PHP/MySQL programs under the same user name.

Go to Part 3




Part 2 - Creating and Preparing the Database

If you are on shared server hosting and cannot create your own databases:

You will have to have your host create the database for you. The username will likely be your account name, which is also likely to be your login name. Your host will need to know the database name. I suggest the default mdpro rather than any db names that include a version number. This can prevent confusion from having a database named after an older version while you are using a newer one that has had no database changes. The database name does not change as you upgrade your version of MDP so it makes no sense to include a version mumber as part of its name. There will never be any doubt or forgetting what program uses that database. If you expect to have multiple installations of MDP, you can preface it with a few initials to indicate its relationship to a particular site, such as dlmdpro, lpmdpro, etc. where the dl and lp are initials of the site names that correspond to their respective databases.

Your host may also want to know what password you want to use. You are advised to use one that is not a regular word and cannot be guessed at or cracked by a dictionary attack. Use a combination of alphanumeric characters and other allowed characters, vary the case, and make it impossible to be guessed. BigBob2 is a bad password. !52TuvX! is a good one. Once you have your password, write it down! Remember that your password is part of your account security!

  1. Locate and open the config/md-config.php file as you will need to be familiar with the information in it. It must be a perfect match for the MySQL information. About half way down, you'll see a section that looks like this (except for the color instructions which you should follow)

    $pnconfig['dbtype'] = 'mysql'; do not change
    $pnconfig['dbtabletype'] = 'MyISAM'; do not change
    $pnconfig['dbhost'] = 'localhost'; do not change (unless your system calls for it)
    $pnconfig['dbuname'] = 'root'; change to the database user name you selected or were assigned
    $pnconfig['dbpass'] = ''; enter the password you decided on or were assigned and have written down
    $pnconfig['dbname'] = 'mdpro'; leave unchanged unless you are doing multiple installations of MDPro (see above)
    $pnconfig['system'] = '0'; do not change
    $pnconfig['prefix'] = 'md'; do not change
    $pnconfig['encoded'] = '1'; do not change

    When you have finished editing the config.php file, keep it open in a window or write it down. The database name, database user name and password entered in MDP must match the information entered in the database or you will not be able to establish a connection. You will be shown some of this information and enter the rest later on in the installation process. By understanding it now it won't be confusing when you are asked for it later.

  2. If all goes well and no trouble shooting is involved, the hardest part is now over.

Note that the instructions above apply to setting up databases for other programs as well. However, some steps will not have to be repeated when adding other PHP/MySQL programs under the same user name.

Go to Part 3




Part 3 - Uploading and Establishing the Database Connection

Uploading

With the database and database user name created, rights and access privileges assigned, and the config.php file information decide upon, we are ready to upload files to the server.

Location of MDP files on server

All the files and directories in the MDP html directory should be in your web root directory on the server (unless you decided to install MDP in a subdirectory). This is known by various names, including document root directory. The directory structure varies a bit too. On Red Hat Linux systems (up to 6.x), it would be /home/your loginname/www/. On other systems it is htdocs or public_html. Still others have different directory names and structures.

If you have an index.htm (or index.html) page that says something like "future home of yourdomain" when people go to yourdomain.com, or you have an existing site with a home page (the one visitors see first) , the web root directory is where this page would be located. Whatever it is called (let's say it's www), is where you want to put all the files and directories in and under the html directory when you unzip MDPro. You can FTP the whole lot at once by selecting them all for the transfer. See Appendix A for details.

Note: Servers have a file that determines priority in loading for files named index. according to their extension. On the two thirds or so of the servers running Apache, that is the httpd.conf file. For instance, on many servers, the loading priority order is index.html, index.htm, index.php, index,.cgi. This means that you can install MDP in your document root directory and configure it without other people seeing it unless you want them to by adding a link to index.php from your index.htm or index.html page. Should you decide to make your MDP home page your site's home page, you only need to delete the index.htm and index.html (and any other index pages other than index.php) from your document root directory.

Check with your host if you need to determine the loading order of index files on your server. Some even use default.htm instead of index.htm so you may want to ask unless you are certain or can determine it on your own.

Upload the files to your account.

2. As per the instructions, chmod (change permissions) the config.php and config-old.php to 666 (rw-rw-rw) See Appendix B for details.

WARNING - You could install MDP running under the root user, but it is not advisable to do so for security reasons.

3. Now you are ready to begin the installation process. MDPro has a fully graphical installation process. Go to http://www.yourdomain.com/install.php and it will begin automatically. If you installed MDP in a directory other than your document root directory, you will need to include that directory name in the URL.

Example, if you installed MDP in a directory named mdp, you would enter http://www.yourdomain.com/mdp/install.php in your browser to begin installation.

4. 0% The first selection is choosing the default language. A large number of languages is provided for the installation process. See the downloads section first and support forums second if you need another language. Additional language packs can be added at any time. Select your preferred language and click on Set Language

5. 20% This step consists of reading and acknowledging the license terms. Click on Next.

6. Chmod check (30%) is a check of permissions for the config.php and config-old php files. If you set them correctly, the program will know and you can proceed. If you did not set them properly, you'll need to do so before you can continue. When you get the green check marks, click on Continue.

7. 40% The next step is where you review the information shown in the config.php file. Click on Submit

Now we go back to the open config.php file. Depending upon your server configuration, you may need to enter only the database user user name (typically your login in name) and database password.

     
Database Host localhost do not change (unless your system calls for it)
Database Username root change to the database user name you selected or were assigned
Database Password   enter the password you decided on or were assigned and have written down
Database Name mdpro do not change unless you are doing multiple installations of MDPro
Table Prefix (for Table Sharing) md do not change
Database Type do not change
     
     

 

8. Database Information 50% This step reviews the information, gives you a chance to change it, and asks you to choose between New Install and Upgrade. Click on New Install.

9. New Install 60% The following step shows that same information and gives you the opportunity to have MDP create the database. It is not necessary as you have already created it (or had your host create it for you). Do not check the Create the Database box. Click on Start.

10. 70% This is the step where you either have to determine what needs to be changed or you start dancing with joy. If you were successful, you'll see the database name was created such as {MD Pro was created) and a long list of installed parts underneath it. If successful, click on Continue.

11.Setting Your DB Preferences 80% The next screen asks you to input the Adm. name, Adm. login, Admin password, e-mail address and URL. Do so and click on Set Login. Write them down so you have a record of them should you forget. Note that the administrator name and password are for MDP and can and should be different than the database user name and password.

12. 90% The next screen shows the parts updated by the login. Click on Finish.

13. 100% The next screen shows the credits for those developers who have contributed to MDP. After you read them, click on Go to your MDPro site below.

14. You will now see your site with one of the themes included with MDP

15. Do as the reminder says and remove the install.php file and install directory.

16. Login as the admin. Once logged in, you may click on Administration and begin configuring your new MDPro site.

17. Enjoy. Now the work really begins, but at least it will be fun!

Alternate installation method

Instead of downloading MDP and unzipping on your local PC, put the compressed file (.tar.gz) or .zip) on your server and unpack (uncompress) it there. If you have an existing robots.txt file, download it before uncompressing MDPro. Download the config.php file and the .sql file. You can connect to your server via an SSH session using a free program like PuTTY or shareware like SecureCRT.


Common Installation Errors

config.php and config-old.php not world-writable - these files need to be writable by the webserver process during the install/upgrade to ensure that certain configuration parameters are stored. The install procedure should check for this and inform you if the files are not writable. Note that once the install/upgrade has been completed these files can be reset to read-only.

Problems creating or populating the database - this is often due to incorrect MySQL privileges on the database. If you are unsure if this might be the case then try to access your MySQL database manually with the username and password that you have and attempt to create a database and table to ensure that the user exists, has a correct password, and is able to carry out the operations that MDPro needs for installation.

Problems logging in - this is normally due to access the MDP site with an unqualified host name e.g. http://localhost/index.php or a domain name e.g. http://foo.com/index.php MDPro requires that the site name is fully-qualified e.g. http://www.foo.com/index.php Instructions on setting up a fully-qualified hostname for your local server can be found on the MDPro documentation site at http://maxdev.com Alternatively you can set the 'intranet' option when installing or upgrading MD Pro, which will allow you to run MDPro without a fully-qualified domain name but without the ability to filter cookies from similar domains. In most cases where MDPro is run like this it should not be an issue, however setting your site to run as an intranet site when it is directly connected to the internet is not recommended.

Appendix A

Location of MDP files

  http://www.yourdomain.com
transfer or unpack these MDP files and directories to ----->

path to above:

/home/your loginname/www/ (as an example)

docs
images
includes
install
javascript
language
modules
pnadodb
themes

admin.php
backend.php
banners.php
config-old.php
config.php
error.php
footer.php
header.php
index.php
install.php
mainfile.php
modules.php
pntables.php
print.php
referer.php
robots.txt
user.php
xmlrpc.php

 

Appendix B

chmod

Many FTP programs include Unix commands like chmod. In WS_FTP LE. Select (highlight) config.php and config-old.php. Right click. A menu will pop up. Select chmod (UNIX). A remote file permissions menu will come up. Select (check) read write, read write, read write as below.

666 Permissions 

Owner  Group  Other
Read X X X
Write X X X
Execute


seen as rw-rw-rw- when viewed in a directory listing



How To Install Modules

Installing modules in MDPro is easy and there are still some things you should know about the process

1. Download the module package and open it on your local hard drive. Distributions of most programs are in a compressed format using either the .zip or .tar compression format. Often both formats are available. Some compression utility programs such as WinZip can uncompress both format types.

One reason you should uncompress it locally first is that there is no way of knowing what the top directory is otherwise. There is no standard for this and no way to get third party modules to adopt it if there were. Below are three examples that are commonly seen,. There are others.

Example 1
Example 2
Example 3
This example is probably the best structure as it identifies the module name. You would transfer the contents of the modules directory to your modules directory in your MDP installation. This example is also a good structure. You would transfer the contents of the modules directory to your modules directory in your MDP installation. This example starts with module directories and files with no top directory at all. You need to create the module directory name
  • Module Name
    • modules
      • module_directory_ name
  • modules
    • module_directory_ name
  • images
  • lang
  • templates
  • admin.php
  • user.php

2. Read the installation information on the module in question. Some modules have atypical installation methods and you may have to perform other tasks beyond a normal installation to get them to run.

3. Read the configuration information on the module in question. Some modules have no administrative interface (they will not appear in the admin menu) and any configuration is handled by editing certain files. Even some modules with an administrative interface have some functions that are edited manually.

4. Once you have determined the information above, you can upload the files to your MDP installation. There are a couple of ways you can do it.

5. Go to your MDPro administration menu, go to Modules (probably under Settings if you use the organized menu), and click on Regenerate. You will see the new module listed. Click on Initialize and then Activate.

6. For modules with an administrative interface, if you are using the organized admin menu, click on Administration and then Edit (at the bottom of the page). You will need to assign the module to one of the tabs. Select the proper one according to your desires and save. The icon will now appear in the selected section.

7. Perform any atypical functions some modules require according to their instructions, such as initializing or populating the database.Some modules require that you chmod (change permissions) on specified files or directories.

8. Configure modules with an administrative interface as required and desired.

9. Add a link to the module on your menu so that your users may access it.

10. Set permissions for the module as you desire.

11. Check it as a user and make sure you have configured it properly and that it operates as expected.




A Guide to Upgrading Customized Sites

This guide is for those who have customized their MDPro sites and do not wish to lose those changes upon upgrading. Those changes could be anything from custom icons and other images to code changes. The standard upgrade method is sure to wipe out some or all of those customizations. The methods below have been designed to preserve your efforts in customizing your site.

Preparation

First of all, you should have your changes documented. Our Tips page mentions this very important step. If you have custom images such as topic icons, you should have a separate zipped package of them for safekeeping.

Next, open the upgrade package on your local computer. If you have any code changes on your list, make them in the upgrade package unless they have already been integrated or there are substantial code changes (such as from MDP 1.072 to MDP 1.1). Delete any images that would replace the custom ones on your site.

Check your list twice or as many times as necessary in order to be sure you made all the requisite changes when appropriate.

Uploading files

Once you have reviewed and revised the upgrade package, you upload the new files to your server. Alternately, you may compress them (using Winzip or some other compression utility program) upload the entire compressed package, and uncompress it on the server.

You might want to preserve the old directories and files by renaming then, An easy way it to rename them putting a 1- in from of the name. This allows you to keep the prior version in case there is some reason you may need to revert to it.

New distributions

At times the changes in a new distribution are so extensive that there is no upgrade package and an entire distribution must be installed. In such cases we have an additional step. Follow all the steps above. Create a directory, mdp for example, and upload the entire distribution into this directory. You can perform the upgrade from this directory. Assuming all goes well and your custom changes have been retained (except where the code has changed), create a directory named mdpOLD, move your present (prior) installation into this directory and then move the contents of the mdp/ directory up to the root level. When you are satisfied that there is no longer a need for any of the files in the mdpOLD directory (such as some image files you may have forgotten about), you should delete the directory.

Hacks and other refinements

If you have any, please post them on the forums (code hacks) or submit them to the downloads sections (images). Code improvements may be included and make it easier on upgrades as they won't have to be repeated. New icons can provide alternatives to the standard set included with the distribution. MDPro has been improved by many such contributions from users.