Installation Instructions

Article Index

Install the Prerequisites

Onpub can be installed on any operating sytem that meets the minimum System Requirements.

If your system is missing any of the requirements, please install them before you continue with the Onpub installation. Provided your system meets the minimum version requirements for both PHP and MySQL, Onpub should work with the default installation settings for both MySQL and PHP.

Download and Unzip Onpub

Make sure you've downloaded the latest version of Onpub. The most recent version can always be found on the home page.

Once on the page, click Download Onpub and save the resulting ZIP file to your hard drive. Once the download completes, extract the Onpub ZIP file to the root of your web server's public HTML directory. For example, this directory is located by default at C:\inetpub\wwwroot on Windows/IIS, /var/www/html if you use Red Hat Linux, or /var/www if you use Ubuntu Linux. Consult your web server or web hosting documentation if you are unsure of where to place PHP and other website files on your system.

Once you've unzipped the Onpub download to your web server's public HTML directory, you can move on to the next step to setup a MySQL database for use with Onpub.

Onpub Directory Structure

Unzipping the Onpub download ZIP file results in the following file/directory hierarchy:

  • onpub/: The root of the Onpub install. Also known as the Onpub installation directory.
    • onpub/api/: Contains all the necessary files for using OnpubAPI.
    • onpub/api/yui/: Contains the latest release of Yahoo!'s YUI library.
    • onpub/frontend/: Contains the default frontend layout files.
    • onpub/local/: Directory is empty by default. Place custom frontend include files here.
    • onpub/manage/: Contains the content management interface files.
    • onpub/index.php: The frontend index file.
    • onpub/onpub_conf.php: Frontend configuration file.

Create a MySQL Database

Onpub requires a MySQL database to store the websites you will be creating. In order to setup a MySQL database for use with Onpub, do the following:

  1. Open the MySQL Command Line Client from Start > All Programs > MySQL > MySQL Server (Windows only) or start up the MySQL client program by typing the following in a Terminal/Command Prompt (All OSs):
    • mysql -u root -p
  2. You should now be prompted to enter the MySQL root password. Enter the password and you should be logged in to the MySQL command prompt.
     
  3. Execute the following command in the MySQL prompt to create the Onpub database:
    • CREATE DATABASE onpub CHARACTER SET=latin1 COLLATE=latin1_general_ci;
  4. Execute the following command (make sure to replace 'user' and 'password' with a username and password of your own choosing) in the MySQL Command Shell to create a MySQL account (you will be using this to log in to the Onpub content management interface):
    • GRANT ALL ON onpub.* TO 'user'@'localhost' IDENTIFIED BY 'password';

Provided the above two MySQL commands were successful, you should now have a MySQL database and account we will be using to complete the Onpub installation.

Specify the Default MySQL Host

If your MySQL server is installed on the same host as your web server, you can skip this section.

By default, Onpub attempts to connect to a MySQL server running on localhost (127.0.0.1) when you login to the content management interface.

If your MySQL server runs remotely, then perform the steps below to configure Onpub to talk to the remote database server.

To change the hostname/IP address of Onpub's default database host, follow the steps below:

  1. Open the file onpubgui.php in the onpub/manage/ directory 
     
  2. You will see the following line near the top of the file: define("ONPUBGUI_PDO_HOST", "localhost");
     
  3. Change localhost to the hostname or IP address of the MySQL server you want Onpub to connect to instead

Alternatively, you can comment out the whole line so that it looks like:

//define("ONPUBGUI_PDO_HOST", "localhost");

The above will cause the Onpub login screen to show a Hostname field, which allows you to specify your MySQL server's hostname prior to your login attempt.

Login to the Content Management Interface

Load the following URL in your web browser to login:

http://localhost/onpub/manage/index.php

Replace localhost in the above URL with your web server's hostname if you are not running Onpub locally.

The login screen has 2 input fields called Username and Password. Here's what should be entered in to each field in order to login:

Username

Type in the name of the MySQL user account that has access to the database created in the section above.

Password

Type in the the MySQL account password for the user name entered in to the field above.

Once you've entered the correct login info, click the Login button and you will be able to connect to any of the databases that your MySQL account has access to.

Install the Database Schema

When you connect to a MySQL database with Onpub for the first time, be sure to click the Install the Onpub database schema link on the Dashboard page to install the Onpub tables in to the connected MySQL database. You will not be able to publish a website with Onpub until you perform this step.

With the database schema installed, you are now ready to Publish an Onpub website.