Sriram Natarajan's Weblog

pageicon Tuesday Feb 19, 2008

How to install Apache, PHP and MySQL 5 within Indiana (Open Solaris Developer Preview)

Couple of days back, Open Solaris Developer Preview 2, was released to the general public. I am told that this preview (aka beta) release is based on the same milestone build (Nevada build 79b) that Open Solaris Developer Express 01/08 was released with. So, naturally I got curious and tried it out on my laptop and here is my feedback

  • On the positive side - Installation experience is very smooth. Also, fonts look sharp and even wireless on my laptop works out of the box as well.
  • On the not so positive side -  Web Stack components like Apache, PHP and MySQL are not installed as part of default install.  So, one will need to manually download and install / configure these components.  Now, the tricky part is knowing the exact name of these packages to download as the current Indiana 'pkg' command is unable to search  by common names like 'apache' or 'php' etc.

After some poking around, I found the list of additional packages available at Indiana repository and from then, it was a breeze to find the right instructions to download and configure these components.  Thought, I would share my experience here.  So, here in this blog, I will go through the list of steps needed to configure a Web Stack (Apache , PHP and MySQL) stack on my Solaris Developer Preview (aka Indiana).

- Using a 'terminal' window, download and install Web Stack components like Apache , PHP and MySQL as shown below.  Note, You will need to have a  high speed internet connection to download and install these packages.

If you are curious as to what we what are we doing here - here is a brief explanation

sriramn@sriram-laptop2:~$  pfexec pkg  install SUNWapch22 SUNWphp524core SUNWphp524usr SUNWmysql5 SUNWapch22m-php5 SUNWphp524-mysql

pfexec - a command that integrates with Solaris RBAC and allows us to run a privileged command provided we have the authorization to do so.  For example, installing a software is a privileged operation and a default user in Open Solaris Developer Preview is provided with this authorization.

pkg - new package command that can download and install specified packages from Indiana package repository.

SUNWapch22 - Apache 2.2

SUNWphp524core SUNWphp524usr -> PHP 5.2.4 core runtime and its dependent header files.

SUNWmysql5  - MySQL 5.0 database core runtime files.

SUNWapch22m-php5 - Glue to bond PHP 5.2.4 runtime within Apache

SUNWphp524-mysql  - Glue to bond PHP 5.2.4 runtime with MySQL database.

For Developer Preview 2 (aka beta) release,  I guess, we need to provide these correct package names to the 'pkg' command. Hopefully, going forward , with subsequent releases, we should be able to get the following command working

pfexec pkg install apache php mysql

Configuring MySQL for Indiana

Though, the above command successfully installed the MySQL database, there are still some some post installation steps necessary. Unlike Solaris Developer Express, where these below steps are automatically done for us, within Solaris Developer Preview 2, we will need to perform the following manual configuration to successfully configure MySQL database within Indiana.  Again, I am hoping that with Developer Preview 3, these steps should no longer be needed.

  • Create MySQL user and group and allocate MySQL data directory '/var/mysql' to this user for security purposes

 

sriramn@sriram-laptop2:~$  pfexec groupadd -g mysql

sriramn@sriram-laptop2:~$  pfexec useradd -d /var/mysql -m -g mysql mysql

sriramn@sriram-laptop2:~$  pfexec chown mysql:mysql /var/mysql

sriramn@sriram-laptop2:~$  pfexec chmod 750 /var/mysql /var/mysql/data

  • Now, let us initialize MySQL database and try to start the server. 

 

sriramn@sriram-laptop2:~$  pfexec su - mysql

sriramn@sriram-laptop2:~$  pfexec /usr/mysql/5.0/bin/mysql_install_db --user=mysql

sriramn@sriram-laptop2:~$  pfexec /usr/mysql/5.0/bin/mysqld_safe &

sriramn@sriram-laptop2:~$  pfexec /usr/mysql/5.0/bin/mysqladmin -u root  password '<provide a password to protect the MySQL database for the 'administrator account'>

 

Yup - this is all should be required to run Apache , MySQL and PHP within Indiana. With this pre configuration, you should be now ready to deploy either a wiki site like Media Wiki  on Indiana or a content management site like Drupal on Indiana  just as you would with SXDE 01/08.

Technorati Tags: ,,
Comments:

Eeeeeeexcellent!

Posted by Mikael Gueck on February 20, 2008 at 12:06 AM PST #

Thanks for nice info, just try to instal Indiana.

Posted by Romych (Russia) on March 26, 2008 at 07:05 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

« May 2008
SunMonTueWedThuFriSat
    
1
2
3
4
6
7
8
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today

Feeds

Search this blog

Links

Weblog menu

Today's referrers

Today's Page Hits: 42