LaconicaOnDreamhost
From StatusNet
Getting laconi.ca running under non-root Dreamhost account.
(initial rough notes from danbri)
This should work smoothly on DH. You don't even need to download the laconica files it should handle it for you. Just upload the contents of the zip file. You'll be notified if it can't grab the laconica tarball for you but every test I've run on DH so far works. It may even work on other hosts but I haven't tested yet and haven't received feedback. I'd definitely love to hear from anyone trying to use it elsewhere and anyone who gets it to work at all.
The Installer: http://www.gimmesoda.com/laconica_installer.zip The Latest Update: http://www.gimmesoda.com/updated-laconica-installer-installing-073/
~JJ from http://www.GimmeSoda.com
PoojanWagh's experience on 2008-10-15:
PoojanWagh was able to get Laconica installed on his DreamHost web server by running the gimmesoda scripts (which install an old version of Laconica) and then re-installing using the latest from darcs (as of 2008-10-15). The steps are detailed at his blog: http://poojanblog.com/blog/2008/10/laconica-on-dreamhost/
PoojanWagh wasn't able to get XMPP or post-by-email support. He believes that this is not possible on DreamHost's web hosting service. The reason is that XMPP requires a daemon to run. DreamHost limits php processes to 30 seconds of execution. PoojanWagh believes that virtual private server (VPS) is required for this support. Similarly, post-by-email support requires procmail to execute a custom mail handler. DreamHost web hosting no longer supports procmail. It is likely that their VPS service will support procmail.
PoojanWagh has submitted trac ticket #751 for XMPP support without the use of daemons.
Another approach is documented here. http://www.gimmesoda.com/2008/07/05/easyinstall-of-laconica-on-dreamhost/ ... note that it suggests we need a custom install of PHP to do sockets stuff (prsumably the xmpp services?).
The scripts I wrote for the easyinstall of laconica were actually fixed up and finished making it much easier to execute now. You can find the post about there here: http://www.gimmesoda.com/2008/07/18/another-laconica-easy-install-script-update/
- www.gimmesoda.com's install_files.sh are the best on DH !! Thanks a million. (You're welcome!)
And another here: http://apocryph.org/got_laconica_installed_my_dreamhost_account
These steps are NOT STANDALONE. Basically try http://decafbad.com/blog/2008/07/03/getting-laconica-up-and-running and come here when things don't work.
(If you want to pull a fresh copy of Laconica here's HowToSetupDarcsOnDreamhost.)
1. the main Installation notes page plus http://decafbad.com/blog/2008/07/03/getting-laconica-up-and-running is 95% what you need. In particular keep an eye on the former for info like database update scripts. If you get stuck here, check some of the blog posts above, they may help been updated or have new comments.
2. ignore the 'apt-get', and make sure your panel.dreamhost.com settings give you PHP5. It'll be Apache for httpd; so ignore non-http details in the decafbad.com docs.
3. Create your database using the Goodies/MySQL panel not through attempting to use mysql root password on commandline. Set up an appropriate user. You can choose the db name freely, but you'll need to name files in classes/*ini appropriately.
Something like this can work (note that dreamhost DBs are on a different host; see control panel for info)
mysql -pYOURPASSWD -u f2f -h yourdb.example.com yourdbname < db/laconica.sql
4. Get set up with PEAR support. Dreamhost info: http://wiki.dreamhost.com/index.php/PEAR#Installation
This was enough for me:
mysql -pYOURPASSWD -u f2f -h yourdb.example.com yourdbname < db/laconica.sql pear config-create $HOME .pearrc
5. Do the several pear installations needed.
Where decafbad writeup has "sudo pear channel-update pear.php.net" just omit the "sudo" part.
6a. xmpp stuff
The naming practice for the xmpp library seems to have changed; current src in darc needs:
extlib/XMPPHP/XMPP.php (note uppercase filename).
I found "ln -s . XMPPHP" useful, but a subdir would do the job too.
Note that XMPPHP is easily mis-spelled.
Update: apparently we now run with the latest version of this library from svn.
Try 'svn co svn://netflint.net/xmpphp' somewhere then move the XMPPHP dir across into extlib/
6b. To run the xmpp daemon you work on the commandline. A nice gotcha here is that the 'php' binary on your Dreamhost path is probably php v4, and it will whine about syntax errors in lib/util.php or elsewhere.
"/usr/local/php5/bin/php xmppdaemon.php" is probably part of your solution.
6c. create an account update@yoursite.example.com through the DH Control Panel (Goodies, Jabber IM). Make sure the account details match what you have in your config.php
for example:
mysql -pYOURPASSWD -u f2f -h yourdb.example.com yourdbname < db/laconica.sql pear config-create $HOME .pearrc $config['xmpp']['enabled'] = true; $config['xmpp']['server'] = 'foaf2foaf.org'; $config['xmpp']['port'] = 5222; $config['xmpp']['user'] = 'update'; $config['xmpp']['resource'] = 'laconica'; $config['xmpp']['password'] = 'forgetmenot';
7. Your lib/common.php MUST be changed to ensure PEAR files can be found.
Add (with appropriate changes):
mysql -pYOURPASSWD -u f2f -h yourdb.example.com yourdbname < db/laconica.sql
pear config-create $HOME .pearrc
$config['xmpp']['enabled'] = true;
$config['xmpp']['server'] = 'foaf2foaf.org';
$config['xmpp']['port'] = 5222;
$config['xmpp']['user'] = 'update';
$config['xmpp']['resource'] = 'laconica';
$config['xmpp']['password'] = 'forgetmenot';
# set up a non-root PEAR repo (before we need it)
$extra_path = array("/home/path-to-your-stuff/pear/php");
set_include_path(implode(PATH_SEPARATOR, $extra_path) . PATH_SEPARATOR . get_include_path());
...before this bit:
mysql -pYOURPASSWD -u f2f -h yourdb.example.com yourdbname < db/laconica.sql
pear config-create $HOME .pearrc
$config['xmpp']['enabled'] = true;
$config['xmpp']['server'] = 'foaf2foaf.org';
$config['xmpp']['port'] = 5222;
$config['xmpp']['user'] = 'update';
$config['xmpp']['resource'] = 'laconica';
$config['xmpp']['password'] = 'forgetmenot';
# set up a non-root PEAR repo (before we need it)
$extra_path = array("/home/path-to-your-stuff/pear/php");
set_include_path(implode(PATH_SEPARATOR, $extra_path) . PATH_SEPARATOR . get_include_path());
# global configuration object
require_once('PEAR.php');
If it doesn't work, try replacing path-to-your-stuff with the path to your stuff.
8. Don't forget set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib'); ...in your config.php (plus everything else in decafbad writeup)
9. Debugging: uncomment #$config['db']['debug'] = 5; ...in config.php (note that this leaks your mysql password; use sparingly!)
10. In the classes directory, your .ini files need to match the database name
mysql -pYOURPASSWD -u f2f -h yourdb.example.com yourdbname < db/laconica.sql
pear config-create $HOME .pearrc
$config['xmpp']['enabled'] = true;
$config['xmpp']['server'] = 'foaf2foaf.org';
$config['xmpp']['port'] = 5222;
$config['xmpp']['user'] = 'update';
$config['xmpp']['resource'] = 'laconica';
$config['xmpp']['password'] = 'forgetmenot';
# set up a non-root PEAR repo (before we need it)
$extra_path = array("/home/path-to-your-stuff/pear/php");
set_include_path(implode(PATH_SEPARATOR, $extra_path) . PATH_SEPARATOR . get_include_path());
# global configuration object
require_once('PEAR.php');
cp stoica.ini foaf2foaf.ini
cp stoica.links.ini foaf2foaf.links.ini
11. keeping .htaccess up to date Sometimes new features appear via darcs when you 'darcs pull'. Don't forget to do "cp htaccess.sample .htaccess" (or a diff and copy lines by hand if you have custom lines in .htaccess) if you're using Apache to have pretty URLs. Otherwise new stuff will 404 or otherwise malfunction.
Running "diff .htaccess htaccess.sample" after 'darcs pull' is advised.
Known Problems.
The avatar code (and possibly more) uses a function call that is disabled on Dreamhost PHP. It's unlikely that syndication will work before this is addressed. See end of the bug report for how you might help (ie. port a function call to use CURL instead).
In userauthentication.php, you'll see a call to copy()... copy($url, $temp_filename); We can switch to cURL to avoid the Avatar bug by making our own copy function and sticking it at the top of userauthentication.php: function laconica_copy($file, $newfilename) { $out = fopen($newfilename, 'wb'); if ($out == FALSE){ return FALSE; } $ch = curl_init(); curl_setopt($ch, CURLOPT_FILE, $out); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_URL, $file); curl_exec($ch); curl_close($ch); fclose($out); return TRUE; } Now replace the copy($url, $temp_filename); with laconica_copy($url, $temp_filename);
See bug http://laconi.ca/trac/ticket/209 Summary: getimagesize() URL file-access - disabled on Dreamhost PHP
Other bugs encountered on DH installs (though not necessarily unique)
http://laconi.ca/trac/ticket/200 Summary: Redirecting form submissions - Firefox3 warning popup
ERROR 1071 (42000) at line 163: Specified key was too long; max key length is 1000 bytes Which Dreamhost Mysql did not like. Solution is to edit db/laconica.sql for table oid_associations to be InnoDB.
OpenID was failing against HTTPS urls with self-signed certificates. This wasn't clear since ./extlib/Auth/Yadis/ParanoidHTTPFetcher.php didn't log the CURL errors in the message (around line 202): Adding curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0) before curl_exec (two places) fixes this.