|
home /
infca /
apache
(navigation links)
|
Watch what you ask for, 'cause you might receive
|
Apache
go 2 top
Apache projects
Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns provider.
Tested inside popular J2EE servers such as Geronimo, JBoss 4, GlassFish and WebLogic.
Apache CXF is an open source services framework.
CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS.
Apache Camel is a powerful open source integration framework based on known Enterprise Integration Patterns with powerful Bean Integration.
Camel also provides a powerful set of testing tools for validating your integration logic,
so you can fully testing your integration logic, as you did unit test your business logic.
Apache ServiceMix is a flexible, open-source integration container
that unifies the features and functionality of Apache ActiveMQ, Camel, CXF, ODE, Karaf
into a powerful runtime platform you can use to build your own integrations solutions.
It provides a complete, enterprise ready ESB exclusively powered by OSGi.
Apache
Spark
is an open-source cluster computing framework
with in-memory processing to speed analytic applications up to 100 times faster compared to technologies on the market today.
Developed in the AMPLab at UC Berkeley, Spark can help reduce data interaction complexity,
increase processing speed and enhance mission-critical applications with deep intelligence.
Apache OpenOffice
homepage,
wikipedia ;
wiki, documentation as
Creating Automatic Tables of Contents
Index or TOC
- create an index : url
- update a table of contents : url
To update an index, place the cursor anywhere in the index, right-click, and choose Update Index/Table from the pop-up menu.
- delete an index : right-click on it and select "delete index/table" :
url
- how to make the table of contents hotlinked -
see "Lessons for creating tables of contents"
Let's say that you want to make every entry in the TOC hotlinked,
so that clicking on it takes you to the corresponding heading in the document.
And you're going to put the hotlink just around the heading part, not the page number.
- select part of the TOC, right-click, and choose Edit Index/Table.
- to remove the large left-hand preview side of the window, unmark the "Preview" checkbox in the bottom right corner
- click the "Entries" tab
- begin by clicking to the left of the E entry, which corresponds to the heading text
- click the Hyperlink button - an LS entry will be added where the cursor was, indicating the beginning of the link
- click immediately after the same E entry
- click Hyperlink again - an LE entry will be added where the cursor was, indicating the end of the link
- if you left things as is, the hyperlink would apply only to top-level heading entries.
However, you want all entries to be hyperlinked, so click the "All" button
url
Images
Drag and Drop onto wide Form
Requirements
OpenOffice requires Java runtime environment (JRE) to perform this task.
Please install a JRE and restart OpenOffice.
Apache Web Server
- Homepage,
download
win=.msi
-
Apache documentation
v 2.2
and
directives.
-
Get it
here.
- /usr/share/doc/packages/apache2 - small.
- /usr/share/apache2/manual - index.html into Opera.
See urlmapping.html : usuarios sin ~ (tilde) [Jordi]
-
The Best !
-
Core features
- configuration file : /etc/apache2/httpd.conf + apache2.conf
Puntos interesantes :
- UserDir
si llega un usuario [ as ~sebas ], que directorio se añade
Ej.- http://192.168.0.1/~sebas se mapea en
/home/sebas/public_html
- DirectoryIndex
Si existe el fichero index.html, se muestra.
Si no, se lista el directorio.
Ej.- http://192.168.0.1/~sebas muestra
/home/sebas/public_html/index.html
- DocumentRoot
Docs dir :
http://192.168.0.1/pepet
gets mapped into
/srv/www/htdocs/pepet
- Alias /manual/
http://192.168.0.1/manual
gets mapped into
/usr/share/apache2/manual
- LogLevel - puede ser debug, info, notice, warn, error, crit,
alert, emerg.
- log : /var/log/apache2, ErrorLog value in httpd.conf
- activación
- command line : apache2ctl -k start
ps -A muestra 6 threads httpd2[-prefork]
Placed in /etc/init.d/boot.local, we got "+++SAGSAG+++", but ...
- boot time : ln -s ../apache2 S90apache in /etc/init.d/rc5.d
Calls /etc/init.d/apache2 script, that uses /etc/sysconfig/apache2 file.
- Apache has 2 kind of modules :
Install
Apache is controlled by a series of configuration files:
httpd.conf, access.conf. and srm.conf.
There's actually also a mime.types file,
but you have to deal with that only when you're adding or removing MIME types from your server,
which shouldn't be too often.
For complete installation documentation, see [ht]docs/manual/install.html or
http://httpd.apache.org/docs/2.2/install.html.
$ ./configure --prefix=PREFIX // If PREFIX is not specified, it defaults to /usr/local/apache2
$ make
$ sudo make install
$ /usr/local/apache2/bin/apachectl start
NOTES:
Replace PREFIX with the filesystem path under which Apache should be installed.
A typical installation might use
{linux} /usr/local/apache2
{win} c:\Program Files\Apache Software Foundation\Apache2.2\
Configuration file (default path):
{linux} /usr/local/apache2/conf/httpd.conf
{rh} /etc/httpd/conf/httpd.conf
{rh} /etc/security/access.conf
{win} c:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
A typical problem is :
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
To fix it, we edit httpd.conf to include this line :
ServerName 1.2.3.4
And restart the service :
{linux} sudo /etc/init.d/apache2 restart
{rh} apachectl -restart
{win}
If a configuration change seems no to work, try
sudo service apache2 reload
We also defined the document root in httpd.conf
{linux} DocumentRoot "/usr/local/apache2/htdocs"
{rh} DocumentRoot /var/www/html/
{win} DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" - compte : barres "/" !?
So now, if we browse
http://localhost/
We receive from file
{linux} /usr/local/apache2/htdocs/index.html
or
{win} C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\index.html
==> It Works !
Apache error log is located at
{linux} $PREF/logs/error.log
{rh} /etc/httpd/logs/
{win} %PREF%\logs\error.log, as c:\Apache\logs\ ...
We changed the documents directory to c:\ and now get this error :
C:\Program Files\Apache Software Foundation\Apache2.2\logs> type error.log
Starting the Apache2.2 service
The Apache2.2 service is running.
[Thu Jan 05 15:18:27 2012] [error] [client 9.137.164.152] (OS 5) Access is denied
file permissions deny server access: C:/bisc/pages/BISC/test.htm
Apache @ RH v4
Install
[root@labss2 untar]# tar -xvf ../httpd-2.2.23.tar.gz
# cd httpd-2.2.23
# ./configure // 3 min, 8 or 10 pages output ...
# make // 4 min
# make install // 1 min
Configure
# vi /etc/httpd/conf/httpd.conf
ServerAdmin bisc2k9@gmail.com
ServerName 9.137.164.158:80
DocumentRoot "/var/www/html"
# vi /var/www/html/index.html
# apachectl start
http://9.137.164.158
Apache @ RH v6.1
A /etc/httpd/conf/httpd.conf tenim :
ServerRoot "/etc/httpd" // The top of the directory tree under which
// the server's configuration, error, and log files are kept
ServerName 9.137.164.153:80
DocumentRoot "/var/www/html" // The directory out of which you will serve your documents.
DirectoryIndex index.html // The file that Apache will serve if a directory is requested.
L'engeguem :
[root@rhv6-64b init.d]# apachectl start
[root@rhv6-64b init.d]#
I veiem
[root@rhv6-64b sbin]# ps -ef | grep apach
apache 17099 17097 0 18:07 ? 00:00:00 /usr/sbin/httpd -k start
apache 17100 17097 0 18:07 ? 00:00:00 /usr/sbin/httpd -k start
Per a que engegui sol amb el Linux, posem a /etc/rc.local :
[sebas@rhv6-64b etc]$ cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
# start Apache 4 Pere
apachectl start
Podem veure pàgines amb un navegador :
http://9.137.164.153/
<html>
<body>
Hola, Pere.
Aixo ja funciona.
Estas veient el contingut de /var/www/html/index.html
Soc en Sebas, i avui es 20121008/16:30.
</body>
</html>
Logs d'accés i d'errors :
cat /etc/httpd/logs/error_log
[Mon Oct 08 18:18:11 2012] [error] [client 9.137.165.244] File does not exist: /var/www/html/favicon.ico
cat /etc/httpd/logs/access_log
9.137.165.244 - - [08/Oct/2012:18:18:11 +0200] "GET /favicon.ico HTTP/1.1" 404 289 "-"
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1"
PHP @ RH v6.1
See PHP
docu !
El PHP no es troba pre-compilat dins el Apache:
[root@rhv6-64b etc]# /usr/sbin/httpd -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
[root@rhv6-64b etc]#
Els RPM que tenim son:
[root@rhv6-64b Packages]# ls | grep php
php-5.3.3-3.el6.x86_64.rpm
php-cli-5.3.3-3.el6.x86_64.rpm
php-common-5.3.3-3.el6.x86_64.rpm
php-gd-5.3.3-3.el6.x86_64.rpm
php-ldap-5.3.3-3.el6.x86_64.rpm
php-mysql-5.3.3-3.el6.x86_64.rpm
php-odbc-5.3.3-3.el6.x86_64.rpm
php-pdo-5.3.3-3.el6.x86_64.rpm
php-pear-1.9.0-2.el6.noarch.rpm
php-pecl-apc-3.1.3p1-1.2.el6.1.x86_64.rpm
php-pecl-memcache-3.0.5-3.el6.x86_64.rpm
php-pgsql-5.3.3-3.el6.x86_64.rpm
php-soap-5.3.3-3.el6.x86_64.rpm
php-xml-5.3.3-3.el6.x86_64.rpm
php-xmlrpc-5.3.3-3.el6.x86_64.rpm
Instalem:
[root@rhv6-64b php]# rpm -Uvh php-5.3.3-3.el6.x86_64.rpm
warning: php-5.3.3-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
error: Failed dependencies:
php-cli = 5.3.3-3.el6 is needed by php-5.3.3-3.el6.x86_64
php-common = 5.3.3-3.el6 is needed by php-5.3.3-3.el6.x86_64
[root@rhv6-64b php]# rpm -Uvh php-common-5.3.3-3.el6.x86_64.rpm
php-cli-5.3.3-3.el6.x86_64.rpm
php-5.3.3-3.el6.x86_64.rpm
warning: php-common-5.3.3-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:php-common ########################################### [ 33%]
2:php-cli ########################################### [ 67%]
3:php ########################################### [100%]
[root@rhv6-64b php]#
Configuration file is
/etc/php.ini
sections.
Primer, hem de posar una sentencia LoadModule pel PHP a la configuracio de Apache:
LoadModule php5_module modules/libphp5.so
Ara, hem de reiniciar el Apache :
[root@rhv6-64b conf]# apachectl -k restart
[Mon Oct 08 19:58:46 2012] [warn] module php5_module is already loaded, skipping
Així, treiem la linia amb "LoadModule".
Tenim un sample a /var/www/html/test.php,
que hem tret d'aqui
i d'aqui.
<hr>
<?php
echo "Hi, I'm a PHP Script !"
?>
<hr>
<?="Hello World"?>
<hr>
<? print("Hello World using PRINT") ?>
<hr>
mm/dd/yyyy : print date("m/j/Y"); ?>
<p>
mm/dd/yyyy : print date("H:i:s"); ?>
<hr>
<?php phpinfo() ?>
<hr>
Podem veure la sortida del PHP, junt amb un super-dump de la configuració del PHP amb:
Super comanda visualització configuració PHP : <?php phpinfo() ?>
MQ des PHP @ RH v6.1
Ens cal la comanda
phpize :
rpmfind.
Desinstalem la versio 5.3.3 :
rpm -e php-5.3.3-3.el6.x86_64 php-common-5.3.3-3.el6.x86_64 php-cli-5.3.3-3.el6.x86_64
I posem la 5.3.16, que hem baixat de
aqui:
[root@rhv6-64b 5.3.16]# rpm -Uvh php-common-5.3.16-1.el6.x86_64.rpm
php-cli-5.3.16-1.el6.x86_64.rpm
php-5.3.16-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
WARNING : These php-* RPM are not official Fedora/Redhat build and
overrides the official ones. Don't file bugs on Fedora Project nor Redhat.
Use dedicated forums http://forums.famillecollet.com/
1:php-common ########################################### [ 33%]
2:php-cli ########################################### [ 67%]
3:php ########################################### [100%]
[root@rhv6-64b 5.3.16]#
La comanda phpize ens demana el paket php-devel:
[root@rhv6-64b 5.3.16]# rpm -Uvh php-devel-5.3.16-1.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:php-devel ########################################### [100%]
Ara tenim:
[root@rhv6-64b 5.3.16]# phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
Si ho fem al lloc adient, tenim:
[root@rhv6-64b /home/sebas/software/php4mq/mqseries-0.13.0]# phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Han aparescut al directori els segents fitxers:
acinclude.m4, aclocal.m4, autom4te.cache, build, config.guess, config.h.in,
config.m4, config.sub, configure, configure.in, CREDITS, examples,
install-sh, ltmain.sh, Makefile.global, missing, mkinstalldirs, mqseries.c, mqseries.dsp,
mqseries_init_const.h, mqseries_reason_texts.h, php_mqseries.h, README, run-tests.php
La comanda "./configure" ens diu
configure: error: wrong mqseries lib version or lib not found (use --with-libdir=lib64 for 64-bit)
Aixi, posem eixe flag i tot acaba ok:
[root@rhv6-64b mqseries-0.13.0]# ./configure --with-libdir=lib64
config.status: executing libtool commands
Finalment:
[root@rhv6-64b mqseries-0.13.0]# make
. . .
----------------------------------------------------------------------
Libraries have been installed in:
/home/sebas/software/php4mq/mqseries-0.13.0/modules
If you ever happen to want to link against installed libraries in a given directory, LIBDIR,
you must either use libtool, and specify the full pathname of the library,
or use the `-LLIBDIR' flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Si ens ho aconsella, ho hem de fer:
[root@rhv6-64b mqseries-0.13.0]# make test
Build complete.
Don't forget to run 'make test'.
=====================================================================
PHP : /usr/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.3.16
ZEND_VERSION: 2.3.0
PHP_OS : Linux - Linux rhv6-64b 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64
INI actual : /home/sebas/software/php4mq/mqseries-0.13.0/tmp-php.ini
More .INIs :
CWD : /home/sebas/software/php4mq/mqseries-0.13.0
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2012-10-08 19:39:26
=====================================================================
No tests were run.
[root@rhv6-64b mqseries-0.13.0]#
El resultat es troba aqui:
[root@rhv6-64b /home/sebas/software/php4mq/mqseries-0.13.0/modules]# ls -l
total 204
-rw-r--r--. 1 root root 969 Oct 8 21:37 mqseries.la
-rwxr-xr-x. 1 root root 202068 Oct 8 21:37 mqseries.so
Modifiquem /etc/php.ini :
extension=/home/sebas/software/php4mq/mqseries-0.13.0/modules/mqseries.so
Tenim un error a /etc/httpd/logs/error_log:
PHP Warning: PHP Startup:
Unable to load dynamic library '/home/sebas/software/php4mq/mqseries-0.13.0/modules/mqseries.so'
- /home/sebas/software/php4mq/mqseries-0.13.0/modules/mqseries.so:
cannot open shared object file: Permission denied in Unknown on line 0
Solucio:
[root@rhv6-64b modules]# setenforce Permissive
[root@rhv6-64b modules]# apachectl -k restart
No ens ha calgut:
[root@rhv6-64b modules]# chcon system_u:object_r:textrel_shlib_t
/home/sebas/software/php4mq/mqseries-0.13.0/modules/mqseries.so
chcon: failed to change context of '/home/sebas/software/php4mq/mqseries-0.13.0/modules/mqseries.so'
to 'system_u:object_r:textrel_shlib_t':
Invalid argument
Verify everything's working and the extension shows up in your phpinfo() as active:
mqseries
mqseries support enabled
Version 0.13.0
Revision $Revision: 327393 $
Apache @ SLES v11
Based almost 100% on
www.server-world.info
Tenim un CD muntat :
network:/media/SUSE_SLES-11-0-0.001/suse/i586 # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 19G 4.2G 14G 24% /
udev 499M 176K 499M 1% /dev
/dev/sr0 2.7G 2.7G 0 100% /media/SUSE_SLES-11-0-0.001
Instalem:
rpm -Uvh apache2-2.2.10-2.18.i586.rpm apache2-utils-2.2.10-2.18.i586.rpm apache2-worker-2.2.10-2.18.i586.rpm
libapr1-1.3.3-11.15.i586.rpm libapr-util1-1.3.4-12.18.i586.rpm libmm14-1.4.2-16.22.i586.rpm
apache2-mod_perl-2.0.4-40.19.i586.rpm apache2-mod_php5-5.2.6-50.17.i586.rpm apache2-prefork-2.2.10-2.18.i586.rpm
perl-Tie-IxHash-1.21-721.22.i586.rpm php5-5.2.6-50.17.i586.rpm
php5-mbstring-5.2.6-50.17.i586.rpm php5-pear-5.2.6-50.17.i586.rpm php5-zlib-5.2.6-50.17.i586.rpm
Configurem
network:# vi /etc/apache2/sysconfig.d/global.conf
ServerSignature off
UseCanonicalName off
ServerTokens Prod
LogLevel warn
CustomLog /var/log/apache2/access_log combined
network:# vi /etc/apache2/default-server.conf
DocumentRoot "/srv/www/htdocs"
Options FollowSymLinks ExecCGI
AllowOverride All
ServerName network.bisc.es
ServerAdmin admin@network.bisc.es
network:# vi /etc/apache2/httpd.conf
DirectoryIndex index.html index.html.var index.cgi index.php
network:# vi /etc/apache2/mod_mime-defaults.conf
# file-type that apache looks them CGI
AddHandler cgi-script .cgi .pl
network:# vi /etc/apache2/mod_userdir.conf
UserDir public_html
AllowOverride All
Options FollowSymLinks ExecCGI
Engeguem
network:/etc/apache2 # /etc/init.d/apache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) done
network:/etc/apache2 #
To configure your SLES system to start Apache at boot time:
chkconfig --add apache2
Editem les pàgines a ... /srv/www/htdocs/index.html
apache @ ubuntu 10.04
Documentation,
LAMP.
# sudo apt-get install apache2
# vi /etc/apache2/apache2.conf
# vi /etc/apache2/sites-available/sagsite
# sudo /etc/init.d/apache2 restart
SysInternals JUNCTION
Per crear una
junction, fem:
c:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs> junction pelis "D:\sag\fLims"
To determine if a file is a junction, specify the file name: junction c:\test
To delete a junction, use the -d switch: junction -d pelis
Apache pending items
- /etc/apache2/conf.d/mod_php4.conf :
incluirlo en /etc/apache2/httpd.conf
Apache links
Nice tips :
Learn how to configure Apache.
ActiveMQ
Apache ActiveMQ is a highly configurable, extensible, and feature-rich message-oriented middleware (MOM) system.
Homepage,
download,
features,
good
FAQs,
forum [/]
Environment requirements:
- Java Developer Kit (JDK) 1.4.x or greater for deployment and 1.5.x (Java 5) for compiling/building.
- The JAVA_HOME environment variable must be set to the directory where the JDK is installed,
e.g., c:\Program Files\jsdk.1.4.2-09.
- Maven 1.0.2 or greater (required when installing source or developer's releases).
- JARs that will be used must be added to the classpath.
Install : (1) download
27.685.511 apache-activemq-5.5.0-bin.zip
(2) unzip into destination directory : no other installation is required !
Configure JAVA_HOME:
c:\eines>echo %JAVA_HOME%
c:\Program Files\Java\jre7
Start :
c:\apache-activemq-5.5.0\bin> activemq.bat
Warning: JAVA_HOME environment variable is not set.
Java Runtime: Sun Microsystems Inc. 1.6.0_29 C:\Program Files\Java\jre6
Heap sizes: current=15872k free=14585k max=506816k
JVM args: -Dcom.sun.management.jmxremote -Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true
-Djava.util.logging.config.file=logging.properties
-Dactivemq.classpath=c:\apache-activemq-5.5.1\bin\../conf;c:\apache-activemq-5.5.1\bin\../conf;
-Dactivemq.home=c:\apache-activemq-5.5.1\bin\.. -Dactivemq.base=c:\apache-activemq-5.5.1\bin\..
ACTIVEMQ_HOME: c:\apache-activemq-5.5.1\bin\..
ACTIVEMQ_BASE: c:\apache-activemq-5.5.1\bin\..
Loading message broker from: xbean:activemq.xml
INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@1f4689e:
startup date [Wed Feb 01 16:14:55 CET 2012]; root of context hierarchy
WARN | destroyApplicationContextOnStop parameter is deprecated, please use shutdown hooks instead
INFO | PListStore:c:\apache-activemq-5.5.1\bin\..\data\localhost\tmp_storage started
INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[c:\apache-activemq-5.5.1\bin\..\data\kahadb]
INFO | ActiveMQ 5.5.1 JMS Message Broker (localhost) is starting
INFO | For help or more information please see: http://activemq.apache.org/
INFO | Listening for connections at: tcp://bcnlab005:61616
INFO | Connector openwire Started
INFO | ActiveMQ JMS Message Broker (localhost, ID:bcnlab005-1085-1328109297609-0:1) started
INFO | jetty-7.1.6.v20100715
INFO | ActiveMQ WebConsole initialized.
INFO | Initializing Spring FrameworkServlet 'dispatcher'
INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
INFO | Started SelectChannelConnector@0.0.0.0:8161
+ + + "Control-C" at DOS prompt ...
INFO | ActiveMQ Message Broker (localhost, ID:bcnlab005-1078-1328179573171-0:1) is shutting down
INFO | ActiveMQ Message Broker (localhost, ID:bcnlab005-1078-1328179573171-0:1) is shutting down
INFO | Connector openwire Stopped
INFO | PListStore:c:\apache-activemq-5.5.1\bin\..\data\localhost\tmp_storage stopped
INFO | Stopping async queue tasks
INFO | Stopping async topic tasks
INFO | Stopped KahaDB
INFO | KahaDB: Recovering checkpoint thread after death
INFO | Connector openwire Stopped
INFO | ActiveMQ JMS Message Broker (localhost, ID:bcnlab005-1078-1328179573171-0:1) stopped
INFO | ActiveMQ JMS Message Broker (localhost, ID:bcnlab005-1078-1328179573171-0:1) stopped
Terminate batch job (Y/N)?
Testing the installation :
Running the samples (as video shows) :
- /examples/ > ant consumer
- /examples/ > ant producer
Note the -Durl=tcp://localhost:61616 optional argument to the example ant scripts.
Use the -Durl option but replace "localhost" with the remote node name.
{Thanks,
Gary !}
Configuring : conf/activemq.xml
ActiveMQ ports
- 61616 - broker protocol
- SSL
- 8161, Web Console, http server : details
- 1099 - JMX remote port {cfg in ACTIVEMQ.BAT file}
To change them, modify conf/servicemix.properties and also conf/activemq.xml.
ActiveMQ Monitoring
Start
here :
you can monitor ActiveMQ using the Web Console : http://localhost:8161/admin
Or you can use the JMX support to view the running state of ActiveMQ :
jmx.html :
You can enable/disable JMX support as follows...
(2) Run a JMX console, e.g. jconsole - JMX console included in the JDK /bin/jconsole.exe
See "run.jar start" at port 3264 ...
To connect to a remote ActiveMQ instance, or if the local process does not show up, use Remote Process option, and enter an URL.
Here is an example localhost URL:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
setup JMX
In "activemq.bat" file, uncoment line
set SUNJMX=-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Now you can see
c:\apache-activemq-5.5.1\bin> netstat -an | find "1099"
TCP 0.0.0.0:1099 0.0.0.0:0 LISTENING
Otherwise you get
c:\apache-activemq-5.5.1\bin> activemq-admin.bat list
Java Runtime: Oracle Corporation 1.7.0_01 c:\Program Files\Java\jre7
Heap sizes: current=15872k free=15494k max=253440k
JVM args: -Dactivemq.classpath=c:\apache-activemq-5.5.1\bin\../conf;
-Dactivemq.home=c:\apache-activemq-5.5.1\bin\..
-Dactivemq.base=c:\apache-activemq-5.5.1\bin\..
ACTIVEMQ_HOME: c:\apache-activemq-5.5.1\bin\..
ACTIVEMQ_BASE: c:\apache-activemq-5.5.1\bin\..
Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
ERROR: java.lang.RuntimeException: Failed to execute list task.
Reason: java.io.IOException:
Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException
[Root exception is java.rmi.ConnectException: Connection refused to host: localhost;
ActiveMQ Command-Line commands
- activemq - runs an activemq broker
- activemq-admin - manages a broker instance
In versions prior to 5.0 the functionality of activemq-admin script was scattered over multiple scripts, such as:
- shutdown - shutdowns an activemq broker
- list - lists all running brokers in the specified JMX context
- query - queries the JMX context for broker statistics and information
- bstat - predefined query that displays useful broker statistics
- browse - browse the messages of a specific queue
- purge - delete selected destination's messages that matches the message selector
url
To display ActiveMQ version, use the command :
activemq --version
To display the running brokers list, use the command :
c:\apache-activemq-5.5.1\bin> activemq-admin.bat list
Java Runtime: Oracle Corporation 1.7.0_01 c:\Program Files\Java\jre7
Heap sizes: current=15872k free=15494k max=253440k
JVM args: -Dactivemq.classpath=c:\apache-activemq-5.5.1\bin\../conf;
-Dactivemq.home=c:\apache-activemq-5.5.1\bin\..
-Dactivemq.base=c:\apache-activemq-5.5.1\bin\..
ACTIVEMQ_HOME: c:\apache-activemq-5.5.1\bin\..
ACTIVEMQ_BASE: c:\apache-activemq-5.5.1\bin\..
Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
BrokerName = localhost
To display all the attributes and object name information of all registered queues, use :
c:\apache-activemq-5.5.1\bin> activemq-admin query -QQueue=*
DequeueCount = 0
Name = TEST.FOO
MinEnqueueTime = 0
CursorMemoryUsage = 0
MaxAuditDepth = 2048
Destination = TEST.FOO
AverageEnqueueTime = 0.0
InFlightCount = 0
MemoryLimit = 1048576
Type = Queue
EnqueueCount = 0
MaxEnqueueTime = 0
MemoryUsagePortion = 0.0
ProducerCount = 0
UseCache = true
BlockedProducerWarningInterval = 30000
MaxProducersToAudit = 64
PrioritizedMessages = false
CursorFull = false
BrokerName = localhost
ConsumerCount = 0
ProducerFlowControl = true
CacheEnabled = true
Subscriptions = []
QueueSize = 0
MaxPageSize = 200
CursorPercentUsage = 0
DispatchCount = 0
MemoryPercentUsage = 0
ExpiredCount = 0
DequeueCount = 0
Name = FOO.BAR2
To display all the attributes and object name information for all connections and connectors
for broker 'localhost' except its network connectors, use :
c:\apache-activemq-5.5.1\bin> activemq-admin query --objname Type=Connect,BrokerName=localhost -xQNetworkConnector=*
ActiveMQ tools
URL
MAVEN ?
- web console
url
- hermes jms
url
- maven 2 performance plugin
url
- jmeter
url
Notes / tuning Information
KahaDB:
Non-Standard Settings: indexCacheSize="100000" journalMaxFileLength="64mb" indexWriteBatchSize="100000"
ActiveMQ-JVM args:
-Xmx3G -Xms3G -Dorg.apache.activemq.UseDedicatedTaskRunner=false -XX:+AggressiveHeap -XX:+UseParallelGC
-XX:ParallelGCThreads=2 -XX:LargePageSizeInBytes=4m -XX:+UseParallelOldGC -verbose:gc -Dcom.sun.management.jmxremote
URL,
url,
Books
- "ActiveMQ in action.pdf" [here] + [\\T400\Apache\ActiveMQ\books]
- Apache ActiveMQ Reference Guide [pend] -
30 usd
ActiveMQ versus WebSphereMQ
There is no direct correlation between WMQ objects and ActiveMQ because the ActiveMQ architecture is different.
However, there are some loose correlations that can be made.
The WMQ queue manager is roughly equivalent to the ActiveMQ broker.
When an application is connected to an ActiveMQ broker, it is simply making use of JMS destinations,
i.e., there is no distinction between local and remote.
Also, ActiveMQ has no distinction between channels and queues -- again, it's all just JMS destinations.
JMS destination objects are destination objects that a client uses to specify
the target of messages that it produces and the source of messages that it consumes.
A JMS destination provides a specific end point for messages.
ActiveMQ 2 Websphere MQ
Follow the suggestions of many postings on how to get ActiveMQ to forward msg's to Websphere MQ using Camel.
Mind "concurrentConsumers" :
url.
url :
ActiveMQ can talk to IBM's MQ via the "jmsBridgeConnectors"
http://activemq.apache.org/jms-to-jms-bridge.html.
I've tested it in 5.5 successfully.
I defined a remote ConnectionFactory like so:
<bean id="remoteBlueFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="transportType" value="1"/>
<property name="hostName" value="ibmbrokerhost1"/>
<property name="port" value="1414"/>
<property name="queueManager" value="QMGRNAME"/>
<property name="channel" value="UNSECURE.BKR.CHANNEL"/>
</bean>
We saw an issue where ActiveMQ needed to be restarted
to send messages "stuck" while the WMQ was down,
but we haven't followed up on whether that was a bug or a configuration issue.
Note that
<property name="channel" value="UNSECURE.BKR.CHANNEL"/>
should point to a server connection channel in WMQ parlance (SVRCONN),
and not to a sender or receiver channel (those are for WMQ-to-WMQ queue manager connection).
SVRCONN is the channel type you get by default when you don't specify the channel property at all on the MQ connection factory.
url :
JMS bridge.
ActiveMQ links
Ant
Apache Ant is a Java library and command-line tool
who's mission is to drive processes described in build files as targets and extension points dependent upon each other.
If you use Unix scripts as well as Windows BATs,
the solution to have only one source is
to use Apache Ant,
which is a Java-based build tool
that uses XML-based configuration files as input.
wiki,
homepage.
Resum
| |
Apache |
PHP |
MySQL |
Nuke |
| Homepage |
Homepage |
Homepage |
Homepage |
Homepage |
| Docs |
Apache |
Docu
&
FAQs
|
MySQL |
|
| Cfg |
/etc/apache2/httpd.conf
/etc/httpd/conf/httpd.conf
| /etc/php.ini |
/etc/my.cnf |
/srv/www/htdocs/config.php |
| Log |
/var/log/apache2/error.log
[ httpd.conf ErrorLog ]
|
/var/log/php/error_log.txt
[ php.ini error_log ]
|
/var/lib/mysql/mysqld.log
[ my.cnf err-log ]
|
|
| Activació |
/etc/init.d/rc5.d/S90apache2 -> ../apache2 |
|
safe_mysqld & |
|
| Mostrar versió |
httpd -v |
|
|
|
Maven
Maven is a software tool for project management and build automation.
While primarily used for Java programming,
it can also be used to build and manage projects written in C#, Ruby, Scala, and other languages.
wiki.
Tomcat
Apache Tomcat is a HTTP server and Servlet container supporting Java Servlet and JavaServer Pages (JSP).
TomEE = Tomcat + Java EE.
Sample of a
MDB on TomEE.
Other Java EE application servers
- Apache Geronimo
- WildFly (formerly known as JBoss AS, or simply JBoss)
- WebSphere AS
- WebLogic Server
- GlassFish
Tomcat log rotate
Lets rotate "catalina.out", tomcat's log, in order not to overflow all filesystem :
$ vi /etc/logrotate.d/tomcat5
/var/log/tomcat5/catalina.out {
copytruncate
daily
rotate 5
compress
missingok
size 100M
}
Perl
P4
- crear /srv/www/cgi-bin/uno.pl
- chmod 755 uno.pl
- con Opera, abrir http://192.168.0.1/cgi-bin/uno.pl
uno.pl
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello.";
Tinet
- Perl directory : #!/usr/local/bin/perl ?
- where to place my uno.pl ?
- how is its URL ?
https://usuaris.tinet.cat/sag/cgi-bin/uno.pl ?
- how to chmod ?
- error log directory ?
SSI
P4
- <Directory "/srv/www/cgi-bin">
Option +ExecCGI +Includes
- AddType text/html .shtml
- AddOutputFilter INCLUDES .shtml
- http://T30/sample.shtml is mapped to /srv/www/htdocs/sample.shtml
- P4 : funciona con /home/sebas/public_html/sample.shtml
sample.shtml
<hr>
<!--#echo var="DATE_LOCAL" -->
<hr>
PHP4
- Homepage
- Docu
&
FAQs
- There are several ways to install PHP
- as an Apache module [most popular]
- as an fhttpd module
- for use with phttpd
- as a CGI executable [default]
did you compile php as a module or as a cgi ?
Only install either the static module or the dynamic one.
Do not install both.
How to know PHP is compiled or dynamic module ?
httpd -l will list all the modules that are compiled built-in,
so if php isn't there... it's a dynamic one.
Another clue is looking at the httpd.conf file.
If there is a LoadModule directive here you go.
You can "load" only dynamic modules.
En SuSE 8.2, existe un fichero /usr/bin/php, de 2.500.464 bytes.
php -h = Help, php -i saca un fichero HTML de descripcion,
php -m = show compiled modules.
- Cfg file : /etc/php.ini
- que hi ha instalat ?
rpm -qa | grep php
apache2-mod_php4-4.3.1-24
phpdoc-4.0.6-264
mod_php4-core-4.3.1.24
- 15Dec2003 - las páginas PHP no se procesan
- existe un /usr/bin/php que acepta un fichero (.php)
de entrada y genera uno de salida, transformado correctamente.
-
solucion :
- mkdir /srv/www/modules
- cp /usr/lib/apache2-prefork/libphp4.so /srv/www/modules
- /etc/apache2/httpd.conf :
LoadModule php4_module modules/libphp4.so
Do I need AddModule mod_php4.c ?
prova.php
<hr>
<?php
echo "Hi, I'm a PHP Script !"
?>
<hr>
<?="Hello World"?>
<hr>
<? print("Hello World using PRINT") ?>
<hr>
mm/dd/yyyy : <? print date("m/j/Y"); ?>
<p>
mm/dd/yyyy : <? print date("H:i:s"); ?>
<hr>
<?php phpinfo() ?>
<hr>
Sequència inicial (gràcies, Xavi !)
- - El Nuke carrega index.php
- - D'aquí recupera el config.php i les dades per accedir a la BD
- - Ara el mainfile.php
- - Despreś el Theme
- - Després recupera el mòdul per carregar al home i els blocs laterals
- - Finalment el peu de pàgina.
Funcions interessants :
Good
intro says :
What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server.
Tutorial,
download links, instructions.
Select install (1/4)
mode
Complete
scripts
Lots of
PHP,
even
Socket Programming
George Passwater (201507) :
If youre up for more resources on PHP and other development topics, you should check out the Toptal Engineering Blog:
blog -
it has a bit of everything, from technical overviews to in-depth tutorials.
For instance, heres a guide for Getting the Most of your PHP Logs:
url
wiki
Linex
té associat modules.php
a tots els botonets de "mostrar" / "amagar" !
Google+
developerWorks :
search and integrate Google+ activity streams with PHP applications ;
retrieve posts and find users on Google+ with the Google+ API and PHP
Interessant ...
MySQL
- Homepage
- doc :
- /usr/share/doc/packages/mysql/html*
- oficial doc
- see Apendix "A" for usual problems.
- configuration file : ?
- log : /var/lib/mysql/mysql.log
- activació : safe_mysqld { --user=mysql & }
starts DataBases in /var/lib/mysql
- message Table mysql.host doesn't exist
run mysql_install_db - set up grant tables
- message Can't find /mysql/host.frm (error 13)
See perror 13
run chown -R mysql /var/lib/mysql - MYSQL must own the tables.
remember mysqladmin -u root password <key>
- text-based client (for mysqld) : /etc/init.d/mysql
Uses
- /etc/my.cnf : global options
- /var/lib/mysql/my.cnf : server specific options
- ~/my.cnf : user specific options
- port 3306
- verify MySQL
runs ok :
- mysqlshow
- mysqlshow -u root mysql
- mysqladmin version status proc
- mysql test - "help", "status", "quit".
- kill server : mysqladmin -u root shutdown
MySQL basic operations
Entrar a MySQL i veure'n la versió:
root@host# mysql -u root -p
Enter password:*******
mysql>
Create a
database :
mysql> create database reserves;
We have no tables
yet :
mysql> SHOW TABLES;
Empty set (0.00 sec)
Create a
table :
mysql> use reserves;
Database changed
mysql> CREATE TABLE reserves_20121209(
-> reserva_id INT NOT NULL AUTO_INCREMENT,
-> hora_inicial VARCHAR(2) NOT NULL,
-> res_LU ENUM('lib','ocu'),
-> res_MA ENUM('lib','ocu'),
-> res_MI ENUM('lib','ocu'),
-> res_JU ENUM('lib','ocu'),
-> res_VI ENUM('lib','ocu'),
-> res_SA ENUM('lib','ocu'),
-> res_DO ENUM('lib','ocu'),
-> reserva_title VARCHAR(100),
-> reserva_author VARCHAR(40),
-> reserva_date DATE,
-> status ENUM('ac','in'),
-> PRIMARY KEY ( reserva_id )
-> );
Query OK, 0 rows affected (0.16 sec)
mysql>
Using
PHP
Trick:
I have found the status column to be particularly beneficial for all my tables.
It allows me to remove a record temporarily from the user's view without having to delete it.
Almost all of my SELECT statements contain WHERE clauses that filter out inactive records.
Therefore, I just change the value of a record's status column to in (for inactive) to eliminate it from my result sets.
Insert some
data :
INSERT INTO reserves_20121209(hora_inicial, res_LU, res_MA, res_MI, res_JU, res_VI, res_SA, res_DO)
VALUES(9, 'lib', 'lib', 'lib', 'lib', 'lib', 'lib', 'lib');
From a
file :
mysql> LOAD DATA LOCAL INFILE '/path/dades.txt' INTO TABLE reserves_20121209
-> FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n';
Mostrar
dades :
SELECT * from reserves_20121209 ORDER BY hora_inicial;
Actualitzar:
UPDATE reserves_20121209 SET res_LU = 'ocu' WHERE hora_inicial = '9' AND status = 'ac';
Tutorial
SQL Tutorial for Beginners Learn in 7 Days,
as
MySQL Create Database, Tables, Data Types
Mostrar taula en HTML
Pending ...
MySQL jerga/jargon
A primary key uniquely identify a row in a table.
Primary key is used as a unique identifier for the rows.
The primary key for a table represents the column or set of columns that you use in your most vital queries.
MySQL links
tutorial
Google Developers Academy - building an application with a local MySQL
instance
PHP-Nuke
- Homepage
- doc :
- /root/tmp/Interne/Nuke/INSTALL file
- Castellà
- configuration file :
- /sql/nuke.sql
- /html/config.php
- log : ?
- steps :
- Install directory : /root/tmp/Interne/Nuke
Install the package into the directory you want to use
on your web server
As Apache uses /srv/www/htdocs as document root directory,
lets
cp /root/tmp/Interne/Nuke/html/* /srv/www/htdocs/.
- tar -zxvf
- mysqladmin create nuke
Oposat de drop
- mysql nuke < nuke.sql
- Access http://yourdomain/index.php
- Configure http://yourdomain/admin.php
- problems :
- message_die() not found
In /html/includes/functions.php, about line 558
Solution :
ConnectTest.php
- Admin menu + any icon => enter U+K (again)
Sol : activate browser's cookies
- Admin menu + any icon => Admin menu
Error 304 in apache access log !
HTTP error
description
Solution :
Analyze.php
See
here
Jordi's
Opera config (SuSE 8.2 : v 6.03 build 219)
- Types Config :
as /etc/apache2/mime.types :
application/x-httpd-php php
- mirant p.php, ens mostra
Tipo MIME : application/x-httpd-php
VMWARE : Apache under SuSE 8.2 at T30
- rpm -qa | grep apache
apache2-prefork-2.0.44-32
apache2-mod_php4-4.3.1-24
apache2-2.0.44-32
- rpm -qa | grep php
mod_php4-core-4.3.1-24
apache2-mod_php4-4.3.1-24
-
apache2ctl -k start
httpd2: could not open document config file /etc/apache2/suse_loadmodule.conf
In /etc/apache2/httpd.conf it says :
It is created by [/usr/sbin/rcapache2, Slink]
the start script (/etc/init.d/apache2),
using APACHE-MODULES from /etc/sysconfig/apache2
Solved by using /etc/init.d/rc5.d/S90apache,
symbolic link to /etc/init.d/apache2
[ln -s Target LinkName]
-
See apache2ctl -l = list of compiled in modules
, as httpd2 -l.
- /etc/sysconfig/apache2 : list of enabled modules
Apache Guacamole
It allows a user to take control of a remote computer or virtual machine via a web browser.
wiki
Remote access is performed via the guacd component, which uses the RDP, VNC or SSH remote protocols to access resources.
Guacamole is clientless and doesn't require an agent to be installed on the resources being accessed.
The fact that the client runs on web browsers allows users to connect to their remote desktops without using an installed remote desktop client.
Dubtes Apache
- que es "Apache Axis", que surt a MQ SOAP ?
Homepage : a Web Service container that helps users to create, deploy, and run Web Services.
wiki : XML based Web service framework.
Links to Apache tutorials
Not mine, but from /usr/share/apache2/manual/tutorials.html
Installation & Getting Started
Basic Configuration
Security
Logging
CGI and SSI
Other Features