OpenSolaris 2008.05 Development Environment Guide
Previous Next

Setting Up Your AMP Development Environment

If you are an AMP developer, you can download the AMP cluster package, which is a super set of all individual AMP packages. To download the AMP package, execute the following command:

$ pkg install amp-dev

The following table provides a list of the individual components in the amp-dev package and a brief description.

Component Name

Package Name

Version

Description

NetBeansTM

netbeans

6.0.1

Open-source Integrated Development Environment for enterprise, web and mobile applications in Java, C/C++, and Ruby

PHP

SUNWphp524

5.2.4

PHP Server

SUNWphp524doc

5.2.4

PHP Server Documentation

SUNWphp524man

5.2.4

PHP Server man pages

SUNWphp524-pgsql

5.2.4

PHP5 module for PsotgreSQL

SUNWphp524-mysql

5.2.4

PHP5 module for MySQL

Python

SUNWPython

2.4.4

The Python Interpreter, libraries and utilities

SUNWpython-twisted

2.4.4

Event-based framework for internet applications

Apache

SUNWapch22

2.2.8

Apache Web Server V2.2

SUNWapch22m-jk

1.2.25

TomCat Connector Plugin for Apache Web Server V2.2

SUNWapch22m-security

2.1.5

Mod Security For Apache Web Server V2.2

SUNWapch22d

2.2.8

Apache Web Server V2.2 documentation

SUNWapch22-php5

2.2.6

PHP5 module for Apache Web Server V2.2

SUNWapch22-fcgid

2.2

FastCGI plugin for Apache Web Server V2.2

SUNWapch22m-dtrace

0.3.1

Dtrace Plugin for Apache Web Server V2.2

TomCat

SUNWtcat

5.5.26

MySQL

SUNWmysql15

5.0.45

mysql — MySQL Database Management System(usr component)

SUNWmysql5-base

5.0.45

MySQL Database Management System(Base)

Squid

SUNWsquid

2.6.17

Squid Web Proxy Cache

memcached

SUNWmemcached

1.2.2

memcached

Subversion

SUNWsvn

1.4.3

Subversion

cvs

SUNWcvs

1.12.13

The CVS version control system

WebStack Tools and UI

webstackui

0.5.11

WebStack Tools and UI package adds desktop features to operate the Solaris, Apache, MySQL, PHP stack


Caution - amp-dev package is the super set of all the web stack packages. The approximate size of this package is 650 mega bytes (MB). You need to download and install this package for AMP development. If you are unable to download this package, you can download individual packages as shown in the following sections.


Setting Up the Web Stack UI

Before you can use Web Stack for your web development needs, you need to initialize the environment for your login. Every new user logged into the system must initialize their own environment. After downloading and installing the amp-dev package, initialize the Web Stack environment by following the steps provided in the Web Stack Getting Started Guide. Click on Applications > Developer Tools > Web Stack Initialize to start the initialization process.


Caution - Initialize your Web Stack environment only after installing the amp-dev package.


To download and install the Web Stack UI, execute the following command:

$ pkg install webstack-ui

Note - If you have already installed amp-dev package, webstack-ui package is already installed. You need to install webstack-ui only when you are installing the AMP packages separately.


Since webstack-ui package depends on Apache package, if you have not already installed the Apache Web Server, it will be automatically downloaded when you install webstack-ui. As mentioned earlier, Web Stack UI is just the GUI option to control the AMP components. You still need to download and configure AMP packages if you have not installed the amp-dev package. The following sections shows you how you can get the individual AMP packages.

After installing the Web Stack UI, you can create and run the bundled sample applications from the menu item. Go to Applications > Developer Tools > Web Stack Admin > Sample App to find these menu items.

Setting Up Your Server Environment

If you have installed the optional package amp-dev, you don't need to download other Apache Web Server packages separately. But if you have not installed the amp-dev package, you can install Apache core runtime by executing the following command:

pkg install SUNWapch22 SUNWapch22d 

The above command downloads Apache documentation too. For downloading other Apache modules, execute:

$ pkg install SUNWapch22m-security SUNWapch22m-jk 
SUNWapch22m-fcgid SUNWapch22m-dtrace

The web stack bundle includes the Apache 2.2.8 Web Server. The NetBeans IDE lets you add Apache web server in the servers list so the applications that you build including PHP based web applications can be deployed to the Apache web server. For setting up Apache Web Server in NetBeans IDE, refer to the later sections in this chapter.


Note - Available Version - Apache Web Server 2.2.8.


If Web Stack is configured, you do not need to download Apache Web Server or PHP engine separately from an external site. See the Web Stack Getting Started Guide to find out how you can initialize Web Stack and start Apache Web Server.

To Start Apache Web Server
  1. Click Applications > Developer Tools > Web Stack Admin > Initialize
  2. Click Applications > Developer Tools > Web Stack Admin > Start Apache2/MySQL Servers

    Web Stack comes with Apache 2.2.8 Web Server fully configured and optimized for PHP deployment.

Where is Apache Web Server Installed?

When you download and install the Apache Web Server package, the binaries will be available from /usr/apache2/2.2 and other runtime configuration files will be available under /etc/apache2/2.2.

Administering the Server

SMF Framework for Web Stack components is not initialized in the this release. Use either the Web Stack UI or start the server by running the startup command manually.

What you need to do? Perform the following steps as root user to start Apache Web Server:

svccfg import /var/svc/manifest/network/http-apache22.xml
svcadm enable network/http:apache22

The first command shows how you can import the MySQL Server manifest file. You need to execute this only once. For stopping the server, execute the following command:

svcadm disable network/http:apache22

Setting Up Your Java Environment

The Java Runtime Environment is bundled with this release. But for Java development, you need to download and install the Java Development Kit either form http://java.sun.com or from the official pkg repository. To get Java development support, execute the following command:

$ pkg install java-dev

Note - If you have already downloaded and configured NetBeans IDE, chances are that you already have the Java Development Kit. To test, run javac -version to get the version number of the Java Development Kit.


Where is Java Installed?

When you download and install the java-dev package, the binaries will be available from /usr/bin.

Setting Up Your PHP Environment

If you have installed the optional package amp-dev, you don't need to download PHP runtime or extensions separately. But if you have not installed the amp-dev package, you can install PHP runtime by executing the following command:

$ pkg install SUNWphp524 SUNWphp524man 
SUNWphp524-mysql SUNWphp524-pgsql SUNWapch22m-php5 
Where is PHP Installed?

When you download and install the PHP packages mentioned in the above section, the binaries will be available from /usr/php5 and other runtime configuration files will be available under /etc/php5/5.2.4.


Note - Available Version - PHP 5.2.4.


Setting Up Your Ruby Environment

For downloading and installing Ruby packages, execute the following command:

$ pkg install ruby-dev

When you download and install the ruby-dev package, you are also installing the NetBeans plug-in for Ruby. If you are not planning to use NetBeans IDE for your Ruby development, you can get only the ruby package as show below:

$ pkg install SUNWruby18
Where is Ruby Installed?

When you download and install the Ruby package mentioned in the above section, the binaries will be available from /usr/ruby/1.8.

Setting Up MySQL DB

MySQL server is the most widely used relational database server and hence MySQL package is available for download from the pkg repository. When you download and install amp-dev package you are also installing MySQL database. If you have not downloaded the amp-dev package, you can download only the MySQL package as shown below:

$ pkg install SUNWmysql5

You still need to configure MySQL to get it working in your OS. If you have installed the Web Stack UI package, you can configure MySQL from the menu. Refer to the Web Stack Getting Started Guide for information on starting the MySQL server manually.

Where is MySQL DB

When you download and install the MySQL package, the binaries will be available under /usr/mysql.

Administering MySQL Server

SMF Framework for Web Stack components is not initialized in this release. Use either the Web Stack UI or start the server by running the startup command manually.

What you need to do? Perform the following steps as root user to start MySQL Server:

svccfg import /var/svc/manifest/application/database/mysql.xml
svcadm enable application/database/mysql:version

The first command shows how you can import the MySQL Server manifest file. You need to execute this only once. For stopping the server, execute the following command:

svcadm disable application/database/mysql:version

Setting Up Your Python Environment

Python 2.4.4 is already installed in this release. You do not need to install any additional packages.

Previous Next