Useful Resources for sNusers

Print This Page
Installing sNews:  Main  Install 1.4  Install 1.6 or 1.5  
Server Installation:  Install XAMPP-XP  
Databases:  For sNews  SQL Files  Multiple Installations  
Installing sNews 1.6 or 1.5

Installing sNews 1.6 or 1.5

Updated: September 01, 2008

Before installing

The first step, of course, is to download the lastest copy of the sNews version available from the Official sNews Downloads Page to a (suggested) new folder named sNews 1.6 (if its sNews 1.6) within a new sNews CMS directory on your hard drive. Then, un-zip it into the same folder. From now on, this will be your source for fresh files when you need them. I hope you installed the XAMPP server package on your own PC, as recommended on the Main Page, and have it running properly. If not, do it now... you'll find it very convenient to run sNews on your own localhost environment before going online!


OFFLINE Installation: Open two small Windows Explorer panes on your desktop. In one pane, locate the htdocs directory in your xampp directory. The htdocs folder is the root directory on your offline (home-based PC) server. It serves the same purpose as the root directory on a remote (online host) server. In the other pane, locate your un-zipped sNews folder. Copy that folder and paste it into the htdocs folder. This is now your project folder.

View the contents of your new project folder in your htdocs directory. You should see five files. Double-click on the readme.htm file to open it in your IE browser. This file tells you how to install your package - read it over a couple of times. You have already done the first part of Step 1. It says to "CHMOD 777 the folder where you'll upload your image (eg. img)". But... when you look in your project folder... you won't find an img folder. Create one now, as this is where sNews saves the images you upload from the Admin Images Panel. Don't worry about chmodding it - this is not necessary and cannot be done in a WinXP OS environment. Chmodding - changing the folder permission settings - is only required when you upload your site to your host's Linux-based server.

ONLINE Host Server Installation: You do not need to go through the Offline (localhost) installation steps above but if you enjoy working on and test running your projects BEFORE going online, then you will have already done it. And, if you have a good free FTP utility installed on your machine - like FileZilla and you have it set up... uploading your files to the host server is a cinch. But... before we upload anything...

Setting up the Database

Step 2 in the readme.htm file provides you with the data required to create the tables in your database. Unfortunately, this step does not tell you what to do with it. You need to copy the script into the Query Panel in phpMyAdmin and then run the query to create the tables.

You can also use it to create a MySQL Import File. To make this easy, I have already created Import Files you can download using the links at the bottom of the Making an SQL File page.

Configuration Settings

Open the snews.php file in a reliable Code Editor. This file is the sNew Engine and it contains all of the functions that will make stuff happen in your sNews site. Take a minute and look over the DATABASE VARIABLES section, near the top of the file. This section contains the PHP variables that will connect sNews with the tables in the database you created.

One thing to remember... when you are editing any of the following variables, only edit or insert text within the single quote-marks to the right of the equals sign. If you change any other part of the active code, the affected line will no longer function. If need be, you can add any comments after the double slash (grey text) as the double slash disables anything that follows it on the same line. The variables we'll work with are displayed in the next box below. I've provided examples for both offline and online configurations.

$db['website'] = 'http://localhost/sNews16/'; // your domain name
$db['dbhost'] = 'localhost'; // name of your database host, usually localhost
$db['dbname'] = 'snews16'; // name of your database
$db['dbuname'] = 'root'; // your database user-name
$db['dbpass'] = ''; // your database password, if any
$db['prefix'] = ''; // prefix to database table names, if any

$db['website'] = ''; // CHANGE to your real domain name
$db['dbhost'] = 'localhost'; // name of your database host, usually localhost
$db['dbname'] = 'snews16'; // database name - including your account username if necessary
$db['dbuname'] = 'root'; // database username - including your account username if necessary
$db['dbpass'] = ''; // your database password, if any
$db['prefix'] = ''; // prefix to database table names, if any

['website'] - This is where you insert the full URL path to your website. If this is an offline (your PC) installation, and you have installed your site folder as instructed, the path shown above is fine as-is. For offline use, the www is replaced with locahost because your host server is... local (not on the web). If you were using this file online (your host's server), then you would replace http://locahost/sNews16 with taking care to make sure the forward slash stays in place on the end. Leaving it off would be unhealthy.

['dbhost'] - Again, with an offline installation, leave the name as localhost. If you are using this file online, you would replace localhost with the name of your database host, if it is different. Most Linux/Apache based servers also use localhost, but there are some that use a different name. Check with your host if you aren't sure what it is.

['dbname'] - Insert the name of your database here. As an example, if you called your database snews1 when you created it, then you would insert snews1 in here.

['dbuname'] - Again, with an offline installation, leave this one as it is since this is the default database username with your XAMPP installation (unless, of course, you changed this). If installed online, then you would insert the username you used when you created your database.

['dbpass'] - Again, with an offline installation, leave this one empty since you most likely did not create a database password. If installed online, you would have created a database password for your online database, and you would insert it here.

['prefix'] - This one can be confusing. It is not used to add something to the name of your database. It is used - only when necessary - to add something to the name of your database tables to make them unique. There are two reasons to use a prefix. One - for increased security or, Two - for multiple installations within the same database. Let me explain further.

Increased Security - As freely-circulated applications like sNews become popular, hackers begin to take notice and look forward to the challenge of getting into databases... to gain access to user login information as one example. A hacker can download and examine the application (sNews for instance). If your tables use the default names in an online installation, and a hacker gets into your database, the rest is history. So, by changing the name of the articles table, for example, to xloz_articles adding the prefix xloz_ to the table name makes it more obscure.

Multiple Installations - Let's say you want to run three different snews installations within your domain and you want to have separate sets of tables for each, but your host only gives you one database. You can do this within one single database by creating a different SQL file for each, adding the prefix to all instances of the table names to make each set of tables different. This is necessary, of course, because you cannot have two tables with the same name in the same database.

You would add the prefix to all instances of the table-names within the .sql dump file before running it on the new database, so that the new tables would be created with the prefix. Then you would insert that prefix - xloz_ (using the same example) - in between the empty single-quotes in the variable above.

Save the file when you are done. It is now time to view the Home Page.

Learning to Use It

The Home Page - If you followed all of the steps as described, your offline installation should be ready to view. Provided, of course, you have your Apache and MySQL servers running. You should be able to bring the Home page up by typing (for a localhost installation) http://localhost/sNews16/ in the address bar.

Logging In - Once you have the Home Page in view, your next step is to log in. Click the Login link in the bottom left corner of the page. Enter test in the username and password fields (the default settings). Take a moment to look over the Administration Panels that come into view once logged in.

You are now on your own! - From Here, you are now ready to explore and learn how sNews works. Before doing anything else, create your first category using the Add new link. Then create a short one or two line article under that category using the Add new link beside Articles. Then click the Home link in the top-right corner of the page. This should get you started without getting wierd messages.

Need some more help? If you haven't done so yet... spend some time learning how sNews works over at the sNews Help Center over at the Official sNews site. You can also register and become a member of our friendly sNews Community Forums.