cancel
Showing results for 
Search instead for 
Did you mean: 

Solution: Using mod_jk with Alfresco

thestorm
Champ in-the-making
Champ in-the-making
Since I needed a "Webserver" way to access Alfresco i figured out a way to use mod_jk with Alfresco.

My system is a ubuntu 9.04-server (32bit).

First I installed mod_jk
apt-get install libapache2-mod-jk

then in the /etc/apache2 apache2.conf file I added the following at the end:

JkWorkersFile /etc/apache2/workers.properties

# Where to put jk logs
JkLogFile /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

# Send servlet for context /alfresco to your repository
JkMount /alfresco worker1

# Send JSPs for context /alfresco/* to your repository
JkMount /alfresco/* worker1

then i added a file called "workers.properties" to /etc/apache2/ with the following content:


workers.tomcat_home=/opt/Alfresco/tomcat
workers.java_home=/usr/lib/jvm/java-6-sun-1.6.0.13/
ps=/
worker.list=worker1

worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1

then I added the mountpoints to the virtual host file (/etc/apache2/sites-enabled/000-default)


        JkMountCopy On
        JkMount /alfresco worker1
        JKMount /alfresco/* worker1

finally I added a endpoint in the repository for the AJP13 connection.

edit file /opt/Alfresco/tomcat/conf/server.xml

after this part:


    <!– A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    –>

add the following line:



    <!– Define an AJP 1.3 Connector on port 8009 –>
    <Connector port="8009"
               enableLookups="false" redirectPort="8442" protocol="AJP/1.3" />

then restart Alfresco and when Alfresco is running restart apache2.

Works fine for me. Now my ppl can access Alfresco like http://intranet/alfresco
8 REPLIES 8

nexuit
Champ in-the-making
Champ in-the-making
This works fine for me too.  I just wanted to add exposure of share, which may be more appropriate to external clients, by adding the last two lines:

JkMountCopy On
JkMount /alfresco worker1
JkMount /alfresco/* worker1
JkMount /share worker1
JkMount /share/* worker1
in /etc/sites-available/default to which /etc/apache2/sites-enabled/000-default is soft-linked.

nexuit

nexuit
Champ in-the-making
Champ in-the-making
The code was for /etc/apache2/sites-available/default.  Please note apache2 in the path.

nexuit

jayjayecl
Confirmed Champ
Confirmed Champ
Great initiative posting here a way you found to have mod_jk work with Alfresco.
Thank you !

luisg
Champ in-the-making
Champ in-the-making
Hi, and thanks for this solution… Work great for Alfresco.
I tried to do the same for studio and share, adding to /etc/apache2apache2.conf:


JkMount /share worker1
JkMount /share/* worker1

JkMount /studio worker1
JkMount /studio/* worker1

and the following lines to /etc/apache2/sites-enabled/000-default :

JkMountCopy On
JkMount /alfresco worker1
JKMount /alfresco/* worker1

I can't login in share and I can't see the login window in Studio. This is the same thing if I only have changed the server.xml to port 80.

Any suggestions?

thestorm
Champ in-the-making
Champ in-the-making
ill try to get share work like that and then report you how I didt it but it should work the same way

// you didnt specifie the /share worker in your apache conf Smiley Happy

michaelc
Champ on-the-rise
Champ on-the-rise
I did the same in Red Hat and share works fine except.
the My Tasks fails with an outofbounds error.

http://forums.alfresco.com/en/viewtopic.php?f=48&t=36503

peterescher
Champ in-the-making
Champ in-the-making
hi, thx for the nice howto Smiley Happy

i've got some strange behavior with the login site (share). If i open the login site (http://alfresco/share/page/site-index) with firefox i can see the html code  :shock:

<html><head>
<meta http-equiv="Refresh" content="0; url=/share/page?pt=login">
</head><body><p>Please <a href="/share/page?pt=login">log in</a>.</p>
</body></html>

if i open the  http://alfresco/share/page/site-index.html (with suffix .html) there is a redirect to  http://alfresco/share/page/site-index and i can normally login….

any help?

michaelc
Champ on-the-rise
Champ on-the-rise
hi, thx for the nice howto Smiley Happy

i've got some strange behavior with the login site (share). If i open the login site (http://alfresco/share/page/site-index) with firefox i can see the html code  :shock:


any help?

check your conf  for Apache and see what your default index types are.