Toolpack prerequisite Solaris10 Intel 2-3

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(Toolpack System Database)
(add mysql connection through host name)
 
(4 intermediate revisions by 3 users not shown)
Line 32: Line 32:
 
   pkgadd -d mysql-5.0.67-sol10-x86-local
 
   pkgadd -d mysql-5.0.67-sol10-x86-local
  
Retrieve mysql odbc from http://dev.mysql.com/get/Downloads/Connector-ODBC/3.51/mysql-connector-odbc-3.51.27-solaris10-x86-32bit.tar.gz
+
Retrieve mysql odbc from http://dev.mysql.com/get/Downloads/Connector-ODBC/5.1/mysql-connector-odbc-5.1.5-solaris10-x86-32bit.pkg.gz/from/http://ftp.gwdg.de/pub/misc/mysql/
 
from http://mysql.serenitynet.com/
 
from http://mysql.serenitynet.com/
  
Line 205: Line 205:
 
   chmod +x /etc/rc2.d/S98mysql
 
   chmod +x /etc/rc2.d/S98mysql
  
9. Start mysql
+
9. Start MySQL
 
   /etc/rc2.d/S98mysql start
 
   /etc/rc2.d/S98mysql start
 +
 +
10. Verify the MySQL connection
 +
:Log onto mysql, create a tbdb user. The ''[HostName]'' and ''[DatabasePassword]'' will need to be supplied to the toolpack installer.
 +
:If you cannot log in, it is possible that the host name is not configure properly, use an IP Address instead.
 +
 +
  mysql -u tbdb -h '[HostName]' -p
 +
  exit
 +
 +
:Example:
 +
 +
  mysql -u root -h sol10i32-02 -p
 +
  exit
  
 
==== Toolpack System Web Portal ====
 
==== Toolpack System Web Portal ====
Line 230: Line 242:
 
install fcgi:
 
install fcgi:
  
get fcgi from http://www.fastcgi.com/
+
get fcgi from http://www.fastcgi.com/dist/fcgi.tar.gz
 
+
 
   /usr/local/bin/tar -zxf fcgi-2.4.0.tar.gz
 
   /usr/local/bin/tar -zxf fcgi-2.4.0.tar.gz
 
   cd fcgi-2.4.0/
 
   cd fcgi-2.4.0/
Line 241: Line 252:
 
install rubygems:
 
install rubygems:
  
get rubygems from http://www.rubyonrails.org/down
+
get rubygems from http://rubyforge.org/frs/download.php/55066/rubygems-1.3.2.tgz
  
 
   /usr/local/bin/tar -zxf rubygems-1.3.2.tgz
 
   /usr/local/bin/tar -zxf rubygems-1.3.2.tgz
Line 254: Line 265:
 
   ln -s /usr/ucb/install /usr/local/bin/ginstall
 
   ln -s /usr/ucb/install /usr/local/bin/ginstall
 
   gem install fcgi --include-dependencies
 
   gem install fcgi --include-dependencies
 
  
 
==== Toolpack Stream server ====
 
==== Toolpack Stream server ====
Line 315: Line 325:
  
 
   TBDB_PORT_SEC      = 3306
 
   TBDB_PORT_SEC      = 3306
 +
 +
 +
== Validation Guide (Optional) ==
 +
If you would like to verify your installation go to the [[Toolpack_Installation:Validate_Toolpack_Installation|Toolpack Validation Guide]]

Latest revision as of 07:46, 29 May 2009

This page shows the Toolpack 2-3 prerequisites for Solaris Intel 10.

Contents

Toolpack Prerequisite

All prerequisites, unless stated otherwise, are available from the site http://www.sunfreeware.com.

Export those environment variable:

 export PATH=/usr/local/mysql/bin/:/usr/local/mysql/sbin/:/usr/local/bin:/usr/ccs/bin:$PATH:/usr/sfw/bin
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/ccs/lib:/usr/sfw/lib


Toolpack Basic packages

 pkgadd -d gcc-3.4.6-sol10-x86-local
 pkgadd -d ncurses-5.6-sol10-x86-local
 pkgadd -d glib-1.2.10-sol10-intel-local
 pkgadd -d db-4.2.52.NC-sol10-intel-local
 pkgadd -d libiconv-1.11-sol10-x86-local
 pkgadd -d libintl-3.4.0-sol10-x86-local
 pkgadd -d openssl-0.9.8k-sol10-x86-local
 pkgadd -d tar-1.21-sol10-x86-local
 pkgadd -d zlib-1.2.3-sol10-x86-local
 pkgadd -d make-3.81-sol10-x86-local


Toolpack System Database

The Toolpack system database is used by the main host and requires mySQL database server. The system database packages are as follows:

 pkgadd -d mysql-5.0.67-sol10-x86-local

Retrieve mysql odbc from http://dev.mysql.com/get/Downloads/Connector-ODBC/5.1/mysql-connector-odbc-5.1.5-solaris10-x86-32bit.pkg.gz/from/http://ftp.gwdg.de/pub/misc/mysql/ from http://mysql.serenitynet.com/

Install mysql odbc connector.

 /usr/local/bin/tar -zxf mysql-connector-odbc-3.51.27-solaris10-x86-32bit.tar.gz
 cp mysql-connector-odbc-3.51.27-solaris10-x86-32bit/lib/* /usr/lib
 crle -l /lib:/usr/lib:/usr/local/lib


Configure Myodbc:

Edit the file /etc/odbcinst.ini (you may have to create it) and make sure that the driver directs to the libmyodbc3_r.so file.

 [MySQL]
 Description     = ODBC for MySQL
 Driver          = /usr/lib/libmyodbc3_r.so

Open a shell prompt and execute the following commands:

Create the mysql group and user

 groupadd mysql
 useradd  -g mysql  mysql
 cd /usr/local/mysql
 chgrp -R mysql .
 chown -R mysql .

Give access to the hostname program

 ln -s /usr/bin/hostname /usr/local/bin/hostname

Install the database

 /usr/local/mysql/bin/mysql_install_db --user=mysql

Start the server

 /usr/local/mysql/bin/mysqld_safe --old-passwords -user=mysql &

Set the root password

 /usr/local/mysql/bin/mysqladmin -u root password '[MyPassword]'

Log onto the database using the client and create a new user (we recommend tbdb) then grant it all priviledges.

 /usr/local/mysql/bin/mysql -u root -p
 GRANT ALL PRIVILEGES ON *.* TO 'tbdb'@"%" IDENTIFIED BY '[DatabasePassword]';
 FLUSH PRIVILEGES;

ex.

 GRANT ALL PRIVILEGES ON *.* TO tbdb@'%' IDENTIFIED BY 'tbdbpw';
 FLUSH PRIVILEGES;


print the list of user

 select * from mysql.user;

Remove all the 'empty' users:

In the following example you should remove the 4th and 5th user.

 mysql> select * from mysql.user;
 +----------------+------+------------------+-------------+-------------+
 | Host           | User | Password         | Select_priv | Insert_priv |
 +----------------+------+------------------+-------------+-------------+
 | localhost      | root | 68d4f47c49a579c9 | Y           | Y           |
 | tl-sol10i32-01 | root |                  | Y           | Y           |
 | 127.0.0.1      | root |                  | Y           | Y           |
 | localhost      |      |                  | N           | N           |
 | tl-sol10i32-01 |      |                  | N           | N           |
 | %              | tbdb | 68d4f47c49a579c9 | Y           | Y           |
 +----------------+------+------------------+-------------+-------------+
 6 rows in set (0.00 sec)


Delete command:

 DELETE FROM mysql.user where user='tobedeleted';
 exit

ex.

 DELETE FROM mysql.user where user='';
 exit

stop mysql_safe

 pkill mysql


copy the new configuration file

cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf


Edit the mysql configuration file

 vi /etc/my.cnf

Make sure that under the [mysqld] section that the 2 following lines are present:

  • log-bin= (its value is not important)
  • server-id= (it must be a non-zero value, and the value must be unique if you are using a multi-host system).

Here is an example:

 # The MySQL server
 [mysqld]
 port            = 3306
 socket          = /tmp/mysql.sock
 skip-locking
 key_buffer = 16M
 max_allowed_packet = 1M
 table_cache = 64
 sort_buffer_size = 512K
 net_buffer_length = 8K
 read_buffer_size = 256K
 read_rnd_buffer_size = 512K
 myisam_sort_buffer_size = 8M
 
 # Don't listen on a TCP/IP port at all. This can be a security enhancement,
 # if all processes that need to connect to mysqld run on the same host.
 # All interaction with mysqld must be made via Unix sockets or named pipes.
 # Note that using this option without enabling named pipes on Windows
 # (via the "enable-named-pipe" option) will render mysqld useless!
 #
 #skip-networking
 
 # Disable Federated by default
 skip-federated
 
 # Replication Master Server (default)
 # binary logging is required for replication
 log-bin=mysql-bin
 
 # required unique id between 1 and 2^32 - 1
 # defaults to 1 if master-host is not set
 # but will not function as a master if omitted
 server-id       = 1


Retrieve the unix odbc package from http://www.unixodbc.org/pub/unixODBC/binaries/unixODBC-2.2.14-i386.pkg.gz.

Install odbc:

 pkgadd -d unixODBC-2.2.14-i386.pkg


Continue here:

7. Create the file 'S98mysql' in the directory /etc/rc2.d to start the database server automatically upon machine startup:

 vi /etc/rc2.d/S98mysql

Put the following information in the file (new one):

 #!/sbin/sh
 PATH=$PATH:/usr/local/mysql/bin
 export PATH
 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mysql/lib:
 export LD_LIBRARY_PATH
 case "$1" in
 start)
 cd /usr/local/mysql/libexec; /usr/local/mysql/libexec/mysqld --user=mysql &
 ;;
 stop)
 pkill .*mysqld.*
 ;;
 *)
 echo "Usage: $0 { start | stop }"
 exit 1
 ;;
 esac
 exit 0

8. Set the executable bit on the newly created script

 chmod +x /etc/rc2.d/S98mysql

9. Start MySQL

 /etc/rc2.d/S98mysql start

10. Verify the MySQL connection

Log onto mysql, create a tbdb user. The [HostName] and [DatabasePassword] will need to be supplied to the toolpack installer.
If you cannot log in, it is possible that the host name is not configure properly, use an IP Address instead.
 mysql -u tbdb -h '[HostName]' -p
 exit
Example:
 mysql -u root -h sol10i32-02 -p
 exit

Toolpack System Web Portal

 pkgadd -d expat-2.0.1-sol10-x86-local
 pkgadd -d freetype-2.3.1-sol10-x86-local
 pkgadd -d fontconfig-2.4.2-sol10-x86-local
 pkgadd -d render-0.8-sol10-intel-local
 pkgadd -d xrender-0.8.3-sol10-intel-local
 pkgadd -d xft-2.1.2-sol10-intel-local
 pkgadd -d gdbm-1.8.3-sol10-intel-local
 pkgadd -d tk-8.5.3-sol10-x86-local
 pkgadd -d tcl-8.5.3-sol10-x86-local
 pkgadd -d libedit-20070302_2.10-sol10-x86-local
 pkgadd -d ruby-1.8.7p72-sol10-x86-local
 pkgadd -d bzip2-1.0.5-sol10-x86-local
 pkgadd -d pcre-7.9-sol10-x86-local
 pkgadd -d lighttpd-1.4.22-sol10-x86-local
 pkgadd -d libxml2-2.6.31-sol10-x86-local


install fcgi:

get fcgi from http://www.fastcgi.com/dist/fcgi.tar.gz

 /usr/local/bin/tar -zxf fcgi-2.4.0.tar.gz
 cd fcgi-2.4.0/
 ./configure
 make install
 cd ..


install rubygems:

get rubygems from http://rubyforge.org/frs/download.php/55066/rubygems-1.3.2.tgz

 /usr/local/bin/tar -zxf rubygems-1.3.2.tgz
 cd rubygems-1.3.2
 ruby setup.rb 
 cd ..


Install 'fastcgi' plugins for ruby framework using the following command:

 export FTP_PASSIVE=1
 ln -s /usr/ucb/install /usr/local/bin/ginstall
 gem install fcgi --include-dependencies

Toolpack Stream server

 pkgadd -d tcpdump-4.0.0-sol10-x86-local
 pkgadd -d libpcap-1.0.0-sol10-x86-local

Toolpack System installation

The following steps need to be done after running the Toolpack installer.

Now it is time to install the Toolpack system itself, but rememeber to come back here afterward!

Create a symbolic link of lighttpd

 ln -s /usr/local/sbin/lighttpd /usr/sbin/lighttpd


Modify the all the lighttpd configuration files

 vi /lib/tb/toolpack/pkg/2.3.0/web/etc/lighttpd.conf
 vi /lib/tb/toolpack/pkg/2.3.0/web/etc/lighttpd.conf.in
 vi /lib/tb/toolpack/pkg/2.3.0/web/etc/lighttpd_12358.conf  <--- the number may be different(should be equal to the TBX_GW_PORT) or may not exist at all yet

Look for the Plug rails section and modify the ruby path from /usr/bin/ruby to /usr/local/bin/ruby like so:

 ## Plug rails
 fastcgi.server =  (".fcgi" => ( "railsapp" =>
   ( "min-procs" => 1,
     "max-procs" => 1,
     "socket" => "/tmp/ruby-railsapp_12401.fastcgi",
     "bin-path" => "/usr/local/bin/ruby /lib/tb/toolpack/pkg/2.3.0/web/public/dispatch.fcgi"
   )
 ))


Modify the following files:

 vi /lib/svc/method/tbtoolpack_12358       <-- the name of the file may be different according to your gateway port
 vi /lib/tb/toolpack/.helper/tbtoolpack.svc.Solaris10

Add those lines in each files under the line that starts with 'TBSERVICE_CONF'

 PATH=/usr/local/mysql/bin/:/usr/local/mysql/sbin/:/usr/local/bin:/usr/ccs/bin:$PATH:/usr/sfw/bin
 export PATH
 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/ccs/lib:/usr/sfw/lib
 export LD_LIBRARY_PATH


Modify the toolpack.ini file (No need to do in the slave host):

 vi /lib/tb/toolpack/setup/12358/2.3/toolpack.ini   <--- path maybe different, if you have used a different gateway port

Add the following line at the end of the file:

 TBDB_PORT_SEC       = [MysqlPort]

ex.

 TBDB_PORT_SEC       = 3306


Validation Guide (Optional)

If you would like to verify your installation go to the Toolpack Validation Guide

Personal tools