Suse appears to use init scripts to launch apps at start up and you will need to write a custom init script to launch your socket.php script.
At the bare minimum, you could create an executable script in /etc/rc2.d named S99socket containing
#!/bin/sh
/path/to/php /path/to/socket.php &
Download the following debian package: http://www.expressaas.com/distrib/release/red5-openmeetings_1.0.2760.noarch.deb
And install it using sudo dpkg -i red5-openmeetings_1.0.2760.noarch.deb command. All additional utilities, such as Openoffice, Ghostscript, Imagemagick and Swftools should be installed as described below.
this sample is rather outdated
that is all!
no copy of any dirs, no /etc/init.d/, ^^ In doubt see what is written down in here:http://code.google.com/p/openmeetings/wiki/InstallationOpenMeetings There is no mention of any init.d-script or other copy actions.
In this article I will use aptitude to install packages, if you don’t have apptitude please install it before going forward :
$su #apt-get update #apt-get install aptitude
After aptitude we need Debian GNU/Linux, I use version 4.0 (code name Etch), befor installing any thing else I recommend you to create a directory and manage every thing from there:
#su #mkdir /root/tmpOpenMeetings/ #cd /root/tmpOpenMeetings/
OpenMeetings can work with wide range of databases, I will install OpenMeetings with MySQL, to install !MySQL server:
aptitude install mysql-server
Add/edit the following lines to /etc/mysql/my.conf to enable localization:
[mysqld] default-character-set=utf8 character-set-server=utf8
If you would like exchange Presentation and Office documentation in OpenMeetings, you will nedd xvfb and OpenOffice.org
#aptitude install xvfb openoffice.org
Then edit Setup.xcu:
#vim /usr/lib/openoffice/share/registry/data/org/openoffice/Setup.xcu
You should insert following lines after: <node oor:name=”Office”>:
<prop oor:name=“ooSetupConnectionURL” oor:type=“xs:string”> <value>socket,host=localhost,port=8100;urp</value> </prop>
ImageMagick is a software suite for image manipulation and display, supporting close to 100 image formats. It is mainly used to perform various transformation and conversion operations on images and Ghostscript is a suite of software based on an interpreter for Adobe Systems’ PostScript and Portable Document Format (PDF) page description languages.
To install this tools run:
#aptitude install imagemagick gs-gpl
SWFTools s a collection of SWF manipulation and creation utilities written by Rainer Böhme and Matthias Kramm. It is released under the GPL.
#aptitude install swftools
If you get this message: “Couldn’t find any package whose name or description matched “swftools” ” please download swftools directly from web with running:
#wget http://ftp.it.debian.org/debian/pool/main/s/swftools/swftools_0.8.1-1_i386.deb
befor installing this ackage should install “libart-2.0-2 ” so run:
#aptitude install libart-2.0-2
and now install SWFTools:
#dpkg -i swftools_0.8.1-1_i386.deb
red5 is a Open Source Flash Server that OpenMeetings based on, so you should install it, and befor installing red5 should install Java Runtime Environment and Java development Kit run:
#aptitude install sun-java5-bin #aptitude install sun-java5-demo #
If aptitude gives you any error, please download all file with wget and then install
#wget http://ftp.tr.debian.org/debian/pool/non-free/s/sun-java5/sun-java5-demo_1.5.0-13-1_i386.deb #wget http://ftp.de.debian.org/debian/pool/non-free/s/sun-java5/sun-java5-jdk_1.5.0-14-1etch1_i386.deb # wget http://ftp.de.debian.org/debian/pool/non-free/s/sun-java5/sun-java5-bin_1.5.0-15-1_i386.deb #dpkg -i sun-java5-demo_1.5.0-13-1_i386.deb sun-java5-jdk_1.5.0-14-1etch1_i386.deb sun-java5-bin_1.5.0-15-1_i386.deb
Now download red5 for Debian GNU/Linux and install it:
#wget http://dl.fancycode.com/red5/0.6.3/debian/red5_0.6.3-1_all.deb #dpkg -i red5_0.6.3-1_all.deb
OpenLaszlo is an open source platform for the development and delivery of rich Internet applications. to installing it, run:
#wget http://download.openlaszlo.org/4.0.6/openlaszlo-4.0.6-unix.tar.gz #tar -xvf openlaszlo-4.0.6-unix.tar.gz #mv lps-4.0.6/ /opt/
Note: there is no need to install OpenLaszlo if you only use the application but don’t want to modify it.
Note: you might would like to have a look at this shell script to start/stop/restart/status, if yes you can use this how-to.
#wget http://openmeetings.googlecode.com/files/openmeetings051.zip #unzip openmeetings051.zip
#cp openmeetings/conf/mysql_hibernate.cfg.xml openmeetings/conf/hibernate.cfg.xml
Now edit file and config your database:
#vim openmeetings/conf/hibernate.cfg.xml
<property name=“connection.username”><DB_USER></property> <property name=“connection.password”><DB_PASSWORD></property> <property name=“connection.url”>jdbc:mysql://<DB_HOST>/<DB_NAME></property>
For example my config look likes:
<!– User / Password –> <property name=“connection.username”>root</property> <property name=“connection.password”>dj76shwrsh16xsvak1</property> <!– Database Settings –> <property name=“connection.driver_class”>com.mysql.jdbc.Driver</property> <property name=“dialect”>org.hibernate.dialect.MySQLInnoDBDialect</property> <property name=“connection.url”>jdbc:mysql://localhost/openmeetings?useUnicode=true&createDatabaseIfNotExist=true&characterEncoding=utf-8</property>
#aptitude install subversion
Get (checkout) OpenMeetings latest snapshot:
#svn checkout http://openmeetings.googlecode.com/svn/branches/dev/
# mv dev/ OpenMeetingsFromSVN #cp -r OpenMeetingsFromSVN/laszlo/client/xmlcrm/videoconference/ /opt/lps-4.0.6/Server/lps-4.0.6/
Now, first I update my language files:
#cp OpenMeetingsFromSVN/xmlcrm/java/webapp/openmeetings/languages/* openmeetings/languages/.
Ok, It’s time to place my OpenMeting in red5 document root to serving:
#cp -r openmeetings/ /usr/lib/red5/webapps/
#xvfb-run –server-args=’-screen 0 800×600x16′ -a /usr/lib/openoffice/program/soffice -headless -nologo -norestore & #export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun #/opt/lps-4.0.6/Server/tomcat-5.0.24/bin/startup.sh #/etc/init.d/red5 start
Instead of using a virtual frame buffer you may install and use a /etc/init.d/ooomeetings service.
The last part of instalation is web based, with your web browser (Firefox, Opera, IE, …) and servers IP address and port 5080 (default):
http://$YOUR_IP:5080/openmeetings/Install
For example: http://127.0.0.1:5080/openmeetings/Install
after putting information in forms, OpenMeetings will initialize a DataBase (based on information that we gived to him) and now you can access OpenMeetings first page at:
http://$YOUR_IP:8080/lps-4.0.6/videoconference/
For example: http://127.0.0.1:5080/openmeetings/
Congratulation, OpenMeetings is ready to use
If you get any message about locales or fonts, you can use :
#dpkg-reconfigure locales #aptitude install xfonts-base
If you would like to change rtmp host, you can use:
vim /opt/lps-4.0.6/Server/lps-4.0.6/videoconference/config.xml
<?php
require('GoogleMapAPI.class.php');
$map = new GoogleMapAPI('map1');
$map->setAPIKey('ABQIAAAAPOHd09dXhJtbKHeZpxlh6BTdM_BGb_HRDyhTa-dAuFdRUQ382BTsqAFfGu_x3jaT_hgEvzyEiREMIg');
$map->setMapType('map');
$map->enableInfoWindow();
$map->enableDirections();
$map->setInfoWindowTrigger('mouseover');
$map->setWidth('400px');
$map->setHeight('400px');
$map->setFT('13.786987220018625,100.60581922531128','13.780276823001238,100.60309410095215');
?>
<html ">
<head>
<?php $map->printHeaderJS(); ?>
<?php $map->printMapJS(); ?>
<!-- necessary for google maps polyline drawing in IE -->
<style type="text/css">
v\:* {
behavior:url(#default#VML);
}
</style>
</head>
<body onload="onLoad()">
<table border=0>
<tr><td>
<?php $map->printMap(); ?>
</td>
<td>
<?php $map->printSidebar(); ?>
<div id="route"></div>
</td>
</tr>
</table>
</body>
</html>
Trigger คือการแทรกการกระทำ (Method/Function) ลงไว้ใน Database โดยสามารถใส่เงื่อนไขต่างๆได้เหมือนกับภาษาโปรแกรมทั่วไปครับ โดยเมื่อเกิด Query ใน Mysql แล้วตัว Database จะทำการไล่ Check ว่ามี Trigger ไหนตรงตามเงื่อนไขบ้าง และเรียกใช้งาน
การใช้ Trigger เป็นเหมือนดาบสองคม มีทั้งข้อดีแล้วข้อเสียครับ จะแจกแจงคร่าวๆเท่าที่พอนึกออกไว้ให้ครับ
+ ดูดีมีชาติตระกูล เร็ว (เร็วกว่าที่ส่งข้อมูลไปๆมาๆระหว่าง Mysql กับ Php/Server-side script อื่นๆ)
+ ทำบางอย่างที่ทำด้วยโค้ด Server-side script มาตราฐานไม่ได้ หรือไม่สะดวกนัก โดยการ Hook เข้าไปในระบบของ DB เลย
- Debug ยาก ยิ่งมีภาษาเพิ่มเข้ามาอีก ยิ่งเพิ่มความปวดหัว
- ยึดติดกับ Platform เนื่องจาก Trigger ไม่มีมาตราฐานชัดเจน ทำให้เมื่อย้ายไปใช้ตัวอื่นจะต้องศึกษาใหม่
จริงๆ ในหลายๆกรณีก็ไม่จำเป็นต้องใช้ Trigger เช่นการ Update Table ที่เป็น Foreign key โดยสามารถใช้คำสั่ง Cascade ช่วยได้
http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html
หน้าตาตัวอย่าง TriggerCREATE TRIGGER trigger_name BEFORE UPDATE ON table_name FOR EACH ROW BEGIN IF NEW.dirty=0 OR NEW.dirty=1 THEN SET NEW.dirty=1; ELSE SET NEW.dirty=0; END IF; END;
ถ้าได้ลองเอาโค้ดตัวอย่างไปลอง Run ใน phpMyAdmin จะพบว่าไม่สามารถทำงานได้ ด้วย Error ที่อ่านไม่ค่อยจะเข้าใจนัก
เหตุผลphpMyAdmin ไม่สามารถ Run คำสั่งนี้ได้ เนื่องจากเกิดการสับสนเรื่อง Delimiter ของ Mysql กับ คำสั่งใน Trigger
วิธีการแก้ไข แก้ได้ด้วยการ เปลี่ยน Delimiter เป็นตัวอักษรอื่นแทน semicolon “;” ตามรูป

ในตัวอย่างเปลี่ยนเป็น ;; แทนครับ โดยถ้าหากเราต้องการสั่งให้ phpMyAdmin ทำงานหลายๆ Query พร้อมกันก็ให้ใส่ ;; แทน ;
credit:http://blog.levelup.in.th/2009/06/29/mysql-trigger-basicmysql-trigger-basic/
Statistics