This guide was originally authored by: Michael Chen
This guide provides an up-to-date instruction for installing Crafter Studio 1.7.x. It is applicable to both Linux and Mac OS. All folder locations are based on the Mac OS "/Applications" folder, but it can be something else, like "/opt" common in Linux environment. The trailing letter 'x' in folder name pattern, such as "cstudio-1-7-x", is meant to be replaced with the actual version number of your choice.
Install from a Tomcat bundle
The ZIP archive downloaded here is bundled with Tomcat. These are steps for installing from such an archive:
- Unzip cstudio-1-7-x.zip into /Application/Alfresco.
- Run the following shell commands:
cd /Application/Alfresco/cstudio-1-7-x mkdir alf_data chmod +x ImageMagick/bin/convert chmod +x bin/pdf2swf echo > tomcat/shared/classes/alfresco/extension/custom-repository.properties
- Edit tomcat/shared/classes/alfresco-global.properties. Set or comment out these settings:
dir.root=/Applications/Alfresco/cstudio-1-7-0/alf_data #dir.indexes=/opt/cstudio/authoring-head/alf_data/lucene-indexes db.username=alfresco db.password=alfresco ooo.exe=/Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin ooo.enabled=false jodconverter.officeHome=/Applications/OpenOffice.org.app/Contents jodconverter.portNumbers=8101 jodconverter.enabled=true img.root=./ImageMagick swf.exe=./bin/pdf2swf index.recovery.mode=AUTO
- Delete or rename the ./alfreso.sh script that comes with the archive (which has trouble shutting down Alfresco). Create a simpler version of ./alfresco.sh listed in "[Alfresco Enterprise 3.4 Manual Installation]". See also "Running Alfresco Enterprise" towards the bottom of that page.
- Start Alfresco and wait for everything fully deployed and running.
./alfresco.sh start tail -f tomcat/logs/catalina.out
Install to an external Tomcat
Refer to "[Alfresco Enterprise 3.4 Manual Installation]" on how to install Alfresco Enterprise and Tomcat. Instead of copying the alfresco.war and share.war from the Alfresco Enterprise archive, copy these two WARs from cstudio-1-7-x.zip into the Tomcat webapps folder.
(This topic is incomplete. Do the war files take care of importing crafter's database schema?)
Install the Preview Server
You can download Tomcat 6.0.x from Apache. Unzip the archive into /Application/Alfresco/preview-tomcat-6.0.x.
Edit conf/server.xml. Locate the <Server> and <Connector> elements. Modify all 3 port values and add the URIEncoding property as follows:
<Server port="8105" shutdown="SHUTDOWN"> ... <Connector port="8180" protocol="HTTP/1.1" URIEncoding="UTF-8" connectionTimeout="20000" redirectPort="8443" /> ... <Connector port="8109" protocol="AJP/1.3" redirectPort="8443" /> ...
Edit conf/context.xml. Add the following within the <Context> element:
<Valve className="org.apache.catalina.authenticator.SSLAuthenticator" securePagesWithPragma="false" />
Edit conf/catalina.properties. Set the shared.loader value as follows:
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
Run these shell commands:
cd /Application/Alfresco/preview-tomcat-6.0.x
mkdir -p shared/classes/crafter/extension
mkdir -p shared/lib
# Do the following if you downloaded the ZIP archive:
chmod +x bin/*.sh
# Replace Tomcat's ROOT with the Crafter Studio's ROOT.war
rm -rf webapps/ROOT
cp -p ../cstudio-1-7-x/tomcat/webapps/ROOT.war webapps/
Create shared/classes/crafter/extension/custom-context.xml as follows:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!-- load common properties --> <bean id="crafterConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders"> <value>true</value> </property> <property name="locations"> <list> <value>classpath:core/system-cfg.properties</value> <value>classpath:core/crafter-cfg.properties</value> <value>classpath:crafter/custom-system-cfg.properties</value> </list> </property> </bean> <import resource="classpath:core/mode-alfwcm-preview-server.xml" /> </beans>
Create shared/classes/crafter/custom-system-cfg.properties as follows:
alfresco.preview.endpoint.username=admin alfresco.preview.endpoint.password=admin alfresco.preview.endpoint.servicebaseurl=http://localhost:8680/alfresco/s alfresco.preview.endpoint.downloadbaseurl=http://localhost:8680/alfresco/s/api/node/content/avm alfresco.preview.endpoint.authserviceurl=http://localhost:8680/alfresco/s/api/login alfresco.authoring.endpoint.username=admin alfresco.authoring.endpoint.password=admin alfresco.authoring.endpoint.servicebaseurl=http://localhost:8680/share alfresco.authoring.endpoint.downloadbaseurl=http://localhost:8680/share alfresco.authoring.endpoint.overlay.callback=/proxy/authoring/service/cstudio/wcm/preview/overlayhook?site={site}&page={browser.uri} crafter.fileSystemRootFolder=${crafter.base.site.path}/ crafter.preview.wcm.adapter.descriptorBasePath=/www/avm_webapps/ROOT
To start the preview server, run following command:
bin/startup.sh
To track the progress of the server startup, run following command:
tail -f logs/catalina.out
To shutdown the preview server, run following command:
bin/shutdown.sh
Domain Name Resolution
The Crafter Studio authoring and preview environment requires cross-domain cookies. Assuming both Crafter Studio and the preview server run in the local machine, the following entry must be added to the /etc/hosts file:
127.0.0.1 localhost acme.com acmecom--collab.cstudio.acme.com
Edit tomcat/webapps/share/WEB-INF/classes/cstudio-application-context.xml. Set the cookieDomain value to ".acme.com" (the top domain name of the demo site):
<property name="cookieDomain">
<value>.acme.com</value>
</property>
Restart Alfresco.
./alfresco.sh stop -force ./alfresco.sh start tail -f tomcat/logs/catalina.out
Install the ACME Demo Site
This site demonstrates many features of Crafter Studio. Steps to import and configure it are:
- The cstudio-1-7-x-acme-demo-site.zip archive downloaded here must be split into two archives as follows:
unzip cstudio-1-7-x-acme-demo-site.zip cd cstudio-1-7-x-acme-demo-site/acmecom/dm-store zip -r ~/dm-store.zip * cd ../wcm-store zip -r ~/wcm-store.zip *
- Login to Alfresco Explorer as admin. Click on "Company Home" in the navigation pane.
- Click on the "More Actions" drop-down menu and select "Import".
- In the import page, click "Browse". Find and import ~/dm-store.zip created above.
- Click on the Administration Console icon
and select "Manage System Users". Then click "Create User" - In step 1, enter "collab" for First Name, Last Name. Enter "collab@acme.com" for Email.
- In step 2, enter "collab" for User Name Password, and Home Space Name. Click "Finish".
- Click on "Web Projects" in the navigation pane.
- Click on the "Create" drop-down menu and select "Create Web Project".
- Enter "acmecom" in Name, DNS Name, Title and Description. Then click "Next".
- Continue to click "Next" for step 2 to 5.
- In step 6 "Add Users", enter "admin" and click "Search" next to it. Highlight "Administrator" and "Content Manager" in the two list boxes below, then click "Add to List". Repeat the same steps to add user "collab" as Content Manager. Then click "Next".
- Click "Next" for step 7, and finally click "Finish" in step 8.
- In "Web Projects", click on the "acmecom" project. Then under "User Sandboxes", click on "Browse Website".
- Click on the "Create" drop-down menu and select "Bulk Import".
- In the import page, click "Browse". Find and import ~/wcm-store.zip created above.
- Click on the "acmecom" Web project again. In User Sandboxes, click "Submit All".
- Enter an arbitrary label and description, then click "OK".
- Find and edit this XML file in Alfresco: Company Home > cstudio > config > sites > acmecom > environment-overrides > dev > environment-config.xml. Modify the <preview-server-url>, <authoring-server-url> and <cookie-domain> values as follows:
<environment-config> <preview-server-url>http://acmecom--collab.cstudio.acme.com:8180</preview-server-url> <authoring-server-url>http://acmecom--collab.cstudio.acme.com:8680/share</authoring-server-url> <live-server-url>http://acme.com</live-server-url> <live-fsr> <fsr> <property name="name">acme-com-prod</property> </fsr> </live-fsr> <cookie-domain>acme.com</cookie-domain> <open-site-dropdown>false</open-site-dropdown> </environment-config> - Login to Alfresco Share as collab using the following URL:
http://acmecom--collab.cstudio.acme.com:8680/share - Click on the "Sites" drop-down and select "Create Site".
- Enter "acmecom" for both Name and URL Name. Enter "ACME demo site" as Description. Select "Web Experience Management Site" for Type. Click "OK".
- From the Alfresco Share dashlet "My Sites" or the "Sites" drop-down, click on the "acmecom" site name to enter the Crafter Studio acmecom Dashboard.
- Click on the "Site Content" drop-down, open "Pages" and click on "Acme Home". This will lead to the home page preview served up by the preview server.