Publish a Website

Article Index

Create a Website

In order to create your first Onpub-powered website, you must first make sure Onpub is installed and functioning correctly. To verify this, login to Onpub and make sure there are no warnings displayed on the Dashboard page. If all appears well you are ready to create a website powered by Onpub.

In order to create a new website in Onpub, follow the steps below.

  1. Place your mouse pointer over the New drop-down menu and select Website.
     
  2. On the New Website page that comes up, enter the name of your website in to the Name field and click Save to continue. Once you click the Save button, your new website will be saved to the Onpub database. You should then see a screen similar to the one pictured below.
     
  3. Fill in the fields accordingly for your own website. Below is a detailed description of what should be entered in to each field.

Name

The name of the Onpub website. The frontend uses the value of this field to display the site's name in the browser's title bar, the "Copyright" line in the frontend's footer section, the site's RSS feed, and so on. Also, if you haven't uploaded a logo image for your website, the value of this field will be displayed in the site's header until a logo image is uploaded and selected.

URL

The top-level fully-qualified URL of the Onpub website's home page, excluding the name of the default index file. For example, if your Onpub website is hosted on a server with the address www.example.com, you would most likely set the value of this field to: http://www.example.com/ or http://example.com/ depending on how your web server is configured. This field is required for generating article links in the auto-generated RSS feed for your site.

Images Directory

The path to the folder/directory where image file uploads should be saved. The Onpub image uploader will not function until this field has a valid filesystem path defined. The path you enter here should exist on the same server that Onpub is installed on. Also, the path/directory needs to be writable by the web server user, otherwise the files you upload will not be able to be saved to disk. You will be unable to define a custom logo image file for your website until this field is defined. Some valid path examples for this field might be: C:\inetpub\wwwroot\images, /var/www/images, and so on.

Images URL

The fully-qualified URL path to the directory where your image uploads are available for download. The Images Directory field defines where to store image uploads on disk. This field defines where to find your image uploads through a web browser. An example of a valid input for this field would be: http://example.com/images/. This URL should map to the same on-disk directory/folder as defined by the Images Directory field described above. Both this field and the Images Directory field need to be defined correctly for Onpub's image upload and editing features to be fully functional.

Once you've filled in all the fields for your site, make sure to scroll to the bottom and click Save to write your changes to the database.

Activate the Frontend

Now that you've created an Onpub-managed website, the next step is to configure the included frontend layout so that it can display your new site and any content you may have already created within the management interface.

Perform the following steps in the root of your Onpub install directory:

  1. Create a blank file called: onpub_conf_local.php
  2. Open the onpub_conf_local.php file in your favorite text editor and paste in the following code:
<?php
// Example onpub_conf_local.php file.

// Onpub frontend MySQL connection settings.
$onpub_db_host = 'localhost';
$onpub_db_name = 'onpub';
$onpub_db_user = 'username';
$onpub_db_pass = 'password';

// etc..
?>

The above configuration variables tell the frontend how to connect to the MySQL database containing the Onpub schema you installed the first time you logged in to the content management interface. Replace the values of the above variables with your real connection details. For example, replace 'username' and 'password' with your real MySQL account username and password.

This is the minimum frontend configuration required to publish the contents of an Onpub-managed website using the included frontend layout.

Point your browser to http://localhost/onpub/index.php (replace localhost with the actual domain and/or IP address of your web server if it is not running locally) and you should see your Onpub-managed content rendered in an easy to navigate, standard website layout.

You have now published your first Onpub-powered website! Now you are ready to start creating more content to share with your site's readers. As you publish more content via the Onpub management interface it is automatically displayed by your site's frontend.

Configure the Frontend

Onpub includes a default frontend configuration file named onpub_conf.php. This file defines various configuration variables that tell the frontend how to connect to the database, what CSS and PHP files to include, and more.

In order to modify the defaults in onpub_conf.php, first create a blank file in your Onpub installation directory named: onpub_conf_local.php

Configuration variables of the same name set in onpub_conf_local.php automatically override the defaults that are set in onpub_conf.php. Putting your config customizations in to a separate file allows you to easily keep your frontend configuration changes intact when upgrading to new releases of Onpub.

Paste variable names along with their new values in to your onpub_conf_local.php file to override the default values set in onpub_conf.php. For example:

<?php
// Example onpub_conf_local.php file.

// Onpub frontend MySQL connection settings.
$onpub_db_host = 'localhost';
$onpub_db_name = 'onpub';
$onpub_db_user = 'username';
$onpub_db_pass = 'password';

// Override the default home page article ID.
$onpub_disp_article = 2;

// etc..
?>

All Frontend configuration options..