Friday, June 29, 2007

Debian Installation Instructions
From Newscloud
Jump to: navigation, search

From your SSH shell, the steps below should properly configure your system. For this exercise, we use Debian 3.1 Stable (formerly Sarge). I wrote these instructions using an account at JVDS (StandardLinux1 VPS for $20/mo).

You can also browse our sample configuration files in /static/platforms/debian. We have example files here for php.ini, httpd.conf and custom.conf. We don't recommend copying these but they may be helpful for comparison via diff.
Contents
[hide]

* 1 General System Requirements
* 2 See also
* 3 Configure the NewsCloud environment
o 3.1 Get packages
o 3.2 Install NewsCloud
o 3.3 Configure MySQL
o 3.4 Configure Apache
o 3.5 Configure Smarty
o 3.6 Configure cron
o 3.7 Update the database
o 3.8 Installing mod_gzip compression

[edit]
General System Requirements

* Apache/1.3.33
* MySQL 4.x
* PHP 4.x

[edit]
See also

* Release Notes: These instructions were tested with the January 2007b release.
* NewsCloud Hosting Options

[edit]
Configure the NewsCloud environment

The following procedures demonstrate how to update your Debian packages and configure Apache, MySQL, Smarty, PHP, cron and NewsCloud.
[edit]
Get packages

#refresh debian packages
apt-get update

#install helpful tools
apt-get install sudo
apt-get install apt-show-versions

#set up Apache 1.3, MySQL 4.1x, PHP4, GD, PEAR and Smarty
apt-get install apache
apt-get install mysql-server-4.1
apt-get install libapache-mod-php4 php4-mysql php4-gd php4-pear
apt-get install smarty
apt-get install postfix
pear install HTTP HTTP_Download HTTP_Header HTTP_Request
pear install HTML_Common
pear install HTML_QuickForm

# set up CVS
apt-get install cvs

[edit]
Install NewsCloud

# get newscloud source and database from CVS
# place code in staging directory /code
mkdir /code
cd /code
cvs -d:pserver:anonymous@newscloud.cvs.sourceforge.net:/cvsroot/newscloud login
cvs -z3 -d:pserver:anonymous@newscloud.cvs.sourceforge.net:/cvsroot/newscloud co -P newscloud

# copy the source code from the staging directory (CVS sync location) to the live Apache Web tree
mkdir /var/www/newscloud
cd /var/www/newscloud
cp /code/newscloud/src/* . -r
# copy the .htaccess files too
cp /code/newscloud/src/.htaccess .
cp /code/newscloud/src/static/redirect/.htaccess ./static/redirect

[edit]
Configure MySQL

# set the MySQL password
mysqladmin -u root password 'yourmysqlpassword'
# Import the sample NewsCloud database into MySQL
mysql -uroot -p
create database newscloud;
quit;
cd /code/newscloud/database
gunzip newscloud.sql.gz
mysql -uroot -p newscloud < /code/newscloud/database/newscloud.sql

[edit]
Configure Apache

#Set up a custom.conf file in /etc/apache/conf.d
cd /etc/apache/conf.d
nano custom.conf

Listen 80
NameVirtualHost *

# if you use a different domain, be sure to change the domain used in .htaccess in the root as well as in /static/redirect

ServerName newscloud.com
ServerAlias *.newscloud.com
DocumentRoot /var/www/newscloud/

AllowOverride All



# eventually we will change this in the code base
# but in the meantime you can global replace image.commonmedia.org with your own image.yourdomain.com
#
# ServerName image.commonmedia.org
# ServerAlias image.commonmedia.org
# DocumentRoot /var/www/newscloud/image_files/
#


# Edit httpd.conf in /etc/apache
cd /etc/apache
nano httpd.conf
# Make the changes below

DocumentRoot /var/www/newscloud

Options SymLinksIfOwnerMatch
AllowOverride None


Options Indexes Includes FollowSymLinks MultiViews
Order allow,deny
Allow from all



# Alias /icons/ /usr/share/apache/icons/
#
# Options Indexes MultiViews
# AllowOverride None
# Order allow,deny
# Allow from all
#

# Alias /images/ /usr/share/images/
#
# Options MultiViews
# AllowOverride None
# Order allow,deny
# Allow from all
#



=== Configure PHP ===

# And for PHP 4.x, use:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

# Edit php.ini in /etc/php4/apache
cd /etc/php4/apache
nano php.ini
# Uncomment and modify the following lines
include_path = ".:/usr/share/php:/var/www/newscloud"
extension=mysql.so
extension=gd.so

# Set up include files with api, db keys
# To prevent abuse, we use three include files for installation-specific passwords
# and keys. The three files should be placed one directory above your root directory
# e.g. If you're web server directory for NewsCloud is /var/www/newscloud. Place these three files in /var/www.
cd /var/www/newscloud
cp *.inc ../
cd /var/www
nano dbKey.inc

apiKey.inc



cryptKey.inc

$pwCrypt='your crypt key for passwords here';
$apiCrypt='your crypt key for api calls here';
?>

dbKey.inc

$database='newscloud';
$username='root';
$password='yourmysqlpassword';
?>

[edit]
Configure Smarty

# Set up Smarty directories

cd /var/www/newscloud
mkdir static/smarty/templates
mkdir /var/www/smarty
mkdir /var/www/smarty/templates_c
mkdir /var/www/smarty/configs
mkdir /var/www/smarty/cache
chown www-data:www-data /var/www/smarty/templates_c
chown www-data:www-data /var/www/smarty/cache
chmod 775 /var/www/smarty/templates_c
chmod 775 /var/www/smarty/cache

# Set up Feed Creator Directory
# Feed creator needs a dir called 'rss' at the root of the workspace

cd /var/www/newscloud
mkdir ./rss
chmod 777 ./rss

[edit]
Configure cron

# Copy sample CRON script to your CRON directory
cp /code/newscloud/src/cron/newscloud.cron /etc/cron.d
# Edit newscloud.cron to include your api key from above or cron jobs will fail
cd /etc/cron.d
nano newscloud.cron

#Restart Apache
/usr/sbin/apachectl restart

[edit]
Update the database

# Run the database updates for December 2006 and January 2007
# Point your browser to:
# http://yourdomain.com/static/DBUpdates/Dec2006.php
# http://yourdomain.com/static/DBUpdates/Jan2006.php

# Remember, the default superuser account in the distribution database
# is newsmonkey@gmail.com with password NewsCloud

# Read more on Administrating NewsCloud

[edit]
Installing mod_gzip compression

# Optional: If you want to optimize apache with gzip. Do the following
sudo apt-get install libapache-mod-gzip

No comments: