Comments Plugin Self Host

IndexSetup



where is it

This page covers the steps necessary to set up both the server and client side of the plugin. These instructions apply only if you are hosting the database and scripts on your site.


Things you need to begin the installation

You need to have access  to your site and its directory and software to proceed with the installation. These are:

  • An access to your web server (via shell or FTP)
  • A text editor
  • A way to upload files to your server, ie. an  FTP Client
  • Your web browser of choice

Installation steps

Important: You should have already downloaded and installed FCPlayer on your web server before you begin this installation. If you have not, you may download it here.

Here's the quick version of the instructions, for those that are already comfortable with performing such installations. More explicit details follow.

  1. Download and unzip the Comments plugin package, if you haven't already.
  2. Create a database for the comments plugin on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.
  3. Open comments/config.php in a text editor and fill in your database details as explained below.
  4. In config.php,  fill in your administration details as well, as described below.
  5. Upload the comments folder and place it in the plugins directory of your FCPlayer installation. You will be replacing the existing commnets folder.
  6. Open FCPlayer/config/FCPlayerConfig.js with a text editor and add "comments/plugin.js" to the list of plugin scripts.

That's it! The comments plugin should now be installed.


Step 2 Details: Creating the database in mysql

We have provided instructions for setting up the database using cPanel, phpMyAdmin, or using the mysql client. In general, if you do not maintain your own web server, you will be using either cPanel or phpMyAdmin, or perhaps you can contact your network administrator to set it up for you. If you run your own server, you can just as well use the mysql client directly.

Using cPanel

If your hosting provider uses cPanel, you may follow these instructions to create your Comments username and database.

  1. Log in to your cPanel.
  2. Click MySQL Databases.
  3. If a user relating to WordPress does not already exist under the Users section, create one:
    1. Chose a username for the comments database ('comments' is good) and enter it in the UserName field.
    2. Choose a difficult-to-guess password (ideally containing a combination of upper- and lower-case letters, numbers, and symbols), and enter it in the Password field.
    3. Write down the username and password you chose.
    4. Click Add User.
  4. Create the comments database:
    1. Choose a name for your comments database ('comments' or 'fcplayercomments' are good), enter it in the Db field, and click Add Db.
  5. Under Databases, select your comments username from the User dropdown, then select your comments database from the Db dropdown. Make sure All is checked under Privileges, then click Add User to Db.
  6. When you return to the main MySQL Account Maintenance screen, cPanel will list information about the database you just created. You should see the username you just added to the database (with ALL PRIVILEGES), as well as a few sample Connection Strings for you to use in Perl or PHP scripts to connect to the database. The PHP code will have the following format:
$dbh = mysql_connect("hostname", "username", "<PASSWORD HERE>") or die ("message");
mysql_select_db("databasename");
Write down the values of hostname, username, databasename, and the password you chose. (Note that hostname will usually be localhost.)

Using phpMyAdmin

If your web server has phpMyAdmin installed, you may follow these instructions to create your comments username and database.

Note: These instructions are written for phpMyAdmin 2.6.0; the phpMyAdmin user interface can vary slightly between versions.

  1. Create the comments database:
    1. Choose a name for your comments database ('comments' or 'fcplayercomments' are good), enter it in the Create new database field, and click Create.
  2. Click the Home icon in the upper left to return to the main page, then click Privileges. Create a new user for the comments database:
    1. Click Add a new User.
    2. Chose a username for the comments database ('comments' is good) and enter it in the User name field. (Be sure Use text field: is selected from the dropdown.)
    3. Choose a difficult-to-guess password (ideally containing a combination of upper- and lower-case letters, numbers, and symbols), and enter it in the Password field. (Be sure Use text field: is selected from the dropdown.) Re-enter the password in the Re-type field.
    4. Write down the username and password you chose.
    5. Leave all options under Global privileges at their defaults.
    6. Click Go.
  3. Return to the Privileges screen and click the Check privileges icon on the user you've just created for the comments database. In the Database-specific privileges section, select the comments database you've just created under the Add privileges to the following database dropdown. The page will refresh with privileges for that database. Click Check All to select all privileges, and click Go.
  4. On the resulting page, make note of the host name listed after Server: at the top of the page. (This will usually be localhost.)

Using the MySQL Client

You can create MySQL users and databases quickly and easily by running mysql from the shell. The syntax is shown below and the dollar sign is the command prompt:

$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON databasename.* TO "commentsusername"@"hostname"
    -> IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
Bye
$

The example shows:

  • that root is also the adminusername. It is a safer practice to choose a so-called "mortal" account as your mysql admin, so that you are not entering the command "mysql" as the root user on your system. (Any time you can avoid doing work as root you decrease your chance of being exploited). The name you use depends on the name you assigned as the database administrator using mysqladmin.
  • comments or fcplayercomments are good values for databasename.
  • comments is a good value for commentsusername but you should realize that, since it is used here, the entire world will know it too.
  • hostname will usually be localhost. If you don't know what this value should be, check with your system administrator if you are not the admin for your comments database host. If you are the system admin, consider using a non-root account to administer your database.
  • password should be a difficult-to-guess password, ideally containing a combination of upper- and lower-case letters, numbers, and symbols. One good way of avoiding the use of a word found in a dictionary, uses the first letter of each word in a phrase that you find easy to remember.

If you need to write these values somewhere, avoid writing them in the system that contains the things protected by them. You need to remember the value used for databasename, commentsusername, hostname, and password. Of course, since they are already in, or will be, shortly, in your config.php file, there is no need to put them somewhere else, too.


Step 3 Details: Filling in the database details in config.php

Open comments/config.php  in a text editor.

Find the section labeled:

 //Database setup

Fill out the following fields:

DB_NAME

The name of the database you created in the last section .

DB_HOST

The hostname you determined in the last section (usually localhost).

DB_USER

The username you created in the last section.

DB_PASSWORD

The password you chose in the last section.

This is an example of a default config.php, you will need to replace the default values in your copy of this file with your own specific database settings.

//The name of the database.
define('DB_NAME', 'YourDatabaseNameHere');

//The database host. Usually 'localhost'.
define('DB_HOST', 'localhost');

//The user account to access the database.
define('DB_USER', 'YourUserNameHere');

//The password for this account.
define('DB_PASSWORD', 'YourPasswordHere');

For additional information on the config.php file, see Explanation of the options found in config.php


Step 4 Details: Filling in the administration details in config.php

Open comments/config.php  in a text editor.

Find the section labeled:

 //Comment administration

Fill out the following fields:

USERNAME

Your administrative account name, for instance 'admin'.

PASSORD

A password for your administrative account.

ADMIN_EMAIL

An email address, in the event that you wish to receive email notifications for newly posted comments and abuse reports. This field is not required.

This is an example of a default config.php, you will need to replace the default values in your copy of this file with your own specific settings.

define('USERNAME', 'admin');

define('PASSWORD', 'yourpasswordhere');

define('ADMIN_EMAIL', 'youremailhere');

For additional information on the config.php file, see Explanation of the options found in config.php.


Step 6 Details: Adding the plugin script to FCPlayerConfig.js

Go to your FCPlayer folder installed on your web server. Open FCPlayer/config/FCPlayerConfig.js  in a text editor.

Find the section labeled:

 //Plugin scripts to load into the player
	pluginScripts:[
	    "defaultplugins.min.js",
		"customplugins.js"
	],

The pluginScripts array shown above contains a list of scripts to be loaded into the player when it starts up. We need to add the comments plugin script. Add it to the front of the list, like this:

//Plugin scripts to load into the player
	pluginScripts:[
            "comments/plugin.js",
	    "defaultplugins.min.js",
		"customplugins.js"
	],

At this point, the installation is complete. Go on to the next section Loading the comments plugin into FCPlayer




If you have a pre-sales question, submit your inquiry via our sales contact page. For general, non-sales inquiries, contact us at support@fastcatsoftware.com.

Solution Graphics