Login | Register
Login | Register

My pages Projects SunSource.net openCollabNet
OpenSPARC.net >  Cool Tools >  Cool Stack >  FAQ

Cool Stack - Frequently Asked Questions


Topics

Installation

Apache

MySQL

PHP

Perl

Installation

What is Cool Stack ?
What platforms does Cool Stack run on ?
How can I get Cool Stack ?
How do I install Cool Stack ?

What is Cool Stack ?

Cool Stack is a collection of some of the most commonly used open source applications optimized for the Sun Solaris OS platform. By using these binaries you will enjoy the best levels of performance from your system, while also reducing your time-to-service. Cool Stack include Apache2, PHP5, MySQL5, Perl5, memcached, ruby, squid and Tomcat.
Cool Stack is a set of separate Solaris packages so you can install just the ones you need. The packaging has been done in a manner so as to reduce the number of downloads by bundling the most frequently used applications together.

What platforms does Cool Stack run on ?

Cool Stack has been built on Solaris 10 and will run on Solaris 10 as well as OpenSolaris based releases - Solaris Express Developer Release (SXDE). Binaries are provided for both UltraSPARC and x86/x64 platforms. The x86 binaries  are built on Opteron but will run on Xeon platforms as well.

How can I get Cool Stack ?

Cool Stack can be downloaded from the Download link at http://cooltools.sunsource.net/coolstack.

How do I install Cool Stack ?

Download the Cool Stack packages you want to install from http://cooltools.sunsource.net/coolstack into any directory. Then run the following commands as user root on each package :

bunzip2 [package.pkg.bz2]

For example: bunzip2 CSKmysql_sparc.pkg.bz2

pkgadd -d [package.pkg]

For example: pkgadd -d CSKmysql



Apache

Where are the Apache configuration files ?
What changes have been made to the default configuration files ?
How do I enable SSL ?
How do I setup Apache httpd as a service under SMF ?

How do I enable LDAP-based authorization ?
I get errors when running make_solaris.sh. Why ?

Where are the Apache configuration files ?

The Apache configuration files in are in /opt/coolstack/apache2/conf. The main configuration file is httpd.conf and additional files reside in the sub-directory extra.

What changes have been made to the default configuration files ?

The files httpd.conf, extra/httpd_ssl.conf, extra/httpd_mpm.conf have been edited to enable Apache to startup as user webservd and have good out of the box performance.  Several modules although included in the build have been disabled for better performance. If you need to use any of these modules, uncomment the corresponding LoadModule entry in httpd.conf. Entries for perl and php5 modules have been added. The default Apache configuration files are saved with extension .orig, so you can compare against them.

How do I enable SSL ?

To enable SSL (https), uncomment the following line in httpd.conf :

#Include conf/extra/httpd-ssl.conf

You also need to create the server certificate and private key files and ensure that the SSLCertificateFile, SSLCertificateKeyFile entries in httpd-ssl.conf point to these files.

How do I setup Apache httpd as a service using SMF ?

Cool Stack 1.2 now comes with support for SMF. If you choose to enable the service at install time, the following files will be installed:
Manifest file: /var/svc/manifest/network/cskapache2.xml
Method file: /opt/coolstack/lib/svc/method/svc-cskapache2
  • Review the method file and make any changes required for your installation.
  • Ensure that the apache configuration files (httpd.conf etc.) have been edited for your installation and you can manually bring up and shutdown the server.
  • Now, you can hand over control of apache startup/shutdown to SMF:
    # svcadm enable csk-http

See the README file in /opt/coolstack/apache2 for more details.

How do I enable LDAP-based authorization ?

Cool Stack 1.2 now correctly links with the openLDAP library and is built to include mod_authnz_ldap.
  • Make sure you have the following lines in httpd.conf:
    LoadModule ldap_module modules/mod_ldap.so
    LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  • Add the required Auth* Directives to your server 'Directory' configuration. See Apache documentation for details.
  • Re-start apache and you should now be able to do ldap-based authorization either with or without SSL.

Cool Stack 1.1 does include the openLDAP client libraries but not the Apache module mod_authnz_ldap. This module can be added as follows :
    Download and install the CSKampSrc_sparc or CSKampSrc_x86 package
    Edit /opt/coolstack/src/httpd-2.2.3/make_solaris.sh and add "--enable-authnz-ldap" to the configure line. Comment out the "make distclean" line.
    Re-run the make_solaris.sh script. This will re-install httpd.
    Or alternatively, you can build just the module :
    # cd /opt/coolstack/src/httpd-2.2.3/modules/aaa
    # /opt/coolstack/apache2/bin/apxs -i -a -c mod_authnz_ldap.c

I get errors when running make_solaris.sh. Why ?

The generated Makefile is dependent on the path in which the source resides. The first time you do the build, comment out the line make distclean in make_solaris.sh

MySQL

Why are there 2 MySQL versions in Cool Stack ?
How do I setup MySQL as a service using SMF ?

Why are there 2 MySQL versions in Cool Stack ?

Cool Stack includes a 32bit and 64bit version of MySQL. The 32bit version is bundled along with Apache and PHP in the CSKamp package and has client-side support. For example, the PHP mysql and mysqli extensions link to the mysql libraries in /opt/coolstack/mysql_32bit. The 32bit version can also be used as a database server - especially on smaller x86 platforms.
The CSKmysql package is a 64bit version of MySQL for use as the database server. We recommend this for server-side use as it permits the use of larger caches resulting in improved performance.

How do I setup MySQL as a service under SMF

Cool Stack 1.2 now comes with support for SMF. If you choose to enable the service at install time, the following files will be installed:
Manifest file: /var/svc/manifest/network/cskmysql32.xml (for 32bit)
Manifest file: /var/svc/manifest/network/cskmysql.xml (for 64bit)
Method file: /opt/coolstack/lib/svc/method/svc-cskmysql32 (for 32bit)
Method file: /opt/coolstack/lib/svc/method/svc-cskmysql (for 64bit)
  • Review the method file and make any changes required for your installation. In particular, ensure that the variable DB_DIR is set to point to your data directory and that this directory is owned by mysql:mysql.
  • To enable SMF to control start/shutdown of the MySQL server:
    # svcadm enable csk-mysql
For more information, please see the README file in /opt/coolstack/mysql* directory.

PHP

Is there a 64-bit version of PHP ?
I can't get extension foobar to run. Why ?
MediaWiki fails with the message "Cannot access protected property DatabaseMysql::$mOut".
Using fopen() to open a url fails. Why ?
If I update a php file, I need to restart Apache to see the changes. Why ?

Is there a 64-bit version of PHP ?

No. Since PHP depends on a large number of libraries (considering the number of extensions Cool Stack includes), it is difficult to provide a 64-bit version of PHP. Further, PHP is used along with Apache, and a 64-bit PHP implies, a 64-bit Apache as well.
For Cool Stack, there is no real advantage gained by using a 64-bit PHP, since Apache uses MPM-prefork resulting in multiple processes each with it's own 4GB of virtual memory.

I can't get extension foobar to run. Why ?

  • Verify that the extension you want is included in the PHP build by downloading and reading the pdf documentation (CoolStack1.2.pdf).
  • Verify that you have downloaded and installed the optional PHP package in which the library required by the extension lives : one of CSKncurses, CSKtds, CSKphplibs. All three of these packages are bundled together in a single download called CSKphplibsbundle_{arch}.pkg.bz2.
  • Make sure that you have included the line extension="foobar.so" in your php.ini
If the extension isn't included, in most cases you can add the extension without having to rebuild the entire PHP. Here are the steps for adding extension foobar :
  • Download the required extension.
  • Install autoconf. It is available from blastwave or sunfreeware
  • Create a script make_solaris.sh with the following contents and run it:
    # autoconf is required for phpize to work
    # Install from blastwave
    #
    SAVEPATH=$PATH
    PATH=/opt/csw/bin:$PATH
    INSTALLDIR=/opt/coolstack
    $INSTALLDIR/php5/bin/phpize
    make distclean
    PATH=$SAVEPATH
    ./configure --with-prefix=$INSTALLDIR --with-php-config=$INSTALLDIR/php5/bin/php-config
    make
    make install

MediaWiki fails with the message "Cannot access protected property DatabaseMysql::$mOut".

This problem only occurs with Cool Stack 1.1 and seems to be caused by APC, which is enabled by default in the php.ini shipped with Cool Stack. If you comment out the line "extension="apc.so" in php.ini, MediaWiki will work.
Alternatively, you can download, build and install APC 3.0.14 which works with MediaWiki. See instructions elsewhere in this FAQ for installing a PHP extension. Easier still, upgrade to Cool Stack 1.2.

Using fopen() to open a url fails. Why ?

Since PHP is built with curl, the default mechanism to handle the http protocol is curl. Add the curl extension to your php.ini thus :
extension="curl.so"

If I update a php file, I need to restart Apache to see the changes. Why ?

This is because of the apc.stat entry in the default php.ini in /opt/coolstack/php5/lib. The entry is set to 0 to optimize apc performance, so that it does not stat the file on every request. Change this entry as follows :
apc.stat=1

Perl

How do I install the DBD::mysql extension ?
The DB_File extension doesn't seem to work ?


How do I install the DBD-mysql extension ?

Cool Stack 1.2 includes the DBD-mysql extension, so it should just work.
Cool Stack 1.1 does not include the DBI and DBD-mysql extensions. You can upgrade to Cool Stack 1.2 or if you want to stick to 1.1, here are the steps required to install this extension :
  • Add the following to PATH : /opt/coolstack/mysql_32bit/bin:/opt/coolstack/bin  BEFORE /usr/bin. If you have /usr/sfw/bin in your PATH, make sure the coolstack directories appear BEFORE /usr/sfw/bin. You will need the Sun Studio compiler and /usr/ccs/bin in your PATH as well. Note that there is a bug in Sun Studio 11 that prevents DBD from being built successfully on x86, so please use Sun Studio 12 on that platform.
  • Download and install the CSKamp package (we need the mysql libraries and binaries)
  • Download DBI-1.54 and run :
    • perl Makefile.PL; make; make test; make install
  • Create a local mysql database and start the server :
    • cd /opt/coolstack/mysql_32bit/bin; ./mysql_install_db; ./mysqld_safe &
  • Download DBD-mysql-4.003 and run :
    • perl Makefile.PL; make; make test

The DB_File extension doesn't seem to work ?

This extension was included in Cool Stack 1.1 and requires the installation of libdb-4.5.so from BerkeleyDB which is not shipped with Cool Stack. If you download and install it, DB_File can then be used.
If you have a pre-installed version of DB (in a location other than /opt/coolstack), then it may be easier to download DB_File and replace Cool Stack's version.
To avoid confusion, DB_File extension has been removed from Cool Stack 1.2.