cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco DNS name server/virtual hosts problem

raul_bhatia
Champ in-the-making
Champ in-the-making
Hello Alfresco/Linux Gods,

I recently installed the latest version of alfresco on my Ubuntu 8.04 machine. I have a DNS server BIND9 set up on this computer and I already have virtual hosts for other applications running on an intranet domain that I created. I am using Apache 2.2 as the front end web server. I now wanted to setup alfresco to run in the same way like the other applications. This means I do not want to enter the ip address and port number to go to my alfresco page. I just want to enter a simple alfresco.mydomain.net to go to the alfresco website. I have created "A" record called alfresco in BIND9 and I know this requires some kind of tomcat-apache integration. But I dont know what to use to integrate Apache 2.2 with Tomcat. I installed the Alfresco-Tomcat bundle so my alfresco version came with the tomcat.

I tried using mod_jk but that doesnt seem to work. When I type the web address, all I get is a directory listing of my alfresco directory. The jsp pages dont show up. Can someone please help me?

Thanks!
-R
1 REPLY 1

kbarber
Champ in-the-making
Champ in-the-making
Hi there,

Here is what I've done on Centos to integrate Apache and Tomcat. I use this for most of my production environments as I prefer Apache in front of Tomcat. These instructions should apply to Ubuntu, however paths may vary slightly.

First of all, if your using the Tomcat bundled with Alfresco - you'll need to enable the AJP/13 listener. AJP is the protocol that mod_jk (now mod_proxy_ajp in 2.2) uses to talk to Tomcat. Its more or less HTTP with binary headers :-).

So … lets assume you've installed Alfresco into /opt/alfresco. Modify the file /opt/alfresco/tomcat/conf/server.xml and include the following block:


  <Service name="Catalina">

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

  </Service>

Then restart Alfresco. AJP should now be working on port 8009. You can test this quite easily:


# telnet 0 8009
Trying 0.0.0.0…
Connected to 0 (0.0.0.0).
Escape character is '^]'.
^]

If you get the Connected message - your in business.

Now you need to configure Apache by adding a new virtualhost to the end of your configuration file httpd.conf. My Apache configuration is located in /etc/httpd/conf/httpd.conf.


<VirtualHost *:80>
        ServerName alfresco.mydomain.net

        RewriteEngine on
        RewriteRule ^/alfresco(.*) ajp://127.0.0.1:8009/alfresco$1 [P,L]
</VirtualHost>

The magic here is the RewriteRule combined with the [P] option at the end. This uses mod_proxy_ajp to connect to the AJP provider on localhost (ie. Alfresco's tomcat).

Now you should be able to restart Apache - and connect to your web server using the name you have specified in ServerName above. I very highly recommend running your Apache in threaded mode, that way your AJP connections get pooled. In pre-fork mode … Apache creates an AJP connection per process which is not quite as efficient - especially under high load. I'm not 100% on the "correct" way to do this for Ubuntu.

If you have problems - check your error_log output from Apache (for me its in /var/log/httpd/error_log).

You may find the mod_proxy_ajp modules needs to be loaded. If you get an error, you can include this configuration in your httpd.conf (probably best to put this outside your VirtualHost configuration):


LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

> I tried using mod_jk but that doesnt seem to work. When I type the web address, all I get is a directory listing of my alfresco directory. The jsp pages dont show up.

Most odd … perhaps try the configuration above and let us know how you get on.

ken.