Tweet Nest in Ubuntu 10.04 LTS


I recently downloaded and struggled with Tweet Nest (http://pongsocket.com/tweetnest/).  It requires some components that weren't installed by default in my Ubuntu install and the setup scripts don't do some nice things that it could do (i.e., set up a back-end database for you).

I first of all tried to get it working in my public_html directory which was a minor disaster and didn't work at all (I think this is related so suphp and I don't know anything about that though).  I moved everything to /var/www/ and it worked slightly better (i.e. I didn't get prompted to download a file every time I went to http://laptop/tweetnest/).

[EDIT 1: Ahhah, I have now found out that the reason it didn't work in user space was that by default PHP is disabled in user's "public_html" directories.  This needs editing in the Apache PHP5 configuration file:

http://www.weblogism.com/item/266/php-not-interpreted-in-public_html-in-recent-ubuntu-update

It's working now, and I have two instances of Tweet Nest running, one for me and one for :)]

[EDIT 2: OK it wasn't quite working.  The ReWriteRules weren't working properly, month, search & favourite links were giving a 404 error.  Solve by the solution in this post http://ubuntuforums.org/showpost.php?p=2321933&postcount=12 - put 'ReWriteBase /~username/tweetnest/' into the .htaccess]

So here is my step-by-step guide to getting Tweetnest working.


  1. Ensure all the packages required are installed.  As best I can tell (I'd recently installed cacti and think some of the errors in the Apache log were down to that), these were:

    • apache2 (and it's dependencies)
    • php5 (and it's dependencies)
    • libapache2-mod-php5
    • php5-curl
    • mysql
    • mysql-administrator
    • php5-mysql
  2. Enable mod_rewrite:
    sudo a2enmod rewrite
  3. Restart the apache2 daemon:
    sudo service apache2 restart
  4. Create the back-end database that Tweet Nest will use to store it's data and grant privileges to a user that will only exist within mysql:

    1. mysql -u root -p
    2. Enter your mysql root password
    3. create database tweetnest
    4. grant all privileges on tweetnest.* to tweetnest@localhost identified by 'TWEETNESTPASSWORD';
      (don't forget to set your own password)
    5. flush privileges;
    6. quit;
  5. Download and unzip Tweetnest into your web server's directory structure. I did it to '/tweetnest/'
  6. Change ownership of these files to www-data (may not be necessary?)
    chown -R www-data\: /var/www/tweetnest
  7. Point your web browser to http://ip_of_server/tweetnest/ - hopefully the setup page will appear (if it doesn't, try putting 'setup.php' on the end of the URL)
  8. Fill in the details requested, including your tweetnest mysql username and password specified above (tweetnest), the database name (tweetnest) and generally leave the table prefix alone.
  9. Also fill in the config password option or you'll have to do the next few steps from the command line.  While not difficult, why make life difficult for yourself?
  10. Then visit: http://ip_of_server/tweetnest/maintenance/loaduser.php & wait for it to complete
  11. Next, go to http://ip_of_server/tweetnest/maintenance/loadtweets.php & wait for it to finish
  12. You should now be able to go to http://ip_of_server/tweetnest/ and your tweets will be there
  13. To make Tweet Nest update automatically, a cron job can be used.  Create a file in /etc/cron.d called "tweetnest".  In it, put the following 2 lines:

    • 25 3 * * * www-data php /var/www/tweetnest/maintenance/loaduser.php
    • 25 4 * * * www-data php /var/www/tweetnest/maintenance/loadtweets.php
    • Be sure to edit the times and path to be appropriate for your installation.


If any of these steps don't work, look in the appropriate log file (probably the steps that won't work will be Apache related so do a 'tail /var/logs/apache2/error.log' and check what it's saying is wrong).

Comments

Popular posts from this blog

Data Guard with Transparent Application Failover (TAF)

RMAN-05531 During RMAN Duplicate from Active Data Guard Standby

Data pump - "ORA-39786: Number of columns does not match between export and import databases"