Zend Framework + SVN + ZF Tools on CentOS

This first part focuses on installing svn + zf library + zf tools on your dev server. In the second part (coming soon) I will show you how to create a svn repository and import into it a simple zf project created with zf tools.

Prerequisites:
You will need at least a working web server (Apache2) and PHP version 5.

I’ll be using utterramblings repository to install subversion and required packages for the apache server.

Import the gpg key for utterramblings repository:

rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

Add the repository to yum by creating a repo file in /etc/yum.repos.d/utterramblings.repo that contains the following lines:

[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

Install subversion and mod_dav_svn from utterramblings:

yum install subversion –enablerepo=utterramblings
yum install mod_dav_svn –enablerepo=utterramblings

You should have everything you need to start working with svn on your server.

Now let’s install ZF tools to the server:

mkdir ZF_Tool
cd ZF_Tool/
svn checkout http://framework.zend.com/svn/framework/laboratory/Zend_Tool/ .

Now copy the directory ‘library/ZendL’ to a place that’s in the include path of your php. In my case it was ‘/usr/share/php’.

Copy ‘bin/zf.sh’ and ‘bin/zf.php’ to /bin and edit zf.sh updating ZF_BIN_PHP variable to:

ZF_BIN_PHP=/bin/zf.php

Don’t forget to change their permissions so anyone can use them:

chmod a+rx /bin/zf*

For ZF library I’ve used the minimal package since it contains most of the stuff I use anyway without being bloated. At the time of writing this article 1.6 was the latest version, which I’ve got it from their site using wget:

wget http://framework.zend.com/releases/ZendFramework-1.6.2/ZendFramework-1.6.2-minimal.tar.gz
tar zxvf ZendFramework-1.6.2-minimal.tar.gz

Copy the directory ‘library/Zend’ to the same place where you’ve put ZendL directory (‘/usr/share/php’ for me).

Now if everything went ok when you type at the cli ‘zf show version’ you should get something like ‘Zend Framework Version: 1.6.2’.

Congratulations you are done with this part. If you want you can play around with ‘zf create project’ until I publish my next article showing how to use zf tools + SVN together to create the bases of a project.

Updating to Ubuntu Intrepid Ibex

Last weekend I’ve decided to update my netbook, an MSI Wind U100 clone labeled Advent, to the latest Ubuntu version (Intrepid Ibex). While on theory everything should have been simple, the reality is I had a ton of problems.

So lets start with updating from Ubuntu 8.04 to Ibex. First you should backup your home directory to an USB stick. Also copy xorg.conf to a safe place in case things go wrong.

Start a terminal in graphic mode (press alt+f2 and type xterm). Become root:

sudo su

Type your password and when you get the root prompt (#) type:

update-manager -d

You should get a new window like this one

Press “Upgrade” and answer the questions. This was the easy part, after update-manager would have finished running I should have been a happy user running Ubuntu Intrepid, right? Wrong!

I went out to town to drink some beer since it was weekend and left the update-manager to do its job. When I got back home, surprise: I didn’t plug the netbook to a power source and battery was empty, netbook offline. Nice … Pressed the power on button and crossed fingers.

After 3-4 minutes the reality unveiled, upgrade didn’t finished OK so netbook wasn’t entering graphic mode and I’ve got a ton of failed services and errors. A quick look showed that the file system was mounted read-only. Time to repair all that mess as I didn’t want to reinstall the whole system because I’m a lazy person.

Recovering after disaster

Ctr+Alt+F1 to get to first text console. Login with your username and password. Become root:

sudo su

As root remount the file system so it can be used:

mount / -o remount

If you have more partitions do so for each of them (replace / with their mount point).
Switch to run level 3:

telinit 3

When you are running in run level 3 type:

dpkg –configure -a

This should restart/fix the upgrade process from where it stopped. It will ask you if you want to replace your custom config files with new ones. I answered No. When it’s done restart the netbook (use telinit 6). Make it shutdown even if you have to switch it off from power button.

When it’s online again you should have a working graphic mode. If not, try to replace your xorg.conf with your backup and restart gdm with:

/etc/init.d/gdm restart

Probably you won’t be having the wireless working so plug a network cable and manually reconfigure your NIC:

sudo ifconfig eth0 192.168.1.113/24
sudo route add default gw 192.168.1.1

In the above example 192.168.1.113 is netbook IP address, /24 is the netmask (equivalent to 255.255.255.0) and 192.168.1.1 is the gateway (the IP of router)

Run the following commands as root to fix all the missing dependencies:

apt-get update
apt-get -f install
apt-get upgrade

Restart the system and everything should be ok now.

Funny article about sysadmin

I was wandering around the Internet and I found an interesting article called “Silicon Valley Users Guide: How do I get my sysadmin to do anything?”

While it made me smile a lot I must say that most of the things pointed out there are true. This is my preferred part:

Don’t question what he does all day. Systems administrators are like firemen and cops. If you don’t have a couple of bored ones hanging around, you’ll be sorry when there’s an emergency.

Keep that in mind!

Link to the original post: How do I get my sysadmin to do anything?