Friday May 16, 2008

As part of OpenSolaris 2008.05 installation, Caiman installer automatically configures your ethernet card  to provide a dynamic IP address. This is perfectly fine if you are working from your laptop.

However, if you, like me installed it on your workstation like Sun Ultra 40 then you might want to do necessary things like assigning a static IP address with NIS authentication enabled etc to transition the system as a developer workstation. Now that I have tried out OpenSolaris 2008.05 LiveCD for more than 2 weeks now, I guess I am now ready to make OpenSolaris 2008.05 as my default OS. If you haven't yet, you might wanna download a copy from here

So, here is how I went ahead with this transition
 

- Disable Network AutoMagic(NWAM) service and enable traditional networking service

svcadm enable physical:default 

svcadm disable physical:nwam

-  Now, you need to configure the static IP address for your ethernet interface. You could do this by using the network configuration GUI - 'System->Administration->Network GUI window to configure this as shown here

Note: I am assuming that you know the IP address and the default gateway that you need to provide here. If not, you might want to talk to your Network administrator before you attempt this.

- Now, I will restart all network services by doing some thing like

 svcadm restart milestone/network

 
Now, I will move ahead and configure NIS for my system. Here is how it
worked for me

- Setup your domain name of your current network. NIS server need to reside within this domain as well.

    domainname <name here> 

- Copy /etc/nsswitch.nis to /etc/nsswitch.conf

    pfexec cp /etc/nsswitch.nis /etc/nsswitch.conf

- Configure NIS Services

    pfexec ypinit -c

This above command will walk you through and ask you to provide NIS server IP addresses etc. and then bind the configured NIS server.

    pfexec /usr/lib/netsvc/yp/ypbind -broadcast

- Finally, enable NIS service and restart all network services..

    svcadm enable nis/client

    svcadm restart milestone/network

- Now, you should be able to verify if NIS is working on your system by doing something like

    ypcat -k passwd -> should return a whole bunch of NIS user names within your domain.

That is all there to do to translate a OpenSolaris system running in DHCP to a static IP address with NIS enabled



Wednesday May 14, 2008

For the last week or so, I have been successfully using OpenSolaris 2008.05 on Tecra M2 laptop and I totally love it. 

 
Since the default installation of OpenSolaris 2008.05, I had to install few packages to make it a developer friendly. Here is the list that I have on my system. You could very well customize it - depending on your needs

Open a command line terminal window and run the following commands to get (you could go through the GUI route if you are GUI person)

    * GCC, Sun Studio, Netbeans (Compiler and Developer IDE)

           pfexec pkg install gcc-dev sunstudio netbeans

    * Apache, MySQL, PHP runtime

           pfexec pkg install amp

    * VNC Client RDesktop (Allows remote connectivity to other desktop. You need VNC Client to connect to other Linux desktop and RDesktop to connect to Windows XP etc)

           pfexec pkg install SUNWvncviewer SUNWrdesktop

Hope, you find this useful.

Friday May 09, 2008

If you had recently tried out OpenSolaris 2008.05 and are wondering, where to find Apache, MySQL or PHP components within this installation, please check out our Getting Started Guide . Originally, this guide is supposed to live under here - but for some reason it didn't happen. Hopefully, learn link within OpenSolaris will be updated soon to reflect this

Monday May 05, 2008

So, if I had to setup a blogging web site, where would I go other than the favorite - WordPress. I followed their famous 5 minute installation steps within OpenSolaris 2008.05 and here we go.

* OpenSolaris 2008.05 is a LiveCD based distribution . So, if you need a AMP stack, you can get this on demand by  running the following command

[sriramn@sriram-laptop]: pfexec pkg install amp

 

* Now, you can initialize and configure Apache and MySQL service by doing  something like

[sriramn@sriram-laptop]: pfexec /usr/sbin/svccfg import /var/svc/manifest/application/database/mysql.xml

[sriramn@sriram-laptop]: pfexec /usr/sbin/svccfg import /var/svc/manifest/network/http-apache22.xml 

[sriramn@sriram-laptop]: pfexec /usr/sbin/svcadm enable network/http:apache22

[sriramn@sriram-laptop]: pfexec /usr/sbin/svcadm enable database/mysql:version_50

 

* Now, let us configure a Wordpress database within MySQL database. So, let us do something like

[sriramn@sriram-laptop]: pfexec /usr/mysql/bin/mysql -u root
 

here is a sample output that you would expect to see...

 

[sriramn@sriram-laptop]: pfexec /usr/mysql/bin/mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Now , let us create a new database and assign a user to this.


  mysql> create database wordpress;

  mysql> grant all privileges on wordpress.* to wp@localhost identified by 'wp';

  mysql> flush privileges;

  mysql> quit;

 

 

* At this point, we have created a new database 'wordpress' with a user 'wp' and with password  'wp' assigned to manage this database. Well, not a whole lot secure but a good starting point though.

 

* Now, you can download WordPress 2.5.1 from here unpack it to /var/apache2/2.2/htdocs - default apache document root directory.

* Now, copy /var/apache2/2.2/htdocs/wordpress/wp-config-sample.php to /var/apache2/2.2/htdocs/wodpresswp-config.php and edit the first four lines of the file to reflect the just now configured database name , user name and password.

[sriramn@sriram-laptop]: cd /tmp

[sriramn@sriram-laptop]: wget http://wordpress.org/latest.zip 

[sriramn@sriram-laptop]: cd /var/apache2/2.2/htdocs/w 

[sriramn@sriram-laptop]: pfexec  unzip /tmp/wordpress-2.5.1.zip

[sriramn@sriram-laptop]: pfexec cp wordpress/wp-config-sample.php wordpress/wp-config.php

pfexec vi wordpress/wp-config.php and edit this file - first four lines and provide your database name, user name and password . In my case, wordpress/wp-config.php file looks something like 

 
<?php
// ** MySQL settings ** //
define('DB_NAME', 'wordpress');    // The name of the database
define('DB_USER', 'wp');     // Your MySQL username
define('DB_PASSWORD', 'wp'); // ...and password
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
 

* That's it . you are now ready to host your blog site . You should be able to reach your blog site by accessing http://localhost/wordpress

Simple, huh . Ah , one last thing - If you would like to take this site into production, you might want to enable to APC cache - which is integrated within OpenSolaris Web(AMP) Stack but not enabled as default. You could do this by editing /etc/php5/5.2.4/conf.d/apc.ini and for more APC related settings , please refer here. 

 

Note: Once you enable APC, please remember to  restart Apache service for this change to take into effect

[sriramn@sriram-laptop]: pfexec /usr/sbin/svcadm restart network/http:apache22


Hope, you find this useful. Feel free to ping me back if you have any suggestions or issues. Alternatively, you could visit OpenSolaris forum

Today, Sun officially released a distribution - OpenSolaris 2008.05 based on a 3 year long open source effort happening with Solaris at  Open Solaris web site. You can catch more on this release from here.

Now, if you are web developer interested in figuring out how it is useful to you, here is what you might like

* Ruby binaries can be downloaded and installed with the single command

   Open a command line terminal window and run the following command

    pfexec pkg install ruby

   Now, you can Ruby specific components by doing some thing like

    pfexec /usr/ruby/1.8/bin/gem install <component name>
 

* MySQL or PHP developers can get their binaries (again from a command line window) by doing some thing like

    pfexec pkg install amp

    The Apache, PHP and MySQL binaries are available under /usr/apache2 , /usr/php5 and /usr/mysql directories respectively.  The corresponding configuration files are found under /etc/apache2 , /etc/mysql and /etc/php5 directories respectively.

* Once you have successfully install MySQL or Apache , you will need to initialize the SMF service.  The following command does the initialization job for you. 

    pfexec /usr/sbin/svccfg import /var/svc/manifest/network/http-apache22.xml

    pfexec /usr/sbin/svccfg import /var/svc/manifest/application/database/mysql.xml

If in case, you wonder what is SMF - you might wanna check out Service Management Facility project page for more information on how this is useful to you. 

* Now, you can start these Apache and MySQL services by doing something like

    pfexec /usr/sbin/svcadm enable network/http:apache22

    pfexec /usr/sbin/svcadm enable database/mysql:version_50 

 

Similarly, the way to stop these services, if you need to , you would do 

pfexec /usr/sbin/svcadm disable network/http:apache22

pfexec /usr/sbin/svcadm disable database/mysql:version_50 

 

 * PHP runtime is configured by default within default Apache Service. So, you should be able to deploy PHP applications by simply writing a PHP application within Web Server document root directory - /var/apache2/2.2/htdocs.

That is all you need to do to get your web site up and running. If you want to do Joomla or MediaWiki, you can simply unpack these tar ball within the web server document root directory (/var/apache2/2.2/htdocs) and hit their index page . This is all you need to get them up and running.

Does this sound simple enough for you to try it out ?

Now, if you need to read more information on this , please check out the Getting Starting Guide from here . Kindly, give OpenSolaris 2008.05 a spin and let us as to what you think and how we can improve it

 



 

This blog copyright 2008 by natarajan