Ubuntu + Apache2 + php + Zend
At times I get so tired of Java that I just yearn for a different set of frameworks (or should I say an environment where there is a good , concise language and less frameworks to choose from). I have been interested in following stacks:
Next I installed Sun's Java 1.6 (oh oh but why). I am planning on using NetBeans for other java related work and also maybe php editing (have not tried that yet). The Ubuntu server image that I have did not have java in it. At least thats what the following command found
My next blog will be on using the Zend Framework itself.
- Ruby & Ruby on Rails
- PHP & Zend Framework
- Python & Django
- Sun's Virtual Box VM software 2.0.2 http://www.virtualbox.org/.
- Downloaded Ubuntu 8.0.4 as of this writing (http://www.ubuntu.com/getubuntu/download). What you get is an image file (.iso file)!
- Next I used VirtualBox to set up a new VM using the Ubunto iso image file.
Next I installed Sun's Java 1.6 (oh oh but why). I am planning on using NetBeans for other java related work and also maybe php editing (have not tried that yet). The Ubuntu server image that I have did not have java in it. At least thats what the following command found
sudo update-alternatives --config javaI could not find a ready package to install jdk1.6 from Sun. After some tinkering around I executed the following (thanks to a great blog at http://fci-h.blogspot.com/2007/02/installing-jdk6-on-ubuntu.html). For your convinence I am repeating the steps (including an extra one to configure javac).
No alternatives for java
- Download the linux version of JDK 1.6 from http://java.sun.com/javase/downloads/ea/6u10/6u10rcDownload.jsp#6u10JDKs.
- Next chmod of the downloaded bin file so that we can execute it (lazy me did a chmod 777 jdk-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin)
- Next execute that file ./jdk-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin
- This should create a exploded directory jdk1.6.0_10
- sudo mv jdk1.6.0_10 /usr/bin/jvm (make sure there is a folder named /usr/bin/jvm/jdk1.6.0_10)
- To map java run command
- sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_10/jre/bin/java 60 --slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib/jvm/jdk1.6.0_10/man/m
- To map javac run command
- sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_10/bin/javac 60 --slave /usr/share/man/man1/javac.1.gz javac.1.gz /usr/lib/jvm/jdk1.6.0_10/man/m
- Thats it.
sudo update-alternatives --config javaOf course type in java and javac on the command line as a final test. We digressed. A lot of the commands so far and further down use sudo to execute them as root.
mathew@mathew-desktop:~$ sudo update-alternatives --config java
[sudo] password for mathew:
There is only 1 program which provides java
(/usr/lib/jvm/jdk1.6.0_10/jre/bin/java). Nothing to configure.
- Next I installed PHP5. Ubuntu has described that in good detail at https://help.ubuntu.com/8.04/serverguide/C/php5.html. Not repeating it here. Most important - run the hello world php to make sure all is good.
- Some useful apache2 file/folder locations.
- To edit site site root folder => sudo vi /etc/apache2/sites-available/default
- I changed my DocumentRoot to /home/mathew/projects/zendqs/public (this is in preparation for my first Zend example...the quickstart example from the zend site).
- To restart apache2 => sudo /etc/init.d/apache2 restart
- Download the latest version of Zend (1.6 as of this blog http://framework.zend.com/).
- Now we need to tell Apache2 about Zend. Edit the Apache2 configuration file /etc/php5/apache2/php.ini
- Add the line: include_path = "/usr/share/ZendFramework-1.6.1"
- As you can see I moved my ZendFramework download folder to the location above.
- Remember this site if you run into any mod_rewrite issues http://www.huanix.com/2007/04/18/mod_rewrite-for-apache2-in-ubuntu-feisty-fawn-704/. This article will tell you how to enable mod_rewrite if it is not already done. You will come across mod rewrite when if you follow the Zend Quickstart example as I plan to.
My next blog will be on using the Zend Framework itself.






Just throwing this out there, but I've seen better performance across my servers after switching from APC to xCache.It also doesn't have the problems with other files, like kses.php for example.
Reply to this