Ubuntu 9.10 – Apache2 + Tomcat6 Written on December 23, 2009, by Stephen.
1) sudo apt-get install apache2 tomcat6 libapache2-mod-jk
2) sudo vim /etc/apache2/workers.properties
and type/past in:
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
3) sudo vim /etc/apache2/apache2.conf
and type/past in:
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
# Declare the module for (remove this line on Apache 2.x)
#AddModule mod_jk.c
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”
6) sudo vim /etc/apache2/sites-enabled/000-default
Delete “DocumentRoot /var/www”
And type in
JkMount / worker1
JkMount /* worker1
note, you can use JkUnMount to define directories you want apache to serve
7) Enable port 8009 on tomcat
sudo vim /etc/tomcat6/server.xml
remove the “” that is a line below
restart tomcat
sudo /etc/init.d/tomcat6 restart
9) restart apache
sudo /etc/init.d/apache2 restart
10) wget localhost
You should see the default tomcat page
Courtesy of: http://rcpeters.blogspot.com/2009/05/installing-apache2-and-tomcat6-on.html
Read more from the Code category. If you would like to leave a comment, click here: 1 Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
ActiveMQ Clustered and Bulletproof Written on November 3, 2009, by Stephen.
It’s easy to create a clustered instance of ActiveMQ and have your clients connect via multicast. This gives you the ability to create ActiveMQ instances all over the place, have them autodiscover each other and failover seamlessly and automatically. Here’s the ActiveMQ configuration.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="MyBroker" dataDirectory="${activemq.base}/data">
<destinations>
<queue physicalName="MyQueue" />
</destinations>
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:0" discoveryUri="multicast://default"/>
</transportConnectors>
<networkConnectors>
<networkConnector uri="multicast://default"/>
</networkConnectors>
<persistenceAdapter>
<memoryPersistenceAdapter/>
</persistenceAdapter>
</broker>
<jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
<connectors>
<nioConnector port="8161"/>
</connectors>
<handlers>
<webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
</handlers>
</jetty>
</beans>
And here is the Spring code for the client.
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL"> <value>discovery:(multicast://default)</value> </property> </bean> <bean id="destination" class="org.apache.activemq.command.ActiveMQQueue"> <constructor-arg index="0"> <value>MyQueue</value> </constructor-arg> </bean> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> <property name="connectionFactory"> <bean class="org.springframework.jms.connection.SingleConnectionFactory"> <property name="targetConnectionFactory" ref="jmsConnectionFactory" /> </bean> </property> </bean>
If you will notice, the ActiveMQ client uses the discovery mechanisms for finding the queue, which allows it to connect to any piece of hardware without actually having to know physical locations. You can replace your multicast://default (which happens to be multicast://239.255.2.3:6155) with whatever multicast address you would like. You could even DNS-it-up and have a url look like multicast://MyBroker.mydomain.com:6166.
Enjoy.
http://activemq.apache.org/multicast-transport-reference.html
Read more from the Code category. If you would like to leave a comment, click here: 2 Comments. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
Maven and the Enterprise Written on April 8, 2009, by Stephen.
Sounds like a band from the 70’s, huh? Here’s a quick picture for part of a presentation I am putting together for my colleagues.
Here’s a basic drawing describing a minimum development environment for any company. The “servers” can be consolidated to a certain point, especially if you are using virtualization software.
Also, the source control, continuous integration and maven repository manager can realistically all run on a single server. You MIGHT be able to get away with running the actual builds on the box but might run into some performance issues, particularly if you are running a big build and simultaneously checking in a bunch of source code.
Read more from the Code category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
Requirements Documents are the suck. Written on March 26, 2009, by Stephen.
http://www.scottberkun.com/blog/2009/why-requirements-stink/
Read more from the Code category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
10 Papers Every Software Architect Should Read (At Least Twice) Written on March 10, 2009, by Stephen.
Read more from the Code category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
Pics from Corporate Cup Written on March 10, 2009, by Stephen.
Running with the coworkers.
Read more from the Code category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
Big Ball of Mud Written on March 10, 2009, by Stephen.
My personal favorite is “Keep It Working”.
Must read for people who “prototype”.
Read more from the Code category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
Small Batches Written on February 21, 2009, by Stephen.
Great article on small batches and continuous integration.
http://startuplessonslearned.blogspot.com/2009/02/work-in-small-batches.html
Read more from the Code category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
Beautiful Font for Programmers Written on February 16, 2009, by Stephen.
http://www.ms-studio.com/FontSales/anonymous.html
Read more from the Code category. If you would like to leave a comment, click here: Comment. or stay up to date with this post via RSS, or you can
Trackback from your site.
Social Bookmark :
Technorati,
Digg,
de.licio.us,
Yahoo,
Blinkbits,
Blogmarks,
Google,
Magnolia.
FERC – Electric Power Markets Overview Written on February 13, 2009, by Stephen.
http://www.ferc.gov/market-oversight/mkt-electric/overview.asp
Good sight for overall statistics and information on each of the power markets in the US.














