Mac OS X Installation Instructions
From Newscloud
Download the NewsCloud Source Code
Visit the Source Forge Project Page to download the source code and initial database (via ZIP download or CVS). CVS server is cvs.sourceforge.net, path is /cvsroot/newscloud.
You can unzip the folder into the directory for your Web server. I use /Users/jeff/Sites/newscloud
System Requirements:
* PHP 4.3.10-15 * Apache/1.3.33 * MySQL 4.0.24
Set Up Your Development Environment on Mac OS X
CheekyGeek suggests trying out Mac AMP (MAMP):
- For those wanting to get a look at it in a local environment and access to a Mac OS X machine, take a look at MAMP. It installs a separate Apache 2.0, PHP, MySQL in the OS X Applications folder. After installation, you can choose to use PHP5 or PHP4 (4 is required for NewsCloud).
Configure your host file Add an entry to /etc/hosts for NewsCloud running locally
127.0.0.1 www.newscloud.local
Setup Apache as your Web Server and PHP
Turn on OS X native Apache ("Personal Web Sharing")
System Preferences -> Sharing -> Personal Web Sharing -> Stop/Start
Get the location of the Apache config file. Open Terminal and type:
httpd -V
Look for -D SERVER_CONFIG_FILE="/etc/httpd/httpd.conf" and edit this file.
sudo nano /etc/httpd/httpd.conf
Uncomment the lines:
"LoadModule php4_module libexec/httpd/libphp4.so" "AddModule mod_php4.c"
Then you need to make changes to your php.ini file. Under OS X, php.ini file is not mandatory, so you need to create a new one from a template. Copy the template and rename it:
"sudo cp /private/etc/php.ini.default /private/etc/php.ini"
Now edit php.ini
sudo nano /private/etc/php.ini
Modify the include path to add the location that you put the NewsCloud source
include_path = ".:/php/includes:/usr/share/php:/Users/jeff/Sites/newscloud/"
Next we need to set up virtual directories in the Apache config file. This will allow apache to work with NewsCloud page redirection system.
Again, I use /Users/jeff/Sites/newscloud
OS X partitions out a user-specific apache config file:
/private/etc/httpd/users/*yourusername*.conf
Edit this file to include the lines:
sudo nano /private/etc/httpd/users/jeff.conf
NameVirtualHost 127.0.0.1:80 <VirtualHost 127.0.0.1:80> DocumentRoot /Users/jeff/Sites/newscloud ServerName www.newscloud.local ServerAlias www.newscloud.local <Directory /Users/jeff/Sites/newscloud > AllowOverride All </Directory> </VirtualHost>
Note: You will need to make sure that apache has permissions to your local CVS workspace, including +r +x on all dirs leading up to the path. On my system I had to change the "~/Sites" folder ("chmod 755 ~/Sites"). You can leave the UID and GUID as they are.
Then, restart Apache. I find using System Preferences works best:
sudo apachectl restart Or, Sys Pref -> Sharing -> Personal Web Sharing -> Stop/Start
Put a test PHP file in the directory you set up and make sure http://www.newscloud.local goes there from your browser. e.g.
<?php phpinfo(); ?>
When you move the downloaded NewsCloud source code to your Web hosting directory, double check that the .htaccess file is copied properly to root
Setup MySQL as your database server
Install MySQL version 4 branch
http://dev.mysql.com/downloads/mysql/4.1.html
Install both 'mysql-standard-4.1.XXX.pkg' and 'MySQLStartupItem.pkg' Doubleclick 'MySQL.prefPane' to add start/stop controls to System Preferences
Log in to MySQL and create an empty database called newscloud.
Then, import the database...
Run command from DB download location:
gunzip newscloud.sql.gz mysql -uUsername -p newscloud < newscloud.sql
Run mysql as root (sudo mysql) to add user accounts (must do this AFTER you restore)
GRANT ALL PRIVILEGES ON *.* TO 'yourname'@'localhost' IDENTIFIED BY '*YOURPASSWORD*' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '*SERVERPASSWORD*' WITH GRANT OPTION;
SET PASSWORD FOR root@localhost = OLD_PASSWORD('*SERVERPASSWORD*');
It's important to run the last line, as there are compatibility issues with PHP4.
Setting up Required Include Files
# Set up newscloud.ini include file (changed from earlier versions of separate .inc files) # To prevent abuse, we use this include files for installation-specific passwords # and keys. This file should be placed one directory above your root directory # e.g. If you're web server directory for NewsCloud is /var/www/newscloud. Place this file in /var/www. cd /var/www/newscloud cp newscloud.ini ../ cd /var/www nano newscloud.ini
[db] database="newscloud" username="yourusername" password="yourpasswd" hostname="" [crypt] pwCrypt="anystrongstring" apiCrypt="anystrongstring" // if you want to use edit group amazon features amazonAssociateId="commonmediaor-20" // or your associate id amazonKey="youramazonkey" [api] apiKey="yourapikey"
Set up Feed Creator Directory
Feed creator needs a dir called 'rss' at the root of the workspace
mkdir ./rss chmod 777 ./rss
mkdir ./cache chmod 777 ./cache
Set up PEAR Modules
Then you need to install PEAR and make sure you have all the packages that NewsCloud requires to run.
Here is a link for setting up PEAR on OS X.
PEAR Installed packages: ========================================================= Package Version State Archive_Tar 1.1 stable Console_Getopt 1.2 stable HTML_Common 1.2.2 stable HTML_QuickForm 3.2.5 stable HTML_QuickForm_Controller 1.0.6 stable HTML_QuickForm_SelectFilter 1.0.0RC1 beta HTML_QuickForm_advmultiselect 1.2.0 stable HTML_Template_IT 1.1 stable HTTP 1.4.0 stable HTTP_Download 1.1.1 stable HTTP_Header 1.2.0 stable HTTP_Request 1.3.0 stable Mail 1.1.10 stable Net_Socket 1.0.6 stable Net_URL 1.0.14 stable Net_UserAgent_Detect 2.0.1 stable PEAR 1.3.6 stable XML_RPC 1.4.0 stable
Note: We don't have GD (image library) installed on our local development machine. If you know of an easy way to install this on Mac OS X Tiger for development, please post it here.
