From RNWiki
Revision as of 18:37, 5 September 2009 by JakeC (talk | contribs) (FTP Files to Remote Server)
Jump to: navigation, search

Prepare/Install the Database

Due to the varied and diverse control panels and host setups that are out there, you are required to manually create the database that will hold all of the tables needed for this application. In summary, you must:

  1. Create a new database using whatever method your host has provided for you to do this.
  2. Create a database username and password with the permissions required to create tables and access your database (e.g., select, insert, update, delete).
  3. Associate the username you just created with the database that you just created.

The above steps are usually accomplished through a combination of a control panel, such as cPanel, and/or a tool such as phpMyAdmin.

Make sure that you take note of the complete database name as well as the username and password; this information will be necessary in the next step for allowing RavenNuke™ to connect to your database, complete the installation process, and to run your site.

Example of a cPanel Setup (Detailed Steps):

If your host provides cPanel, here is an example that walks you through the setup of a new database. Your screens may not look exactly like this, but the functionality should be the same.

For this example, we will assume that your site name is ravensite.com and your host username is raven. That means that your database name and database username will automatically be prefaced by raven_. This is an important point to remember. Let us get started.

First, log into your cPanel account. Depending on individual hosts, here again, there could be several ways. One very common way is to use your site url like this: http://www.ravensite.com/cpanel. You will be prompted for your host userid/pass to login to cPanel. After getting logged in, you should see somewhere on your screen an image like this. Notice, I have highlighted the MySQL image, as that is what you need to select.

CPanel-1.png

After you select the MySQL image, you will be presented a screen with database and user information for your MySQL setup. We are interested in the following area of this screen which is highlighted. Here you type in the name of your database and click Add Db.

CPanel-2.png

Now you need to create a username and password that will have access permissions to the database. Down towards the bottom of the screen you will see an image like this. Add a username and a password. Note that most hosts limit the username to 7 characters, so be warned. Then click Add User.

CPanel-3.png

You are almost done :). Only one step left. You have created a database, a username, and a password. But, because you could have many databases and users, you need to tell MySQL which database to associate with which user. In the previous step, where you added/created the database, is where you also will do this association. Scroll back up towards the top and find this area again. Note that a different area is now highlighted. You must select the username and the database name from their respective drop down boxes and then click Add User to Db.

CPanel-4.png

For this example, let us assume that you created the following from the steps above.

  • Database Name = nukedb (Your database name will probably be raven_nukedb as I mentioned above)
  • Database Username = nukeusr (Your database username will probably be raven_nukeusr as I mentioned above)
  • Database User Name Password = nukepass

This information must be remembered for use in the next step as you will add it to a file called config.php.

Prepare/Install the Files

Obviously, since you are reading this, you have unpacked the RavenNuke™ distro, most likely on your desktop PC. If you have SSH access to your remote host, you may have been able to unpack it directly on your server. In summary:

  1. Modify the config.php file with the proper settings, including the database information from the previous step.
  2. Modify the rnconfig.php file to configure any add-ons (may be done later too).
  3. If not already on the remote server, FTP all the files under the "html" directory to your remote server.
  4. Verify files on the remote server.

Modify config.php File

You now need to edit the config.php file and supply the MySQL settings with the database name, username, and user password that you created in the previous step, along with a few other settings.

Right now, the config.php should look like this starting at or near line 59 (Note that the line numbering may change from release to release):

 $dbhost = 'localhost';
 $dbuname = 'rnuser';
 $dbpass = 'rnuser';
 $dbname = 'ravennuke';
 $prefix = 'nuke';
 $user_prefix = 'nuke';
 $dbtype = 'MySQL';
 $sitekey = 'SdFk*fa2rnv21076v28367-dm56w69.3a2fDS+e9';
 $gfx_chk = 7;
 $subscription_url = '';
 $admin_file = 'admin';
 $tipath = 'images/topics/';
 $display_errors = false;
 
 /*********************************************************************/
 /* The configuration options for RavenNuke(tm) have been moved to a  */
 /* separate file here:                                               */
 /*********************************************************************/
 require_once INCLUDE_PATH . 'rnconfig.php';
             

Each of these configuration options are defined below in more detail. Change these to your desired settings or as stated (required).

$dbhost
This is the MySQL server name as defined by your host. The most common is localhost so there should be no need to change this. Some hosts require a domain name. Check with your host to be sure, or if you are unable to connect to the database in the next step.
$dbuname
Database username from previous step (nukeusr). Some hosts require that you prefix the username with your control panel username. In other words, if your database username is "nukeusr" and your control panel username is raven, then the $dbuname would be raven_nukeusr and not just nukeusr. This is host specific.
$dbpass
Database password from previous step (nukepass).
$dbname
Database name from previous step (nukedb). Some hosts require that you prefix the database name with your control panel username. In other words, if your database name is "nukedb" and your control panel username is raven, then the $dbname would be raven_nukedb and not just nukedb. This is host specific.
$prefix
The prefix is added to all the tables in your database from previous step. There really is no reason to change this unless you want to or need to, to avoid a naming clash. The SQL installer used in the next step will take care of prefixing your tables with this value.
$user_prefix
This should ALWAYS be the same as the $prefix setting unless you are serving up more than one nuke site from the same database. This allows you to use certain tables across several nuke sites.
$dbtype
If you are using any version of MySQL, leave this setting alone. It IS case sensitive.
$sitekey
This key is used in the creation of the graphics check for sign-ons. CHANGE it from its default value for security sake. You only need to change a few of the characters, but you can change as many as you like.
$gfx_chk
This configures when the graphic security code is displayed for the various login screens. In order for this to work, you need to have GD extension installed (check with your host if you are unsure and/or experience issues with the security code):
0: No check
1: Administrators login only
2: Users login only
3: New users registration only
4: Both, users login and new users registration only
5: Administrators and users login only
6: Administrators and new users registration only
7: Everywhere on all login options (Admins and Users)
NOTE: If you are not sure set this value to 0
$subscription_url
If you manage subscriptions on your site, you must write here the url of the subscription information/renewal page. This will be sent by email if set.
$admin_file
This is the administration panel filename; it is "admin" by default for "admin.php". If you rename the actual filename (i.e., admin.php), you MUST change this $admin_file value to the new filename (without the extension .php). For example, by default the $admin_file is set to "admin" and the actual filename is "admin.php". If you change the actual admin.php filename to raven.php, then you must also change $admin_file to "raven". Be aware that third party add-ons normally expect this to be "admin", so changing it can break most older version add-ons.
$tipath
Path to where the topic images are stored. This should not need to be changed.
$display_errors
Debug control to see PHP generated errors. When set to false, even though the errors are not displayed on the screen, they will be written to the web server error log depending on the $error_reporting setting in rnconfig.php (discussed later on in this page).
false: Do not show errors
true: See all errors ( as defined in rnconfig.php ) - Note: Setting this to TRUE should only be done while testing/debugging your scripts. It should NEVER be set to TRUE in a production environment as it can expose information that could compromise your site.

This should do it for the config.php file.

Be sure the save the file!

In addition to the above, honorable mention should be given to the following:

$AllowableHTML
This array controls what HTML will be allowed to be entered into the various pages. The version that is in RavenNuke(tm) allows for more granular control of which HTML tags and attributes are allowed. The first array element is for the HTML tag itself, but then each tag may have additional attributes defined as arrays themselves. Be careful what you add, though, as you do not want to open yourself up to a XSS attack.
$CensorList
This array controls how PHP-Nuke will censor words. The words in this list will be replaced by asterisks.

Modify rnconfig.php File

There are additional settings within the rnconfig.php file. These may be optional for your setup until a later time, but it is good to still read through what each of these are. Since the contents of the rnconfig.php file have grown quite a bit, rather than replicating those here, what follows are explanations for each variable that you can configure within this file:

$error_reporting
Depending upon what you are needing / trying to debug, set this value based on the instructions above it in the rnconfig.php file. It comes with a default of show all errors, but no notices (of course, ONLY if $display_errors in config.php is set to "TRUE".
$loglevel
Rnconfig now also contains a variable called $loglevel which can be used to generate a text file with all sql queries that are executed or just sql queries that generate errors. The default setting $loglevel=0 will not generate any log entries. $loglevel=1 will generate entries only for SQL errors. $loglevel=2 will generate entries for all SQL queries. To set up logging you need to create a directory called rnlogs beneath your nuke root directory. Then create a file called dblog (no extension). You also need to be using the mysql.php file in the /db directory. If you have the $dbtype variable set to "MySQL" in your config.php then you are using mysql.php and can proceed. (Most users are using this but you should check). Finally, set the permissions on the dblog file to 666 on unix systems.If you elect to utilize the logging feature, then we strongly recommend that you regularly review the dblog file using your CPANEL or VDECK file manager or any text editor that has access to the file in Windows. Use $loglevel=2 only in a single user development environment . Loglevel=2 is not a set it and forget it type of setting. Loglevel=1 can be used in most settings but you should still periodically review the file. If you are generating SQL errors it is definitely something that requires looking into or you can post them on Ravenphpscripts forums to seek assistance.
$modGFXChk
Each of the modules named in this array have had a captcha applied to them to help fight spam (note that we did not say "stop"!). This array allows one to set when to present the captcha, or not at all. The comments in the rnconfig.php file should be explanatory enough on how to set this.
$advanced_editor
The nukeWYSIWYG editor (FCK 2.6.3) is now fully integrated into key modules and admin functions within RavenNuke™. RavenNuke™ now comes with this editor turned on by default. To turn it off system-wide, change the "1" to "0". Also, as stated in the comments, one can turn this on/off by module, by simply adding this line towards the top of the module´s index.php script and setting it to "0" or "1" as desired.
$uploadpath
This is use to override the default uploads/ folder used for storing files uploaded through nukeWYSIWYG via FCKeditor's filemanager. This should have a slash at the beginning and a slash at the end (e.g. '/files/') and is relative to the URL without subdirectories
$AllowableHTML
This is use by the check_html() routine to determine which HTML tags and attributes should be allowed. All others are stripped out. These are essential for the proper operation of the editor, but also to help secure your RavenNuke™ system from unwanted XSS attacks!
$bypassNukeSentinelInvalidIPCheck and $bypassInstallationFolderCheck
When you try to access your site after completing the installation steps, RavenNuke™ checks to see if your IP is 127.0.0.1 (localhost) and also checks to see if you have removed or renamed the INSTALLATION folder to keep anyone from reinstalling and overwriting your database and setup. In order to make testing and debugging easier, these two settings were added to the rnconfig.php file to allow you to override these two safety checks. Of course you should only set them to TRUE in your testing environment and NEVER in production. In Production, $display_errors, $bypassNukeSentinelInvalidIPCheck, and $bypassInstallationFolderCheck should always be set to FALSE.
TegoNuke(tm) ShortLinks
The next four TegoNuke(tm) ShortLinks options are used to control that add-on feature. This feature may be used if you desire to have shortened internal links such as "downloads.html" or "forums.html" rather than the full" modules.php?name=Forums" link. In the past, this has been known as "GoogleTap" or "GT-NExtGEn". Please see the RavenNuke_README.txt file within the Distro directory AddOnFiles/TegoNuke/ShortLinks for more information as to what this feature is and how to control it with these settings. There are several steps documented in this readme file -- such as copying settings from the ShortLinks.htaccess file to your main htaccess file -- that must be completed for shortlinks to work properly. If you attempt to use shortlinks without completing these steps you will get errors on your site.
useDynamicTitles
Dynamic Titles is a method of providing search engines more description page titles based on the module that is being crawled. The basic PHP-Nuke page titles are of the form "SiteName - Module Name". Dynamic Titles would give you something more like "SiteName - Article Topic - Article Title". Set this value to "TRUE" to turn "on" Dynamic Titles and "FALSE" to turn it off.
$forceLowerCaseUserName
This setting is used on new registrations ONLY. If set to TRUE, the system will force to lowercase the entered username. If set to FALSE, it will work as PHP-Nuke does normally, in that the username will not be "touched".
nf_CONVERTENCODING
For nukeFEED™ - Some sites may use non-UTF-8 databases created with multi-byte languages. If you see strange characters when view a feed preview on the block, preview page or auto-discovery links, you may disable UTF-8 encoding by setting nf_CONVERTENCODING to false
nf_ENABLEUPDATECHECK
For nukeFEED™ - This needs an explanation...
Pagination Control
Variables here control pagination (a new feature) within the news module. Possible settings are documented in the file. Feel free to experiment based on the needs of your site.
$useBoxoverWithnukePIE
Determines whether to display full HTML description of an RSS block feed item (now using nukePIE™) as Boxover tooltip /popup (true) or a text-only description as title tag on the feed link (false).
$statisticsExcludeList
Add usernames as additional array elements where you wish to exclude the gathering of site statistics while these users are logged in. Usually desired by those who are admins who wish to not skew their site statistics by their own accesses.

FTP Files to Remote Server

For a quick recap, the MySQL settings, based on your database setup (example) in the previous step, should now look like this (using our example values):

$dbhost = "localhost";
$dbuname = "raven_nukeusr";
$dbpass = "nukepass";
$dbname = "raven_nukedb";

WARNING: If this is NOT a fresh installation and you are overwriting an existing domain, be careful in what you overwrite. For example, you may not want to just overwrite config.php, .htaccess, .staccess, etc.

FTP ALL of the unzipped files contained in the "html" folder to your root web folder, usually "www" or "public_html", but do not FTP the html folder itself unless you intend to install this in a sub-folder named "html". For example, let us assume your root site folder is "public_html". If you FTP just the contents of the "html" folder, then you will be able to access your site by this url: http://www.YOURSITE.com . However, if you FTP the entire "html" folder, then to access your site you will need to use http://www.YOURSITE.com/html, which is probably not desireable.

Lastly, if on a *nix host, use your FTP client to change the permissions on the .htaccess, .staccess, and ultramode.txt files to 777. These permissions are required now in order to complete the installation and setup; once the installation and setup are complete, we will change these back to something more secure.

Verify Files

Many problems arise from an incomplete or corrupt FTP process; this is one of the first things to check if you end up having issues later on in the installation process. You may also wish to remove any index.php or index.htm file in the root of your RavenNuke™ folder. You should have only one "index" file and it should be "index.php".