Andrew Browne

Today I setup a zone on my OpenSolaris box (snv_123) to host a webstack. Apache2, MySql, PHP, are th…

Today I setup a zone on my OpenSolaris box (snv_123) to host a webstack.
Apache2, MySql, PHP, are the applications which make up the "AMP" webstack.

AMP is installed on the global zone via the amp package (pkg:/amp@0.5.11-0.123).
Because sparse zones can share static program files such as /usr, /lib, etc (not /etc).
The zone will have its own /etc and /var where all the individualized configuration data is held.
Zones FAQ

zonecfg is used to configure a zone, then zoneadm to install, and zlogin to use it (initially):
Zones Setup
That blog covers that part fairly well.

The slightly tricky part was starting the servers. Although the server files are present in the /usr shared with the global zone, the SMF manifests are not imported like they were in the global zone during the pkg install.

Manifest files can be found in the global zone, in /var/svc/manifest/
The rest of the path corresponds with the service URI.
For example: Apache2 (v2.2) has a service URI of: svc:/network/http:apache22
It's manifest file is /var/svc/manifest/network/http-apache22.xml

MySQL has a service URI of svc:/application/database/mysql:version_51
It's manifest file is at /var/svc/manifest/application/database/mysql_51.xml

These are the 2 manifests needed for the AMP stack (the P, PHP is a module of apache, not an independent service so it doesn't have a service manifest).

From there;
svcadm enable mysql
svcadm enable http

There will be additional configuration required, but from there installing it in the zone is the same as if it were the global zone. You can google for instructions on configuring the servers, or better still, read the logs in /var/svc/logs to see what the problem is.

If you have already got AMP working in the global zone, you may save yourself some time copying
/etc/mysql/
/var/mysql/
/etc/apache2/
/var/apache2/
/etc/php
With all the configurations into the zone (at the same paths). Theres also some chowning involved for mysql. You can temporarily make a folder in the global zone's /usr as a stepping stone to transfer files into the zone. Its messy, to remember to delete the folder after, and nothing else.

Zones are cool. They have the security and separation of VMs, without all the overhead of another OS (disk usage of the image, processing and RAM usage at run time).

Tags: amp, apache, mysql, smf, zones

Share 

Add a Comment

You need to be a member of Open Source University Meetup to add comments!

Join this social network

1 Comment

Rachmat Febrianto Comment by Rachmat Febrianto on October 13, 2009 at 3:46am
nice post .. :)

Webinars

OSUM members get exclusive access to a series of webinars on the most innovative open source technologies via the OSUM Webinar Series.

If you missed any of the previous OSUM Webinars, click here to listen to the replays of the previous sessions.

News

Download Free OpenOffice.org Guide For Creating Large Documents One of the advantages of OpenOffice.org is its ability to handle large word processing documents such as theses and research papers. Download this free guide now and read expert advice on writing with OpenOffice.org.

Get On Board with JavaFX & the Tech Train Game

Get a hands-on introduction to JavaFX when you play the Tech Test Train - Ride the train, test your knowledge of JavaFX technology, and earn points. Click HERE to play.

Working With ZFS Snapshots Download the free ZFS Snapshots How-To Guide to learn how to create and use the backup and restore capabilities of ZFS snapshots.

© 2009   Created by Gary Serda

Badge  |  Report an Issue  |  Privacy  |  Terms of Service