2010-05-28

Installing Zend Server Community Edition on a Debian Lenny 5.0 OpenVZ container

If you want to install the Zend Server Community Edition on an existing Debian server you should do it like described here:
http://files.zend.com/help/Zend-Server-5-Community-Edition/zend-server.htm#deb_installation.htm

1) Add the following to your /etc/apt/sources.list:
deb http://repos.zend.com/zend-server/deb server non-free

2) Add the key: wget http://repos.zend.com/deb/zend.key -O- |apt-key add -

3) # apt-get update

4) # apt-get install zend-server-ce-php-5.2

5) Go to https://[servername]:10082/ZendServer to create an admin account
But here i encountered the first problem:

I just got a 503 - Service Not Available - to fix that you have to restart the Zend Server with:
# /usr/local/zend/bin/zendctl.sh restart

6) Go to https://[servername]:10082/ZendServer and enter the configuration screen
Now i was able to load https://[servername]:10082/ZendServer and create a administration account with a password.

But then, when i want to enter the admin interface i get the following error: Failed to access Web server. Please make sure that the Web server is running and listening to the correct port

So to check the status enter this:
# /usr/local/zend/bin/zendctl.sh status
[28.05.2010 17:05:33 SYSTEM] Apache is not running.
[ 28.05.2010 17:56:33 SYSTEM] watchdog for lighttpd is running.
[ 28.05.2010 17:56:33 SYSTEM] lighttpd is running.
/usr/local/zend/etc/rc.d/apache: line 116: www-browser: command not found

I found out that Zend is using lynx for the status, but it was not installed on my system.
# apt-get install lynx

When i retyped the status-info i got the following:

# /usr/local/zend/bin/zendctl.sh status
[28.05.2010 18:05:04 SYSTEM] Apache is not running.
[ 28.05.2010 18:05:04 SYSTEM] watchdog for lighttpd is running.
[ 28.05.2010 18:05:04 SYSTEM] lighttpd is running.

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/server-status

So when i looked into /var/log/apache2/error.log i found the following entry:
Fri May 28 19:04:50 2010: [ Zend Optimizer+ (2002) Fatal Error] Unable to allocate shared memory segment of 67108864 bytes: mmap: No space left on device (28)

After some research on the web i found this post. So it turned out to be a problem on virtual environments like Virtuozzo or OpenVZ. After changing the value on the OpenVZ Host to the following it worked:

# vzctl set [OpenVZ-ID] --shmpages $(( 21504*4 )):$(( 21504*4 )) --save

Now i can configure Zend finally.

2 comments:

test said...

You've saved my life! Thank you for this tip.

l0rd said...

Hi,
I run to the same problem a while ago, but I had no control over my virtualserver.
But I found an alternative solution, and the problem was caused by the zend optimizer.
if you have a same errors like this:
Mon Jan 17 18:53:23 2011: [ Zend Optimizer+ (13935) Fatal Error] Unable to allocate shared memory segment of 67108864 bytes: mmap: No space left on device (28)
try to do the next:
mv /usr/local/zend/lib/optimizerplus/php-5.3.x/ZendOptimizerPlus.so /usr/local/zend/lib/optimizerplus/php-5.3.x/ZendOptimizerPlus.so.disabled

service zend-server start