from your home directory - assuming your site is called xclu.com: mkdir xclu.com
unzip jetty-6.1.3.zip
declare -x JETTY_HOME=~/xclu.com/jetty-6.1.3/
cd $JETTY_HOME
Get the appropriate Postgresql driver from
http://jdbc.postgresql.org/download.html
to get your version
psql --version copy it to $JETTY_HOME/lib/ext/
cd webapps
mkdir blojsom
cd blojsom
jar -xvf ~/xclu.com/blojsom.war
edit $JETTY_HOME/webapps/blojsom/WEB-INF/classes/blojsom-helper-beans-include.xml
Replace the datasource with an appropriate postgresql configuration. You probably want to use a better password than 'blojsom'.:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.postgresql.Driver"/>
<property name="url" value="jdbc:postgresql://localhost/blojsom"/>
<property name="username" value="blojsom"/>
<property name="password" value="blojsom"/>
</bean>
Modify the dialect
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
Edit $JETTY_HOME/webapps/blojsom/WEB-INF/classes/blojsom.xml
Modify the dbloader
<bean id="dbloader" class="org.blojsom.util.database.DatabaseLoader" init-method="init">
<property name="sessionFactory">
<ref bean="hibernateSessionFactory"/>
</property>
<property name="dbScript" value="/WEB-INF/classes/blojsom-full-initial-data-postgresql.sql"/>
<property name="upgrading" value="false"/>
<property name="servletConfig">
<ref bean="servletConfigFactoryBean"/>
</property>
<property name="detectBlojsomSQL">
<value>select relname from pg_stat_user_tables where relname = 'blog';</value>
</property>
</bean>
Create the blojsom database (may need to be done as postgres user account if you haven't created a postgres superuser account for yourself)
createuser blojsom Answer no to whether the user should be allowed to create databases or other users
createdb -O blojsom blojsom
psql blojsom
blojsom=# alter user blojsom with password 'blojsom';
blojsom=# \q
To allow local acess to your database edit pg_hba.conf and add the following line right underneath the IPv4 comment.
# All IPv4 connections from localhost
host blojsom blojsom 127.0.0.1 255.255.255.255 md5
Restart postgresql
Test the configuration
psql -h 127.0.0.1 -U blojsom -W blojsom login with password "blojsom"
You should get the follow prompt
blojsom=> exit the psql client
blojsom=> \q Set the hostname and port in $JETTY_HOME/etc/jetty.xml properly
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="host">www.xclu.com</Set>
<Set name="Acceptors">1</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">1000</Set>
<Set name="lowResourcesMaxIdleTime">500</Set>
</New>
</Arg>
</Call>
Replace localhost:8080 with whatever your actual hostname is. In this case my hostname is 'www.xclu.com'
Change the jetty sql scripts so they initialize the database with the right hostname
perl -pi -e 's/localhost:8080/www.xclu.com/g' $JETTY_HOME/webapps/blojsom/WEB-INF/classes/*.sql
Run Jetty!
cd $JETTY_HOME
./bin/jetty.sh start
Now go to
- You may now access your blog at http://your-blojsom-install-site/blojsom/blog/default/
- You may access the administration console at http://your-blojsom-install-site/blojsom/blog/default/?flavor=admin
- The default user and password is default/default. Be sure to change the password immediately after logging in. You can change this under Weblog Settings | Users.