It is currently Sat Apr 19, 2014 9:10 am




Post new topic Reply to topic  [ 7 posts ] 
 HOW-TO - FPMI on Ubuntu Server 
Author Message
General
General

Joined: Sun Feb 25, 2007 2:54 pm
Posts: 546
Post HOW-TO - FPMI on Ubuntu Server
Ok, this is my attempt at a how to. No pictures... yet. I am assuming you already have Ubuntu server installed. The commands will look a little different for previous version of Ubuntu server, and I will fill in those gaps at a later time.


1. This step updates all packages currently installed on the server
Code:
sudo apt-get update
sudo apt-get upgrade


1b. Setup networking
Code:
sudo nano /etc/network/interfaces


for dhcp, keep the interface set as follows. Replace eth0 with the desired interface identifier.
Code:
# The primary network interface
auto eth0
iface eth0 inet dhcp


For Static Ip mapping
Code:
# The primary network interface
auto eth0
iface eth0 inet static
    address x.x.x.x
    netmask x.x.x.x
    gateway x.x.x.x


2. Install the java runtime
Code:
sudo apt-get install sun-java6-jre


3.download the factoryPMI executable stack.
Code:
wget "http://www.inductiveautomation.com/downloads/products/?id=16&type=5"


4. Unzip software to the location of your choosing. I use /opt/factorypmi. Set permissions
Code:
sudo mkdir /opt/factorypmi
sudo mv FactoryPMI_3.3.3-b3269.tar.gz /opt/factorypmi/
cd /opt/factorypmi/
sudo tar xzf FactoryPMI_3.3.3-b3269.tar.gz
sudo chown -R root.root .
sudo chmod -R 755 .


5. Setup the startup script
Code:
sudo ln -s  /opt/ignition/startGateway.sh /etc/init.d/factorypmi

Open the script for editing

Code:
sudo nano /opt/ignition/ignition.sh

Modify the last line of code scroll all the way to the end and add a space and &. The end of the line should look as follows
Code:
.gateway.Service &


install the script and delete the calls to shutdown factorypmi, as this code has not been added yet. Set permissions
Code:
sudo update-rc.d factorypmi defaults
sudo rm /etc/rc0.d/K20factorypmi
sudo rm /etc/rc1.d/K20factorypmi
sudo rm /etc/rc6.d/K20factorypmi
sudo chmod 755 factorypmi


6.Startup the service. For Ubuntu 9.10+, use the following command
Code:
sudo service factorypmi start


For 9.04 and before, use
Code:
sudo /etc/init.d/factorypmi start


7. Browse to http://ipaddress:8080

That should be everything you need to get a working copy of FPMI working. I will add to this walkthough soon on how to install MySQl either from the repositories or from tar.gz. Also, I am looking a modifying the startup script to allow shutdown of the service, and running it as a different user.


Last edited by Kyle Chase on Fri Nov 20, 2009 12:00 am, edited 3 times in total.

Tue Nov 17, 2009 1:54 am
Profile WWW
General
General

Joined: Sun Feb 25, 2007 2:54 pm
Posts: 546
Post Re: HOW-TO - FPMI on Ubuntu Server
This part will explain how to install MySQL from the Ubuntu respoitories.

1.Install MySQL using apt-get
Code:
sudo apt-get install mysql-server-5.1


2.Login to mysql
Code:
mysql -u root -p


3. I like to change the root users name for a bit more security
Code:
update mysql.user set user='somename' where user='root';
flush privileges;


4.Add a remote user. % mean is a wildcard, in this case, it lets us connect from anywhere. This could be a security issue, but thats up to you to decide. Use a strong password. the *.* part corresponds to schema.table
Code:
grant all privileges on *.* to "someotheruser"@"%" identified by "somepass";
flush privileges;
exit


And the should pretty much do it. Now just connect the dots and your good to go.


Last edited by Kyle Chase on Tue Nov 17, 2009 9:34 pm, edited 4 times in total.

Tue Nov 17, 2009 7:49 am
Profile WWW
General
General

Joined: Sun Feb 25, 2007 2:54 pm
Posts: 546
Post Re: HOW-TO - FPMI on Ubuntu Server
The version of MySQL in the Ubuntu repositories is not usually kept up to date. I normally install using binaries from MySQL.

1.Add mysql user. Make is a system account, and do not make a home directory.
Code:
sudo useradd -M -r mysql


2.Download binaries. You can replace the url with any source you want.
Code:
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.40-linux-i686-glibc23.tar.gz/from/http://mirror.trouble-free.net/mysql_mirror/


3. Extract and move binaries to the final destination.
Code:
tar xzf mysql-5.1.40-linux-i686-glibc23.tar.gz
sudo mv mysql-5.1.40-linux-i686-glibc23 /usr/local


4. Sym Link the install directory to a standard directory
Code:
cd /usr/local
sudo ln -s /usr/local/mysql-5.1.40-linux-i686-glibc23/ mysql


5.temporarily set owner user and group to mysql
Code:
cd mysql
sudo chown -R mysql .
sudo chgrp -R mysql .


6. Initialize the database schemas
Code:
sudo scripts/mysql_install_db --user=mysql


7. Set permanent owners.
Code:
sudo chown -R root .
sudo chown -R mysql data


8.Copy the mysql server init script to /etc/init.d and install
Code:
sudo cp support-files/mysql.server /etc/init.d/mysql
sudo update-rc.d mysql default


9.Link mysql binaries to /usr/bin
Code:
sudo ln -s /usr/local/mysql/bin/* /usr/bin


10. Start MySQL. For 9.10+
Code:
sudo service mysql start


For 9.04-
Code:
sudo /etc/init.d/mysql start


11. Log into mysql and set up users. Remove the test schema. Create factorypmi schema.
Code:
mysql -u root
drop schema test;
create schema factorypmi;
delete from mysql.user where user='';
update mysql.user set user='someuser',password=PASSWORD('somepassword') where user='root';
flush privileges;


12. Create remote user.
Code:
grant all privileges on *.* to 'someuser2'@'%' identified by 'somepassword';
flush privileges;
exit


I think thats everything. Let me know if i forgot anything.


Last edited by Kyle Chase on Tue Nov 17, 2009 9:33 pm, edited 4 times in total.

Tue Nov 17, 2009 7:51 am
Profile WWW
General
General

Joined: Fri Aug 03, 2007 11:39 am
Posts: 625
Location: Devon, England
Post Re: HOW-TO - FPMI on Ubuntu Server
Kyle,

This looks great. Seeing it laid out like this makes a lot of sense. I'm going to give this a go and let you know how I get on.

_________________
Al
DataCapture Ltd.

www.datacap.co.uk


Tue Nov 17, 2009 9:39 am
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 2:46 pm
Posts: 4016
Location: Sacramento, CA
Post Re: HOW-TO - FPMI on Ubuntu Server
Kyle - you're the man. Fully expect us to take your work and turn it into a whitepaper/howto. Don't worry - we'll cite our sources ;)

_________________
Carl Gould
Software Development
Inductive Automation


Tue Nov 17, 2009 8:58 pm
Profile WWW
General
General

Joined: Sun Feb 25, 2007 2:54 pm
Posts: 546
Post Re: HOW-TO - FPMI on Ubuntu Server
The only thing I dont like about the write up is running FactoryPMI as root. I dont know how to start java as another user without the wrapper. I know the next version of the software has the wrapper built in, and I am planning on doing a writeup for that too.


Tue Nov 17, 2009 9:11 pm
Profile WWW
General
General

Joined: Mon Sep 29, 2008 11:38 am
Posts: 302
Post Re: HOW-TO - FPMI on Ubuntu Server
Kyle, if you don't mind i'm going to copy your idea and list how to get Ignition installed under RHEL 5.

Just different enough I think it might be useful.


Thu Apr 29, 2010 9:56 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: