-
Notifications
You must be signed in to change notification settings - Fork 0
Deploy Natively
NOTE: In order to follow this guide, you have to work on sw360 version 5.0 or later which uses the Liferay 7.2 Community Edition GA1 version (as of Sept 2019).
- Install CouchDB
- Install CouchDB Lucene
- Deploy Liferay 7.2 to your instance
- Start Liferay
- Deploy needed dependencies as OSGi modules
- Deploy SW360
- Configure Liferay Portal
- Import SW360 site
- Import users
- Finish upgrade
If you are familiar with Vagrant and Puppet, you can also follow the scripted deployment instructions in the sw360/sw360vagrant project.
You need a clone or download of the SW360 repository to follow this guide. The location of the clone will be referred as SW360_REPOSITORY
in the following.
CouchDB is available on a number of platforms. Please note that the currently used search framework based on Lucene will not work with CouchDB versions or later. As such, please use the versions before 2. One case is to install couchdb as a package from your Linux distro. For example with Ubuntu 16.04, couchdb 1.7.1 is available.
CouchDB Lucene can be downloaded and installed into the same Tomcat container, which is also used by the Liferay installation:
- Download CouchDB Lucene.
- Replace the original
couchdb-lucene-1.0.2/src/main/resources/couchdb-lucene.ini
with this file couchdb-lucene.ini file. - Apply the patch on
couchdb-lucene-1.0.2/
- Build the
couchdb-lucene-1.0.2/
again withmvn clean install war:war
- Once available, copy the resultign war file (in the target folder) to the deployment folder of the Tomcat (usually something like
${CATALINA_HOME}/webapps
)
- Download Liferay with Tomcat from
https://sourceforge.net/projects/lportal/files/Liferay%20Portal/7.2.0%20GA1/liferay-ce-portal-tomcat-7.2.0-ga1-20190531153709761.tar.gz/download. Its SHA256 checksum is
0d7dc6bab406e910048bbf4de41189495691625dc43acb65eab5400ec826d124
. - Extract it to the folder you wish Liferay to start from. This folder will
be called
LIFERAY_INSTALL
during the rest of the guide. - Copy the file
${SW360_REPOSITORY}/frontend/configuration/setenv.sh
to${LIFERAY_INSTALL}/tomcat-9.0.17/bin
by overwriting the existing file. Check the content and adapt it to your needs, at least the Java memory settings. - Copy the file
${SW360_REPOSITORY}/frontend/configuration/portal-ext.properties
to${LIFERAY_INSTALL}
. This file includes needed, useful and some optional settings to optimize running SW360 in Liferay. - Open the file
${LIFERAY_INSTALL}/portal-ext.properties
and uncomment all properties starting withdefault.admin.
. This will define a default administrator used to do the setup in the following steps. You will be rememembered to change or deactivate this user at the end of the upgrade.
Note In case the sw360.properties
do not kick in and you need to login to a "factory-new" liferay instance, the initial user credentials to login are (usually):
[email protected]
test
From the sw360 repository you should have (at least) the following files in /etc/sw360
:
-
couchdb.properties
: Database connection for SW360. -
sw360.properties
: Custom properties for SW360 application.
In additon, copy the following property file form the Liferay installation:
-
portal-ext.properties
: Custom properties for Liferay Portal.
Please check if your /etc/sw360/portal-ext.properties
now overrides some of the properties in ${LIFERAY_INSTALL}/portal-ext.properties
and comment or remove them if necessary.
-
Adjust
sw360.properties
You may skip this step if you did not customize one of the following options from the previous step:
auto.login.hooks
login.events.post
servlet.service.events.pre
Otherwise copy the following block into your
/etc/sw360/sw360.properties
and adapt it to your needs. Activate the necessary components depending on the settings of the old three properties. You should be able to easily match the old options with new component names. Do no remove any componentes if you do not know what they are doing!# Activation of Dynamic Components # Possible components to be enabled: # - org.eclipse.sw360.portal.users.TestAutoLogin (A stub for testing single sign on. Everyone will be logged in as [email protected]) # - org.eclipse.sw360.portal.users.SSOAutoLogin (A single sign on class relaying on headers in the request) # - org.eclipse.sw360.portal.users.LoginAction (Default login action. Do not disable unless you know what you are doing) # - org.eclipse.sw360.portal.users.LandingPageAction (Liferay does not redirect to landing page when the login is taken over by SSOAutoLogin. Activate this one if using SSOAutoLogin component) # - org.eclipse.sw360.portal.components.BuildInfoTemplateContextContributor (Provide build information of SW360 for templates) # - org.eclipse.sw360.portal.components.FossologyCheckConnectionOnStartupHook (Checks at startup if fossology is reachable) components.activate= \ org.eclipse.sw360.portal.users.LoginAction, \ org.eclipse.sw360.portal.components.BuildInfoTemplateContextContributor, \ org.eclipse.sw360.portal.components.FossologyCheckConnectionOnStartupHook
No other options have to be touched for this upgrade.
Liferay comes with a Hypersonic database. This can be absolutely fine. In case you would like to change it. Please refer to the Liferay documentation how to install Liferay with another database.
The following dependencies are needed to run SW360 and therefore must be
downloaded and copied to ${LIFERAY_INSTALL}/deploy
:
- Apache Commons Codec 1.12
- Apache Commons Collections4 4.1
- Apache Commons CSV 1.4
- Apache Commons IO 2.6
- Apache Commons Lang 2.4
- Apache Commons Logging
- Google Gson 2.8.5
- Google Guava 21.0
- Jackson Annotations 2.9.8
- Jackson Core 2.9.8
- Jackson Databind 2.9.8
With the dependencies in place you may deploy SW360 modules now. The following describes a setup where the Apache Tomcat bundled with Liferay will also host the backend and REST services.
You may run the following command inside ${SW360_REPOSITORY}
to automatically deploy SW360 modules to the
correct locations:
mvn package -P deploy -Dbase.deploy.dir=. -Dliferay.deploy.dir=${LIFERAY_INSTALL}/deploy -Dbackend.deploy.dir=${LIFERAY_INSTALL}/tomcat-9.0.17/webapps -Drest.deploy.dir=${LIFERAY_INSTALL}/tomcat-9.0.17/webapps
If you want to copy the artifacts manually, please use the following destinations depending on the module:
- backend/* goes to
${LIFERAY_INSTALL}/tomcat-9.0.17/webapps
- frontend/* goes to
${LIFERAY_INSTALL}/deploy
- libraries/* goes to
${LIFERAY_INSTALL}/deploy
- rest/* goes to
${LIFERAY_INSTALL}/tomcat-9.0.17/webapps
Starting the new Liferay should be pretty much the same as starting the old Liferay version. So calling the following command should be sufficient:
${LIFERAY_INSTALL}/tomcat-9.0.17/bin/startup.sh
Note: If you had some start services in place to start your Liferay instancen
you might have to change them since the bundled version of Apache Tomcat has been
upgrade and thus the folder is now named tomcat-9.0.17
.
To apply the following steps, login as default administrator as configured above. If you
have copied all properties from this guide, the login is [email protected]
with password
sw360fossy
.
You'll get a Not Found
message after login. Do not worry that is alright for the moment.
You should change the password for that user in order to prevent any one else to login with the login data from the property file:
- Click on the user icon on the top right and select
Account Settings
. - Click on
Password
on the left side of the tabGeneral
. - Change your password using the displayed form.
The following sections will now describe the single steps to configure Liferay.
- Open the panel on the left side by clicking the button on the top left.
- Go to
Control Panel
->Configuration
->Instance settings
. - Click on
Users
(inside sectionPlatform
). - Click on
Default User Associations
on the left side. - Fill the field
Sites
on the top withSW360
and click onSave
.
Note: This way newly created users are automatically assigned to the site SW360
and can
access the content on it. This is important for the import of the users later on. Normally you
would keep this settings afterwards as well. Otherwise you would have to assign all new users
manually.
- Open the panel on the left side by clicking the button on the top left.
- Go to
SW360
->Publishing
->Import
. - Import the following page archives (in that order) from
${SW360_REPOSITORY}/frontend/configuration
...Public_Pages.lar
Private_Pages.lar
-
Private_Pages_BDP_Import.lar
(optional; only if you need BDP Import) -
Private_Pages_WS_Import.lar
(optional; only if you need WS Import)
- ...by following theses steps:
-
Click on
+
on the top right. -
Select the appropiate file and click
Continue
. -
Select
Public Pages
orPrivate Pages
depending on the prefix of the filename. -
Change the following options according to the selected file:
- Theme Settings
- Logo
- Site Page Settings
- Site Template Settings
- Delete Missing Pages
They sould be enabled or disabled dependening on the select file:
-
Public_Pages.lar
,Private_Pages.lar
: Enable all options. - All other files: Disable all options.
-
No options need to be checked inside section
DELETIONS
. -
Be sure to check
Import Permissions
inside sectionPERMISSIONS
. -
Expand section
Update Data
and selectMirror with overwriting
. -
Expand section
Authorship of the Content
and selectUse the Current User as Author
. -
Click
Import
.
-
For unknown reason Liferay does not always seem to set the theme correctly. Follow these steps to check if the correct theme has been configured:
- Open the panel on the left side by clicking the button on the top left.
- Go to
SW360
->Site Builder
->Pages
. - Select
Public Pages
in the left column. - Click on the
cog
-icon to configure the pages. - Inside the
LOOK AND FEEL
section check if the current theme is namedSW360
. - Otherwise click on
Change Curren Theme
and select themeSW360
. - Repeat step 3.-6. with
Private Pages
.
Note: In general SW360 should also work with the Classic Theme
provided by liferay since the
theme is mainly to adjust colors. However we do not test the Classic Theme
extensivly. If you want
to change the colors of SW360 consider forking the project liferay-theme
inside the SW360
repository.
OPTIONAL: This is only needed if you do your daily work as an Liferay administrator (not recommended). In all other cases you may skip this step.
This will hide the portlet decorators for Liferay administrators. These decorators are very irritating when doing normal SW360 work. Normal Liferay user will not see the decorators anyway.
- Open the panel on the left side by clicking the button on the top left.
- Go to
SW360
->Site Builder
->Pages
. - Select
Public Pages
in the left column. - Click on the
cog
-icon to configure the pages. - Switch on the option
Hide Portlet Decorators for Edit
underSettings
. - Do step 3.-5. for
Private Pages
as well.
Note: You will not see some content like projects or components as the default Liferay
administrator which is most likely [email protected]
. Please do no worry, if you see emtpy tables on these pages before completing the installation with users.
- Open the panel on the left side by clicking the button on the top left.
- Click on
SW360
on the top right to go to the homepage. - Click on
Start
inside the "Welcome" section. - Go to
Admin
->User
(URL:/group/guest/users
). - Scroll down to section
UPLOAD USERS
, select a user file from the very beginning and clickUpload Users
on the right side. A user file can be found here in the sw360vagrant project
- Please log out as setup administrator.
- Please log in as one of the other SW360 users now and check the content, especially the projects and components.