cancel
Showing results for 
Search instead for 
Did you mean: 

Installation of Alfresco on Windows as a service

fjodor
Champ in-the-making
Champ in-the-making
It took me quite a while to find out how to get Alfresco running as a service in Windows. The trick is to NOT start Alfresco after installation but from the start  configure it as a service.

This is complete installation procedure:

Installation procedure for Alfresco on Windows 2003 server.

Prerequisites:
- MySql server (v4.1)

Run setup, you can do a default or custom installation.

After setup is finished do not start Alfresco via 'Start Alfresco Server'
in the Start menu! Also do not use the batch file to start Alfresco!

Copy <Alfresco>\bin\imconvert.exe to C:\WINDOWS\system32

See <Alfresco>\README_mysql.txt and configure Alfresco for use with MySql as described:
Open a command prompt and CD to <Alfresco>\extras\databases\mysql\
Run db_setup.bat
Remove these 3 files from <Alfresco>\tomcat\shared\classes\alfresco\extension:
- custom-db-and-data-context.xml
- custom-db-connection.properties
- custom-hibernate-dialect.properties

Configure Alfresco to be run by Tomcat as a service:

Open a command prompt and CD to <Alfresco>\tomcat\bin
Type "set CATALINA_HOME=<Alfresco>\tomcat"
Run "service.bat install"

Set the service to start automatically.

Add the following to the SYSTEM PATH:
…..;<MySql>\bin;<Alfresco>\java\bin;<Alfresco>\tomcat\bin

Run <Alfresco>\tomcat\bin\tomcat5w.exe
Configure the options like those in <Alfresco>\alfresco.bat
On the Java tab:
Point the Java Virtual Machine to <Alfresco>\java\jre\bin\client\jvm.dll
and the Java classpath to <Alfresco>\tomcat\bin\bootstrap.jar
add the Java options:
-Dcatalina.base=<Alfresco>\tomcat
-Dcatalina.home=<Alfresco>\tomcat
set the memory options:
Initial memory pool: 128 Mb
Maximum memory pool: 512 Mb
Thread stack size: 64 Mb
(you can change these accoording to the amount of memory your system has)

Reboot!

Login to http://localhost:8080/ (user admin, password admin)

Goto the Administration Console, Manage System Users, 'Show all' and change the admin password.

If you have a firewall running, you might want to open port 8080 to give others access to Alfresco.
32 REPLIES 32

paulhh
Champ in-the-making
Champ in-the-making
Hi

Thanks for the steps.  There are a couple of 'gotchas': you should also copy over the win32NetBIOS.dll to somewhere in the path (for CIFS to work more easily) - or perhaps better for upgrade reasons, add <ALF-INSTALL>\bin into the Windows PATH.

Also, this approach will not start up OpenOffice as a service, so any transformations that rely on this will not work.  You can use utilities from the MS Resource Pack to create a service, but we are not permitted to redistribute this.  There is a stage in the Alfresco bootstrap that can call out at start up to run any command - if you can find a way to call OpenOffice so it stays running, then this could be another solution.

Cheers
Paul.

fjodor
Champ in-the-making
Champ in-the-making
You are right. It's better to add <ALF-INSTALL>\bin into the Windows PATH.
Then there is no need to copy the imconvert.exe file also.

richmitc
Champ in-the-making
Champ in-the-making
Thanks for the instructions!

I was able use them as a starter and get it to work while still using HSQLDB.

1.  I was able to do this even though I had previously started it manually.

2.  I also did not move imconvert.exe and added %ALF_HOME%\bin to the system PATH as earlier suggested.  In my case, I added C:\PROGRA~1\ALFRES~1\bin.

3.  I found you do not need to add %ALF_HOME%\tomcat\bin to the PATH as it appears Tomcat does that itself.

4.  I, of course, did not do any of the MySql instructions.

5.  Be careful when doing the set CATALINA_HOME before running service.bat.  I had to use the C:\PROGRA~1\ALFRES~1 form.

6.  In addition to the other settings for tomcat5w.exe, you need to set the working path for Startup or it won't find the database.  I set it to C:\PROGRA~1\ALFRES~1.  This is where alfresco.bat starts so that everything is relative to it.  If you don't do this, it will look for your database in C:\WINDOWS\SYSTEM32 and probably not find it there.  I set the Shutdown working path as well.

7.  The Java classpath and Java options were already set right for me the first time I ran tomcat5w.exe.  I did set the JVM and memory options as noted though.  Thread stack size is 64 Kb versus 64 Mb.

8.  Not sure you really need to reboot except to check that the service starts automatically.  I believe you can just Start it from Services.

Now if I can just get an OpenOffice service….

Thanks again for the boost.

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

As Paul mentioned earlier you could use the Windows Server 2003 Resource Kit Tools.

Use instsrv and srvany to add start_oo.bat as a service and have your Tomcat service depend on it.

I've found that to be a very easy way to get OpenOfficePortable run as a service.

Hope this helps,

–Aladdin

richmitc
Champ in-the-making
Champ in-the-making
Thanks.

start_oo.bat isn't there in the installation.  However, as noted in other postings, there is a command to substitute for it.  I should be able to figure out how to make a service out of it.

I guess I'll track down the Resource Kit.  I'm sure we have it, but I have not used it.

Thanks again.

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

There's a nice set of instructions here:

http://www.tacktech.com/display.cfm?ttid=197

Cheers,

–Aladdin

richmitc
Champ in-the-making
Champ in-the-making
Thanks.

I did it.  I even downloaded the resource kit from the authoriative site.

I did not make Tomcat dependent on OpenOffice or visa versa as alfresco.bat doesn't really do that?  Opinion?

Anyway, I haven't tested any transformations yet, but I did see it in the Task Manager.

Thanks again.

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

It's good to have the dependancy in order to be sure that OpenOfficePortable is running while Alfresco is running. That way you can ensure working transformations.

Regards,

–Aladdin

bsawler
Champ in-the-making
Champ in-the-making
Hi all,

I am a Mechanical Engineer and far, really far from a software engineer.  Actually the only course I failed in University was Computer Programming…

So this is quite difficult for me… With that said, I am having problems (real stressful problems) which may be minor in nature I hope.  First I got Alfresco 1.4 up an running after installing mysql 5.  The CIFS in the Web client was showing my "bgs_a" where my computer name is "bgs".  Now I could never see this in my Network Places nor could I map it cause it always kept saying that it could not connect.  It is my own laptap plugged into my work LAN.

Therefore I installed as for the topic "Installation of Alfresco on Windows as a service" and it is up and running and when I add content, I hover over the file and in the status it says the location is "file////"  So I cannot find the CIFS?  Any idea where it is? I am really struggling with this.

Thanks,
Bradley