pmsumner: (Default)
posted by [personal profile] pmsumner at 12:01pm on 27/02/2011 under ,

I recently downloaded and struggled with Tweetnest (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 [personal profile] pipsytip :)]

[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).

Mood:: 'pleased' pleased
location: Ll11
pmsumner: (Default)
posted by [personal profile] pmsumner at 04:08pm on 27/02/2011 under
I was trying to do some stuff with PHP and every time I ran some code through PHP, I got the error:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/suhosin.so' - /usr/lib/php5/20090626+lfs/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0

It's not at all clear what package provides suoshin.so, so if you get stuck and can't find it, just run this at the command line:

sudo apt-get install php5-suhosin

That'll stop the error message from showing up.
location: LL11
Mood:: 'pleased' pleased
pmsumner: (Default)
posted by [personal profile] pmsumner at 04:14pm on 27/02/2011 under ,
day 10 - discuss your first love and first kiss.

My first love was different from my first kiss. The first kiss that I remember was Danielle, I would have been 13 or so, and it was round the back of the English & Home Economics sheds, in the dark :) Not much to say beyond that as I don't remember a huge amount about it.

My first love was Kate. She was gorgeous and sweet and from the Scottish border region. I don't think she ever liked me in the same way *sobs* I had a slow dance with her at a disco and was smitten. Ahh well... good memories :) A bit short on details but I don't remember an enormous amount outside of that.

The rest of the meme )
location: LL11
Music:: The League of Gentlemen
Mood:: 'bored' bored

May

SunMonTueWedThuFriSat
      1
 
2
 
3
 
4
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
31