Application Server for Drupal
The reason for this blog is to create a guide on how to install Drupal on a Linux Server ( I choose Ubuntu 10.04 amd64 LTS but any Linux distro will work just fine) but instead of using all the PHP packages bundled with this Linux distribution we will be using Zend Server which is an Application Sever built for PHP by Zend.
So, once you have set up Ubuntu, let's login as the root user typing the following command:
$ sudo -s
cool , now that we have all the privileges, let's add the Zend Server repository to our sources list by typing:
# nano /etc/apt/sources.list
at the end of the file add the following lines:
deb http://repos.zend.com/zend-server/deb server non-free
save and exit.
Once we added the repository we also need to add the public key for it, we do so by typing:
# wget http://repos.zend.com/zend.key -O- |apt-key add -
Great, now we have added Zend Server to our package sources, we need to update our local repository by typing:
# apt-get update
after updating our system we can start with the package installation, you can choose either install php version 5.2 or php version 5.3 by typing:
# apt-get install zend-server-ce-php-5.2 (for php 5.2) or
# apt-get install zend-server-ce-php-5.3 (for php 5.3)
*note: this command will also install apache 2 web server automatically
The commands above will install all the relevant packages for Zend Server CE but we also need some extra packages required by Drupal, we can install them by typing:
# apt-get install php-5.2-extra-extensions-zend-server-ce
I will install PHP 5.2 since is the most compatible version for running Drupal and specially Drupal community modules
Well, thats it, we now have successfully installed Zend Server Community Edition plus Apache 2 on our system, you can access Zend Server's Web Interface via your web browser at:
https://localhost:10082/ZendServer (secure) or
to start/stop the zend server service run:
$ sudo /etc/init.d/zend-server start
$ sudo /etc/init.d/zend-server stop
$ sudo /etc/init.d/zend-server restart
by default on Ubuntu all the files for the Zend Server will be located on your system in the next folder:
/usr/local/zend (root folder for zend server)
/usr/local/zend/etc/ext.d/ (extensions config files)
add PHP to the usr/bin directory
$ sudo ln -s /usr/local/zend/bin/php /usr/bin/php
now let's configure it a little so we can expand our Drupal installation capabilities.
Drupal itself requires a PHP extension called uploadprogress to track a file upload progress, we just need to enable it through the Zend Server's Web Interface on the extensions page.
Next, we can install APC to our system so Drupal can take advantage of this PHP caching system, we do so by typing:
# apt-get install php-5.2-apc-zend-server
Since Zend Server provides by default a cache library called Zend Cache, we need to disable it in order to avoid conflicts between this library and APC, this can be done through the Zend Server's Web Interface.
And that's it! Now you have a robust LAMP architecture for your Drupal projects or any other PHP application taking advantage of the benefits of an Application Server such as debugging, deployment and PHP libraries optimized and maintained by Zend.