2004-11-07
Installation fr utvecklingsarbete
Innehll
Installation fr utvecklingsarbete	1
Installation:	1
Alternativ installation med kompilering	2
Bibliotek.	2
Installation av MySQL 	3
MySQL Navigator	4



Frutsttningen fr att kunna installera OLFIX r att MySQL  och Qt finns installerad p datorn.
OBS! MySQL skall vara startad. Det bsta r att ordna det s att MySQL startas nr datorn startas.

Installation:
Se till att du r ?root?.
shell> cd /opt
shell> gunzip < /path/to/OLFIX-VERSION.tar.gz | tar xvf -
shell> chown -R olfix olfix
shell> chgrp -R olfix olfix
shell> cd /usr/share/olfix/bin
shell> chmod 0010 *
shell> chmod 2111 OLFIXW
shell> cp /usr/share/olfix/util/.olfixrc $HOME/.olfixrc
shell> cd $HOME
shell> chown DittNamn .olfixrc
shell> chgrp DittNamn .olfixrc
shell> chmod 766 .olfixrc
shell> chown DittNamn start_olfix
shell> chgrp DittNamn start_olfix
shell> chmod 766 start_olfix

shell> cd /usr/share/olfix/sql

Att skapa databasen olfix:

1.Editera *.sql-filerna fr att passa dig.
       Framfr allt skvgar som finns i LoadAll.sql, se pkt 8.
2.Lgg upp user olfix i operativsystemet (annars funkar inte anropen till databasen olfix).
3.Se till att bli root
4.Editera filen /usr/share/olfix/sql/add_user_dittnamn.sql
Leta reda p detta avsnitt;
	)
	VALUES
	(
	"localhost",
	"ditt_userid",
	PASSWORD("ditt_password"),
	"Y",
	"Y",
	"Y",
Skriv in ditt eget userid, med gemener (sm bokstver), och ditt eget password.
Password kommer i detta fall att ligga i klartext i databasen.
Jag frordar att du utelmnar password och gr in i databasen och ndrar password
vilket d kommer att bli krypterat.
Detta kan gras med fljande procedur:
	shell>mysql -u root
	shell>use mysql
	shell>update user set password=PASSWORD('DittPassword') where User=?DittUserid?;
	shell>FLUSH PRIVILEGES;

5.Shell> cd /usr/share/olfix/data
6.Editera filen USRdata.txt
	"OLFIX","Olfix Superuser","IT","Stab"
	"USERID","Ditt Namn","Avd","Sektion"
	Byt ut USERID till det userid du anvnder nr du loggar in p datorn.
	OBS! USERID ska skrivas med versaler (stora bokstver).
	Byt ut Ditt Namn till ditt eget fullstndiga namn och ndra Avd och Sektion tillhr
	aktuell benamning p din avdelnin g och din sektion.
7.Editera filen MinimumRIGHTSdata.txt
"userid","ADDRGTW"
"userid","LSTRGTW"
"userid","PRGLST"
"userid","RGTADD"

Byt ut ordet userid mot ditt userid fr olfix (USRdata.txt).
OBS! Userid ska skrivas med versaler (stora bokstver).

8.Kr  shell> mysql -h  localhost -u root -p < add_user_DittNamn.sql > mysql.out
9.Kr  shell> mysql -h  localhost -u root -p < add_user_olfix.sql > mysql.out
10.Kr  shell> mysql -h localhost -u root -p < CreateAll.sql> mysql.out
11.Kr  shell> mysql -h localhost -u root -p < LoadAll.sql> mysql.out
12.Kr  shell> mysql -h localhost -u root -p <LoadUSR.sql> mysql.out
13.Kr  shell> mysql -h localhost -u root -p <LoadMinimumRights.sql> mysql.out

Hr kan du fortstta till pkt 14.


Alternativ installation med kompilering

	Bibliotek.

Skapa fljande bibliotek:
	/usr/share/olfix
	/usr/share/olfix/bin	(Hr ska alla binrfiler lggas efter kompilering)
	/usr/share/olfix/data
	/usr/share/olfix/doc
	/usr/share/olfix/doc/image
	/usr/share/olfix/include
	/usr/share/olfix/lib
	/usr/share/olfix/sql
	/usr/share/olfix/src
	/usr/share/olfix/util

Fljande behrigheter br du ha:
bin   se nedan
data  chmod +rw *
doc  chmod +rw *
sql   chmod +rw *
src   chmod +rwx *
util  chmod +rwx *

13.Kompilera programmen:
  Brja med att editera alla  ?make_FUNKTION.txt? filer s att de passar dig.
  Framfrallt se till s att du fr rtt path.
	Med hjlp av alla make_FUNKTION.txt kan programmen kompileras.
	Det finns ocks en make_ALL.txt som kompilerar alla programmen.
	Binrfilerna, de exekverbara programmen ska hamna i biblioteket /usr/share/olfix/bin
	Man kan naturligtvis kompilera programmen p sitt eget vis.
	Hr gller det att bde  make_FUNKTION.txt och kllkodsfilerna finns i samma
	bibliotek, /usr/share/olfix/src.

Slut p alternativ kompilering.

14.Kopiera filen .olixrc till $HOME och editera den s den passar dig. .olfixrc mste finnas i
     $HOME hos alla anvndare som ska kra OLFIX.
     OBS! VTMP=/tmp/ fr inte avslutas med ett returntecken. Mste ligga sist i filen.

16.Det frsta man behver gra r att se till att behrigheterna fr anvndarna till de olika funktionerna
     stts.
Installationen innehller bara de allra ndvndigaste behrigheterna fr anvndaren olfix.

17.Flytta alla binrfiler till /usr/share/olfix/bin.

Punkt 18 r inte ndvndig.
---------------------------
18.Behrigheterna p filerna ska gras enligt fljande:
     Stt uid=olfix och gid=olfix
chown olfix *
chgrp olfix *
Programmet OLFIXW
chmod 2111 OLFIXW
---x--s--x 1 olfix olfix 68637 feb 10 15:12 OLFIXW

vriga program
chmod 0010 program
------x--- 1 olfix olfix 58239 jan 29 05:09 program

19. Installation av MySQL

The basic commands you must execute to install and use a MySQL binary distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql.VERSION-OS.tar.gz  | tar xvf -
shell> ln -s mysql.VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root /usr/local/mysql
shell> chown -R mysql /usr/local/mysql/data
shell> chgrp -R mysql /usr/local/mysql
shell> chown -R root /usr/local/mysql/bin
shell> bin/safe_mysqld ?user=mysql &

Se till att mysqld startas automatiskt vid start av datorn.
Fr mera information se MySQLReferenseManual, http://www.mysql.com/documentation/

Fr att kunna kompilera C-programmen mste ven biblioteket
/usr/include/mysql finnas

20.Installation av MySQLCC

MySQLCC = grafiskt grnssnitt till MySQL
MySQLCC kan hmtas frn:
http://www.mysql.com/downloads/mysqlcc.html
Inkluderrat i leveransen finns
/usr/share/olfix/mysqlcc-0.9.4-linux-glibc23.tar.gz
==============================================================================

Linux Binary Installation
To install a binary distribution, follow the steps below:

   1. Obtain a distribution file from one of the sites listed in *Note Getting MySQL: Getting MySQL.

      MySQL Control Center binary distributions are provided as compressed `tar' archives and have names like `mysqlcc-VERSION-OS.tar.gz', where `VERSION' is a number (for example, `0.8.6'), and `OS' indicates the type of operating system for which the distribution is intended (for example, `linux').

   2. Pick the directory under which you want to unpack the distribution, and move into it. In the example below, we unpack the distribution under `/usr/local' and create a directory `/usr/local/mysqlcc' into which MySQL Control Center is installed. (The following instructions therefore assume you have permission to create files in `/usr/local'. If that directory is protected, you will need to perform the installation as `root'.)

   3. Change into the intended installation directory:

          shell> cd /usr/local

   4. Unpack the distribution and create the installation directory:

          shell> tar xvzf /path/to/mysqlcc-VERSION-OS.tar.gz
          shell> ln -s mysqlcc-VERSION-OS mysqlcc

      The first command creates a directory named `mysqlcc-VERSION-OS'. The second command makes a symbolic link to that directory. This lets you refer more easily to the installation directory as `/usr/local/mysqlcc'.

   5. Change into the installation directory: shell> cd mysqlcc

After everything has been unpacked and installed, you should now be able to execute MySQL Control Center and test your distribution.

You can start MySQL Control Center with the following command:

    shell> /usr/local/mysqlcc/mysqlcc

NOTE: MySQL Control Center is a Graphical GUI Client. This means you will need to be running in an X environment before starting MySQL Control Center with the above command.
==============================================================================
