Archive for March, 2010

A Few Notes for Building PHP 5 on DreamHost PS

The information here is being used to overwrite the original PHP install on a DreamHost PS, mostly because I want to enable SOAP and XMLRPC.

Since the OS is currently Debian Etch I need to download, compile, and install xmlrpc-epi:

http://xmlrpc-epi.sourceforge.net/

I want to enable SOAP so I modified the configure command to use:

‘./configure’ ‘–prefix=/usr/local/php5′ ‘–datadir=/usr/local/php5/share’ ‘–localstatedir=/usr/local/php5/var’ ‘–enable-sockets’ ‘–enable-fastcgi’ ‘–enable-bcmath’ ‘–with-pear=/usr/local/php5/lib/pear’ ‘–with-mysql=/usr’ ‘–enable-calendar’ ‘–with-mhash=/usr’ ‘–with-kerberos’ ‘–enable-force-cgi-redirect’ ‘–with-config-file-path=/etc/php5/cgi’ ‘–with-imap’ ‘–with-imap-ssl’ ‘–with-gd’ ‘–with-xsl’ ‘–with-ttf=/usr’ ‘–with-freetype-dir=/usr’ ‘–enable-exif’ ‘–with-jpeg-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-zlib-dir=/usr’ ‘–with-pdo-mysql’ ‘–enable-ftp’ ‘–with-curl=/usr’ ‘–with-pspell=/usr’ ‘–enable-mbstring’ ‘–with-mcrypt’ ‘–with-mysqli’ ‘–with-openssl=/usr’ ‘–with-gettext’ ‘–enable-soap’

I also had wanted xmlrpc but ended up having so much trouble trying to get PHP to compile with it enabled that I went the route of downloading the debian etch package “php5-xmlrpc” from here:

http://packages.debian.org/etch/php5-xmlrpc

I extracted the contents using:

dpkg –extract package.deb folder/

Then pulled the xmlrpc.so file and put it into my extension dir and added the following line to the php.ini:

extension=xmlrpc.so

It should also be noted that the old configure command contained:

–enable-trans-sid
–with-xml
–with-xslt
–with-xslt-sablot=/usr
–with-dom-xslt=/usr

Which are PHP4 configure options and not needed for PHP5.

Finally, there are LOTS of dependencies that needed installation, can’t remember if these are all correct:

sudo apt-get install libcurl3-dev
sudo apt-get install libc-client-dev
sudo apt-get install libmcrypt-dev
sudo apt-get install libmhash-dev
sudo apt-get install libaspell-dev
sudo apt-get install libpspell-dev

That’s all for the time being, I’ll make a final post when I have all the details (and a working install) up and running.

It looks like it’s all up and running smoothly! There was one last catch, when running php through fastcgi you need to manually replace a file:

/dh/cgi-system/php5.cgi

With the file that was created here:

/usr/local/php5/bin/php-cgi

So a quick:

cp -a /usr/local/php5/bin/php-cgi /dh/cgi-system/php5.cgi

Did the trick.

ejabberd2 on DreamHost

I’m in the middle of a move to a new apartment, and oddly I’m very happy. I was able to spend the time to learn how to install and configure ejabberd2 on my PS with DreamHost. I’ve also gone ahead and downloaded a few extra modules, compiled, and enabled them. Notably I’ve enabled the ejabberd_xmlrpc module – and I’ve started work on writing a PHP class which will interface with that module and enable a few specific actions.

Basically I will be creating a class capable of running an XMPP hosting service. Fun, right!?

Memcache on DreamHost PS

Create an admin user:

https://panel.dreamhost.com/index.cgi?tree=vserver.adminusers&

Login to SSH using that admin, then run:

sudo apt-get install memcached

That’ll do it!

StatusNet Install Patch: Command Line Install

Opened a ticket on StatusNet: http://status.net/trac/ticket/2226

There was a recent need to automate the installation of StatusNet, so I went ahead and modified the install.php to allow for a command line interface to the install process, including a version which can be used to run the install from a script. I’m not a fan of the install.php at all, but it does the job – so rather then a rewrite I expanded it – at least until I have more time.

The modified file can be found here:
http://files.gimmesoda.com/dreamhost/software_patches/statusnet/install.php

The patch file is here:
http://files.gimmesoda.com/dreamhost/software_patches/statusnet/install.php.patch

So to handle the install process automatically:
php install.php dbhost sqltype dbname dbuser dbpass “Site Name Goes Here” siteurl fancyurl

The following might need explaining:
sqltype = mysql (it can also be pgsql)
Site name should be quoted, some characters like ! should be escaped.
siteurl = domain.com (not using http:// and no ending slash)
fancyurl is either true or false and if true the htaccess.sample should be renamed to .htaccess

So for the site I tested on:
php install.php mysql.gimmesoda.com mysql database dbuser dbpass “It’s Just Testing\!” testing.gimmesoda.com true

http://testing.gimmesoda.com/

There is also an interactive command line install which is fun, try it out!

php install.php install