Monday, 28 June 2010

Apache url filtering corrupts compressed output.

While trying to set up Hudson behind apache again, I kept on getting garbage out.
After some googling I realized Hudson compress its output, therefore you can not use the normal proxy-html filter to modify urls coming from hudson:
SetOutputFilter proxy-html
Instead you can use the following:
SetOutputFilter INFLATE;proxy-html;DEFLATE
ProxyHTMLURLMap http://your_server:8080/hudson /hudson
http://wiki.uniformserver.com/index.php/Reverse_Proxy_Server_2:_mod_proxy_html_2
But since hudson seems to be well behaved it even better to just not use SetOutputFilter and ProxyHTMLURLMap.

http://wiki.hudson-ci.org/display/HUDSON/Running+Hudson+behind+Apache

Thursday, 24 June 2010

Internet Explorer 7 with Wine

After searching a lot and trying some recipes, the following worked beautifully for me to install Internet Explorer 7 on ubuntu 10.04 (lucid)
http://rkpisanu.altervista.org/doku.php?
id=wineie7eng#internet_explorer_7_with_wine

(I changed the last step to get it to work for me, because its installed in your home dir, not in your current dir)

Download dependencies:
sudo apt-get install wine cabextract

Download and run IE4WINE:
Warning: All wine program running must be closed before install and run IE4WINE
wget http://rkpisanu.altervista.org/download/ie4wine
chmod +x ./ie4wine
./ie4wine

Finally:
type ~/wineie7 (Stable Version )
type ~/wineie7https (Unstable Version with https support)

Archiva On GlassFish with Derby

I added the following to the archiva wiki, but keeping a copy here for reference and backup.
https://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+On+GlassFish+with+Derby
(based on https://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+on+GlassFish+with+mySQL)



Glassfish web configuration


Deploy the war file on your Glassfish server from the admin page (http://localhost:4848).
Or copy the the war file into your <GLASSFISH_FOLDER>/domains/domain1/autodeploy/archiva.war
Glassfish file configuration
Edit the file <GLASSFISH_FOLDER>/domains/domain1/config/domain.xml to add the following tags:

Go to Ressources -> JavaMail Sessions and create a new ressource with jndi-name='mail/Session', otherwise you will get "Error creating bean with name 'mailSession'" on startup. Or add it to the config file:

...
<resources>
<mail-resource from="me@email.example.com" host="email.example.com" jndi-name="mail/Session" object-type="user"
store-protocol="imap" store-protocol-class="com.sun.mail.imap.IMAPStore"
transport-protocol="smtp" transport-protocol-class="com.sun.mail.smtp.SMTPTransport"
user="me"/>
...

Set appserver.base and appserver.home properties


Ensure that the property appserver.base is set. Archiva uses this to locate log files.

...
<java-config ...
<jvm-options>-Dappserver.base=${com.sun.aas.installRoot}/domains/domain1
<jvm-options>-Dappserver.home=${com.sun.aas.installRoot}/domains/domain1
...


JDBC resources


...
</applications>
<resources>
<jdbc-resource pool-name="archivaUsersPool" jndi-name="jdbc/users" />
<jdbc-resource pool-name="archivaPool" jndi-name="jdbc/archiva" />
..

Connection pool


<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" res-type="javax.sql.XADataSource" name="archivaUsersPool">
<property name="databaseName" value="/archiva/data/databases/users" />
<property name="connectionAttributes" value=";create=true" />
</jdbc-connection-pool>
<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" res-type="javax.sql.XADataSource" name="archivaPool">
<property name="databaseName" value="/archiva/data/databases/arvhiva" />
<property name="connectionAttributes" value=";create=true" />
</jdbc-connection-pool>

Resources ref


<servers>
<server config-ref="server-config" name="server">
...
<resource-ref enabled="true" ref="jdbc/users"/>
<resource-ref enabled="true" ref="jdbc/archiva"/>
...


Now restart you Glassfish server, and open the archiva location. The last thing you have to do is create the admin user.