Asides

Posts Tagged with tips

OpenSolaris: Getting Disk Information

December 15

Couple of nice commands, hope this helps someone.

root@vps2:/# /usr/sbin/cfgadm -al -s "select=type(disk),cols=ap_id:info"
Ap_Id Information
c0::dsk/c0t8d0 LSILOGIC Logical Volume
c0::dsk/c0t15d0 SEAGATE ST914602SSUN146G
c0::dsk/c0t16d0 SEAGATE ST914602SSUN146G
c0::dsk/c0t18d0 HITACHI H101414SCSUN146G
c0::dsk/c0t19d0 HITACHI H101414SCSUN146G
root@vps2:/#

OR

root@vps1:~# /usr/sbin/raidctl -l 
Controller: 7
Disk: 0.0.0
Disk: 0.1.0
Disk: 0.2.0
Disk: 0.3.0
Disk: 0.4.0
Disk: 0.5.0
root@vps1:~# raidctl -l -g 0.2.0 7
Disk Vendor Product Firmware Capacity Status HSP
----------------------------------------------------------------------------
0.2.0 SEAGATE ST973401LSUN72G 0556 68.3G GOOD N/A
root@vps1:~#

You can of course get all of this using prtconf -v as well.

Tags:

Getting lighttpd to bind to multiple address/socket

December 15

For nginx and apache, you can just specify multiple Listen statements. For lighttpd however, you need to do it a little bit differently.

You need to make sure to specify the port for the 2nd "bind":

server.bind		   = "1.2.3.4"
$SERVER["socket"] == "2.3.4.5:80" {}
Tags:

Setting JAVA_HOME in SMF (environment variables)

December 4

First, ensure your application is in Solaris's SMF. Here is an example for a Tomcat application server. The same steps will work for Glassfish and other Java applications.

Get the FMRI name. The string that starts with "svc".

root@rule:/# svcs -av |grep tomcat6
online - 6:00:59 775330 svc:/network/http:tomcat6-csk
root@rule:/#

Now set the JAVA_HOME and refresh the SMF service.

root@rule:/# svccfg -s svc:/network/http:tomcat6-csk setenv -m stop JAVA_HOME /usr/jdk/latest
root@rule:/# svccfg -s svc:/network/http:tomcat6-csk setenv -m start JAVA_HOME /usr/jdk/latest
root@rule:/# svcadm refresh svc:/network/http:tomcat6-csk
root@rule:/#

That should do it. You can then do ps -ef |grep java to check that you are using the latest JDK available on the system in /usr/jdk/latest.

From time to time, we upgrade the JDK. So, if you have applications that require a specific version you'll of course not want to use /usr/jdk/latest. You can see the other JDK versions available in /usr/jdk.

Update

For Glassfish, you can update /usr/local/glassfish/config/asenv.conf file by adding or changing AS_JAVA="/usr/jdk/latest" to it. That'll also ensure that Glassfish starts up with the correct JRE.

Tags:
 1