Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.

Install

cpbadmin edited this page Sep 13, 2010 · 1 revision

General Documentation

In this section you’ll learn the basic installation and system requirements that will allow using this product.

System Requirements

  • Server API: Apache 2.0 Handler
  • Apache Version Apache/2.2.11
  • mod_rewrite enabled
  • mod_headers enabled
  • mod_expires enabled
  • Apache API Version 20051115
  • PHP Version 5.2.8 or greater
  • cURL support enabled
  • MySQL Database Support enabled
  • MySQL Client API version 5.0.51a
  • mysqli.default port 3306
  • ODBC Support enabled
  • Session Support enabled

Installation
h3. Download & Configure CakePHP

Download & install CakePHP 1.2.5

$ curl -o cake_1.2.5.tar.bz2 http://cakeforge.org/frs/download.php/733/cake_1.2.5.tar.bz2/donation=complete
$ tar jxfv cake_1.2.5.tar.bz2
$ mv cake_1.2.5/* /var/www/newd # or your install path
$ cd /var/www/newd # or your install path
$ rm -rf app
$ git clone git://github.com/cpbadmin/newd
$ vi newd/config/database.php

Update database info in the Cake DB configuration file, newd/config/database.php.

var $default = array(
	'driver' => 'mysql',
	'persistent' => false,
	'host' => '[your_db_host]',
	'login' => '[your_db_username]',
	'password' => '[your_db_pass]',
	'database' => '[your_db_name]',
	'prefix' => '',
);

Configure Apache to point to the the webroot directory in newd. This setup will depend on your operating system and system setup. Here’s an example using Apache’s htconf to configure the vhost. On OSX you can configure this in /private/etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80>
        ServerName newd-local
        ServerAdmin webmaster@local
        DocumentRoot /Users/username/Sites/cake/newd/webroot
        ErrorLog /private/var/log/apache2/newd-error_log
        CustomLog /private/var/log/apache2/newd-access_log common

        <Directory /Users/username/Sites/cake/newd/webroot>
                Options FollowSymLinks
                AllowOverride All

                RewriteEngine On
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

        </Directory>
</VirtualHost>

To use that configuration, you’ll need to point the newd-local domain to your machine. You can edit your /etc/hosts file to add this entry

127.0.0.1		newd-local

Import Database

Execute in your mysql console:

mysql> create database newd;
Import /sql/database.sql to your database.

mysql -u [your_db_username] -p newd < newd/config/sql/database.sql

Admin Tool

It is available at http://[site_url]/admin. Use admin/admin to login and change your password.

Add Topics

Topics are the main sections of your site, if you’re tracking pet buzz, your topics might be “Dogs”, “Cats”, and “Llamas”.

Insert topics using admin tool:

Enter a full version of the topic. Example: Dogs

Enter a short version of the topic. Do not use spaces in the name. Use “-” instead. Example: jack-russel

The navIcon is not used in the current release, you can leave it blank.

You’ll need to update the site navigation manually, in views/layouts/default.ctp

<ol id="Nav">
	<li class="dogs active">
		<h1>
			<a href="/">Dogs</a>
		</h1>
	</li>
	<li>
		<a href="/topics/cats">Cats</a>
	</li>
	<li>
		<a href="/topics/llamas">Llamas</a>
	</li>
</ol>

Add Datafeeds (optional)

Newd runs a series of web crawlers that go out into the web and pull back content from data feeds. A data feed can be anything you want, we’ve included feeds for twitter, youtube, Google News, blogs, Bing News, articles. If you would like to create a new one, refer to Ch.3 (Extras).

Add Modules (optional)

Modules are the blocks of content displayed in Newd. They can get their content from a single data feed or they can aggregate several feeds together. The Twitter module grabs it’s content just from the Twitter data feed, while the Articles module pulls in a mix from Bing News, Google News, and Blogs. There are several modules already available: youtube, news, twitter, jobs, freelance. If you would like to create a new one, refer to Ch.3 (Extras)

Add Tags

Tags are used by crawlers to pull in data to be displayed on the site. Each Topic will have can have many tags that the crawlers will use to search the web. If you want the Dogs topic to pull in everything they can find about Labradors and Boston Terriers, those are the tags you’ll want to assign. You can test keywords straight from the web. If a search a Bing News for “Boston Terrier” gives you good results, that tag will probably be right. You can exclude a keyword with a ‘-’ sign in front of the last term.

Here are some examples:

"jack russell" terrier -norwich
labrador
"[phrase]" [word] -[word]

Insert the tags using admin tool:
Enter name. It has to be a meaningful tag definition. See examples above.

Enter the topic_id of the topic that this tag belongs to.

type is not used. Should be set to ‘client’ by default.

rating is not used. Should be set to any 1-4 digit integer.

Enter datafeed_ids. List all datafeeds that this tag should be used with. Example: 1,2,3,4, This entry will make feeds with ids 1,2,3,4 use this tag when it crawls.

Enter status.

Start Crawlers

Reference Section 3.1.5 to learn how to start crawlers. [FEED_NAME] is either new crawler name or existing crawlers listed below.

Existing crawlers:

  • news
  • blogs
  • twitter
  • youtube
  • bingnews

You can make new crawlers. Reference 3.1.

Setup Caching (Optional)

If you’re running Apache 2.2.x it is highly recommended you use mod_cache to cache rendered pages to disk. If you have an older version of apache or do not have mod_cache, you can use the component cache helper. To do so, edit the .htaccess file in [application folder]/[application name]/ and uncomment:

#    RewriteCond %{REMOTE_ADDR} !YOUR_CACHEREPLACEPHP_IP
#    RewriteCond %{DOCUMENT_ROOT}/webroot/cache/$1/index.html -f
#    RewriteRule ^(.*)$ /webroot/cache/$1/index.html [L]

Replacing YOUR_CACHEREPLACEPHP_IP with the IP your webserver would see for a request coming from itself. You’ll then need to run the cacheReplace.php script in the background. Navigate to your [application folder]/[application name]/webroot/cache/ and edit cacheReplace.php changing the internal host reference to be one which will access your site

$localhost = 'http://YOURLOCALHOST';   

Execute:

./cacheReplace.php >> /dev/null 2>&1 &

Setup Permissions

1. Set Permissions on the following folders/subfolders:

Webroot/Cache/ Read-Write
tmp/ Read-Write
2.11 Enjoy!