how to install OJStat in cPanel, OJStat installation guide

OJStat installation is very easy for those with access to cPanel. Before I explain how to install OJStat, allow me to remind you that OJStat is not designed to record statistics for journals hosted on different domains.

OJStat Installation

OJStat installation is divided into three steps, namely:

  1. Creating Database
  2. Uploading OJStat, and
  3. Installation

Note that the installation process requires access to cPanel and the file manager where you place your OJS files because OJStat must be installed directly in the root OJS directory.

Creating Database

First of all, you have to create an empty database via cPanel. In creating this blank database, you are free to name the database but I suggest that the database name is descriptive enough so that you can easily identify it, especially if you have many databases.

  1. Login to the cPanel account where you host your OJS.
  2. Go to the Databases menu and create an empty database with a sufficiently descriptive and easily identifiable name that it is the database for OJStat. Write down the name of the database in a text editor such as Notepad.
  3. Scroll down the page and create a user for the database you just created. Don't forget to write down the username and password. Make sure that the database password does not contain a dollar sign ($) otherwise OJStat will read the password as a variable and will cause the OJStat system failure.
  4. Scroll down the page until you get a form to connect the database and users for that database. Make sure to connect the correct user with the correct database. For Previleges settings, select All.

When finished creating the database and connecting to the database user, go to the PHPMyAdmin menu to view the database hostname. Thus, you have 4 database credential information:

  1. Database name
  2. Database user name
  3. Database user password
  4. Database host name

This database credential information for OJStat is required for OJStat to work. All this information will be entered into the OJStat authentication file located in the auth folder (db.php file).

Uploading OJStat

Now, we enter the second step, which is to upload OJStat into the root directory of OJS. Therefore, you have to go into the file manager to access the OJS directory. If you host OJS on a subdomain, then you need to go to the Subdomains menu and select your OJS subdomain.

  1. Create a folder with the name ojstat. The folder name cannot be changed. This folder must be in the OJS root directory and cannot be in any subfolder.
  2. Upload the latest version of the OJStat compressed file into the ojstat folder you just created.
  3. Extract the zip file in the ojstat folder. You can delete the zip file after extracting it.
  4. Open the db.php file in the auth folder (ojstat/auth/db.php).
  5. In the file there are four variables whose values are still empty and you must fill in the database credential information that I explained in the previous step. Remember that the values of all four variables must be in quotes.
  6. Save the file changes and close the db.php file.

Installation

By default, OJStat is set to open a Setup option which you can close after the OJStat installation process is complete.

Your OJStat URL is (.com is just an example):

Domain: https://yourjournal.com/ojstat/ Subdomain: https://yourjournal.yourmainweb.com/ojstat/
  1. Access your OJStat URL. You will see a Setup button next to the login and reset buttons.
  2. Click the Setup button to take you to the Setup page.
  3. You will be presented with information about the structure of your OJStat database. Scroll down the Setup page until you get to the installation button.
    • For OJStat under version 1.3: Click the Initialize button then click See Changes and click Start Upgrading.
    • For OJStat version 1.3 and higher: Click the Fresh Installation button, then click Refresh, and Click Upgrade.
  4. You can see the database operation information directly on this setup page.
  5. Make sure that the installation process is successful. You can tell by seeing that all operations get a green check mark.
  6. You can now close Setup options by editing a file:
    • For OJStat versions below 1.3: version.json
    • For OJStat version 1.3 and up: json/package.json
  7. Change "setup" value from true to false.
  8. Save the file changes and close the file.
  9. Return to the Setup page and click the Login button.
  10. You will be directed to the OJStat Login page. You can now login using admin as username and password. You must immediately change your username and password after successfully logging in.

Those are the steps for installing OJStat. If you upgrade OJStat, you can perform the same steps without creating a new database. All you need to do is change the auth/db.php file and continue with the Setup process.