Posts mit dem Label opensolaris werden angezeigt. Alle Posts anzeigen
Posts mit dem Label opensolaris werden angezeigt. Alle Posts anzeigen

Donnerstag, 22. Mai 2008

Traps falls installing things, addons and packages

It turns out that using preconfigured binaries and packages are waste of time.
For example. i install ruby using:

useraccount> pfexec pkg install ruby-dev

The package was compiled on the SUN cc compiler - which is fine, but.....
the setup.rb file of the ruby system has all the environment variables set from the machine it was compiled on - and not mine. Editing that file by hand to adapt the environment to my machine is a night mare.

The RMagick gem and for that matter the source code both look at the environment in the setup.rb file and because nothing in there is relevant to my machine the install fails.

useraccount> pfexec uninstall ruby-dev
useraccount> su
superuseraccount> pfexec rm -r /ruby

So the only way to do this properly is uninstall the ruby pkg, get rid of the installation from my file system, down load the source and compile it again.

useraccount> cd /export/home/tmp
useraccount>pfexec wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p110.tar.bz2
useraccount>pfexec bunzip2 -dc ruby-1.8.6-p110.tar.bz2 | tar xf -

Mittwoch, 21. Mai 2008

Setting up sendmail

according to the man pages sendmail does not let you send mails outside your domain unless you allow it to.

useraccount> svccfg -s svc:/network/smtp:sendmail setprop config/local_only = false
useraccount> svcadm refresh svc:/network/smtp:sendmail
useraccount> svcadm restart svc:/network/smtp:sendmail

testit

useraccount> sendmail someone@domain.com

Dienstag, 20. Mai 2008

Installing RMagick and ImageMagick

OK this took a day to find out.
RMagick wraps around ImageMagick so you need both of them.
To install ImageMagic you need perl - which is fine but you won't be able to install (configure and make) if perl has been compiled with a c compiler from sun. It throws out -KPIC for gcc and it should send gcc a -fPIC when compiling.

So move rename perl link in the /usr/bin and the the perl root directory wherever that might be forexample /perl

get the stable perl source code from perl.com and download it
useraccount> pfexec tar xvf perl_download
useraccount> pfexec perl_download
useraccount> pfexec ./Configure
useraccount> pfexec make
useraccount> pfexec make test
useraccount> pfexec make install

perl should now be in /opt/bin/perl with a link to it from /usr/bin

Once you have done that download ImageMagick source files
useraccount> pfexec tar xvf ImageMagick
useraccount> cd ImageMagick
useraccount> pfexec ./configure --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 CC=gcc
useraccount> pfexec make
useraccount> pfexec make install

ImageMagick should now be in /usr/local/bin

Then test it with
useraccount> /usr/local/bin/convert logo: logo.gif

I did most of the above based on the info here and here

Using Rails with SVN

1. mkdir getready
2. cd getready
3. rails projectname
4. mv projectname trunk
5. mkdir tags
6. mkdir branches
7. cd trunk/config
8. mv database.yml database_example.yml
9. cd ..
10. rm -r tmp/*
11. rm -r log/*
12. cd ..
13 svn import . http://path_to_repository -m "initial import"
14. ...now you can get rid of getready folder - we dont need it anymore
15. svn co http://path_to_project_trunk projectname
16. cd projectname
17. cp config/database_example.yml database.yml
18. add passwords to the database entries
19. svn propset svn:ignore database.yml config/
20. svn propset svn:ignore "*" tmp/
21. svn propset svn:ignore "*" logs/
22. svn commit -m "ignoring files"
23. svn copy http://from_repository_trunk http://repository_tag_path_REL_XXX -m "initial snapshot release"

############################
# just a few things to remember
############################

1. when generating a model, controller or scaffold use the following

useraccount>ruby script/generate scaffold angry farmer bales_of_hey:integer name -c

DON'T FORGET THE -c AT THE END!!!

2. When installing a plugin

ruby script/install name_of_plugin -x

also a great railscast on the basics.

Working

To see the status of the files in the repository use:

useraccount> svn status

To commit changes to the files

useraccount> svn commit -m "somthing about what you are commiting"

To add files that you have changes (they have a ? next to them when you see the status).

useraccount> svn add directory_and_name_of_file

to ignore files

useraccount> svn propset svn:ignore *.pyc dirname
or
useraccount> svn propset svn:ignore dirname

Setting up mysql

go to the user and groups setting in the gnome system administration menu and set the mysql user password to something that makes sense for you. Then give the mysql user a shell '/bin/bash' (setting in the advanced tab of user and groups) and then close all the windows with ok to set the changes.

Then change to user mysql

useraccount>su - mysql
password:

and enter the mysql password

now you should have the bash promt:

#bash>

then enter

#bash>mysql_install_db

then

#bash>mysqld --skip-grant-tables &

then

#bash>mysql

you should get the mysql promt

mysql>UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';

mysql> FLUSH PRIVILEGES;

############################
############################

now open a new terminal window....

useraccount> pfexec /usr/bin/svcadm enable database/mysql:version_50

this should start the mysql database (pfexec /usr/bin/svcadm disable database/mysql:version_50 stops the database)

if you want mysql to automatically start and stop with powerup and powerdown

then do this (which i have not)

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


Installing Mysql

as a normal user

useraccount>pexec pkg install SUNWmysql5

This installs mysql in /usr/mysql

Then change to su root and change the owner and groups of the files in etc and var as follows.

root>chown -R mysql:mysql /etc/mysql
root>chown -R mysql:mysql /var/mysql

also see docs

Installing Rails

as normal user (gems was installed with ruby).

useraccount>pfexec gem install rails --include-dependencies

Rails should now be in /usr/ruby/1.8

installing Ruby

Do as normal user account.

useraccount> pfexec pkg install ruby-dev

ruby should now be in /usr/ruby