Axelor 5.3.3 installation

Finally I have got Ver 5.3.5 installed from the source on Ubuntu 18. Going back to the previous complications and errors, there were some stupid mistakes I have made. Also there are some minor missing steps in the documentation which I will be glad to update if I can.

1 J'aime

Hello,
Has anyone successfully installed v5.3 on a hosted server? I have installed and tested the windows client and now I would like to test deploying a live site.

Any suggestions would be appreciated.
Thank you

Hi Kumar Pathel, Do you have a step-by-step instructions on how to install Axelor (from source) on Ubuntu you can share?

2 J'aimes

Dear Kumar,

I too appreciate if you could share the steps for Ubuntu installation.(though my actual requirement is to install it on Cent OS)

Thank you in advance.

absolutely. me too. I need to step by step installation procedure.
thank you in advance.

1 J'aime

Axelor Ver 5.3.6 Installation in Ubuntu 18.0

Prerequisites

Install Git

Install Git

$ sudo apt-get install git

For Ubuntu, this PPA provides the latest stable upstream Git version

$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git

Install OpenJDK 8

Install OpenJDK 8

$ sudo apt-get install openjdk-8-jdk

Install Tomcat 9.0.26

For security purposes, Tomcat should be run as an unprivileged user (i.e. not root).

First create a new tomcat group:

$ sudo groupadd tomcat

Now create a new tomcat user:

$ sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat

Now, download version of Tomcat 9.0.26 from the Tomcat Downloads page. Under the Binary Distributions section, copy the link to the .tar.gz package. e.g apache-tomcat-9.0.26.tar.gz

Follow these commands:

$ cd /tmp
$ curl -O https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.26/bin/apache-tomcat-9.0.26.tar.gz
$ sudo mkdir -p /opt/tomcat
$ sudo tar -xzf apache-tomcat-9.0.26.tar.gz -C /opt/tomcat --strip-components=1

Now fix permissions:

$ cd /opt/tomcat
$ sudo chgrp -R tomcat /opt/tomcat
$ sudo chmod -R g+r conf
$ sudo chmod g+x conf
$ sudo chown -R tomcat webapps/ work/ temp/ logs/

Install PostgreSQL

$ sudo apt update
$ sudo apt install postgresql postgresql-contrib

You may also require to configure postgresql server to allow password authentication.

Example pg_hba.conf

$ sudo nano /etc/postgresql/10/main/pg_hba.conf

Replace peer to trust in # “local” is for Unix domain socket connections only. See below

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

Once PostgreSQL is configured, create a new database user with password:

$ sudo su postgres
$ createuser axelor --no-createdb --no-superuser
$ psql -c "alter user axelor with encrypted password 'axelor'";

A new PostgreSQL user axelor is created with the given password. The password used here is just for demonstration. Use your own strong password.

Create a database:

$ sudo su postgres
$ createdb -O axelor axelor
$ exit

A new database named axelor is created.

Build from source OR Download directory from here

Get the latest source code of the Axelor Open Suite using Git as follows:

$ mkdir -p /tmp/axelor-source
$ cd /tmp/axelor-source

$ git clone https://github.com/axelor/open-suite-webapp.git axelor-erp
$ sed -e 's|git@github.com:|https://github.com/|' -i axelor-erp/.gitmodules

$ cd axelor-erp
$ git checkout master
$ git submodule sync
$ git submodule init
$ git submodule update
$ git submodule foreach git checkout master
$ git submodule foreach git pull origin master

Now build the war package from the source:

$ ./gradlew -x test build

After build completion, you will find the war package under /tmp/axelor-source/axelor-erp/build/libs directory.

Deploy the App

Now as the war package is built, it’s time to run the app by deploying it on Tomcat.

Now copy the built WAR file “axelor-erp-5.3.6.war” from /tmp/axelor-source/axelor-erp/build/libs to this directory “/opt/tomcat/webapps/ROOT”

$ cd /opt/tomcat/webapps/ROOT
$ rm -r *
$ sudo cp /tmp/axelor-source/axelor-erp/build/libs/axelor-erp-5.3.6.war /opt/tomcat/webapps/ROOT/ROOT.war
$ sudo jar xvf ROOT.war

Now change the /opt/tomcat/webapps/ROOT/WEB-INF/classes/application.properties by editing the file as follow:

$ sudo nano /opt/tomcat/webapps/ROOT/WEB-INF/classes/application.properties

However, you have to provide database settings like this or if you have set it up with different database name or user name and password:

db.default.driver = org.postgresql.Driver
db.default.ddl = update
db.default.url = jdbc:postgresql://localhost:5432/axelor
db.default.user = axelor
db.default.password = axelor

Create Tomcat systemd Service File

We want to be able to run Tomcat as a service, so we will set up systemd service file.

Tomcat needs to know where Java is installed. This path is commonly referred to as “JAVA_HOME”. The easiest way to look up that location is by running this command:

$ sudo update-java-alternatives -l

It should display this

Output
java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64

Your JAVA_HOME is the output from the last column. Given the example above, the correct JAVA_HOME for your server would be:

JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-amd64

With this piece of information, we can create the systemd service file. Open a file called tomcat.service in the /etc/systemd/system directory by typing:

$ sudo nano /etc/systemd/system/tomcat.service

Paste the following contents into your service file. Modify the value of JAVA_HOME if necessary to match the value you found on your system “/usr/lib/jvm/java-1.8.0-openjdk-amd64” DONE for you :slight_smile: . You may also want to modify the memory allocation settings that are specified in CATALINA_OPTS :

/etc/systemd/system/tomcat.service

[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

User=root
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

When you are finished, save and close the file.
Next, reload the systemd daemon so that it knows about our service file:

$ sudo systemctl daemon-reload

Start the Tomcat service by typing:

sudo systemctl start tomcat

Double check that it started without errors by typing:

sudo systemctl status tomcat

After a short time you can access the application at: http://IP-ADDRESS:8080

While waiting for the application to come up you can check the log file “catalina.out” located in /opt/tomcat/logs.

$ sudo nano /opt/tomcat/logs/catalina.out

If you want to run the application with port 80 "without 8080. Note: make sure no other http services is running.

Edit the file /opt/tomcat/conf/server.xml as follow:

$ sudo nano /opt/tomcat/conf/server.xml 

and replace this par of the file the port from 8080 to 80

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

That’s all folk good luck and hope it will work for you. If not give me a buzz :slight_smile:

5 J'aimes

this is really great, i wish if i could give more hears :slight_smile:

@Kunar pathel…excellent now installation steps have been completed with regards to various operating systems and efforts of all friends are appreciated. Now I will suggest to move ahead toward simple customization particularly reports, print out and fields. Functional side discussion is also essential:). I have deployed QuickBooks enterprise, odoo and erpnext. So far QuickBooks enterprise seems at top in comparison of flexibility, customization, reporting, remote access and custom fields wise. What are your view point?

thank you. amazing explanation

See the [official installation doc]( See https://docs.axelor.com/abs/5.0/install/index.html). I suggest if something is missing. The doc is not up to date but still applies to latest 5.2 and 5.3 branches too.

Someone please guide me on what I’m doing wrong.

can you share output on console I feel axelor-erp missing in url

I have the same problem , due to connecting PostgresSQL …

How did you solve it? I’m not even sure what I’m doing wrong.

With good postgres user

I don’t understand this.

Can you have the trace in the server log file ?

I did just like you said followed every step to the t but still nothing happened. when I open localhost:8080 still gives me Tomcat 8.5 welcoming page. Can you please assist?
I am running it well on docker just want another option to see which one is lighter coz docker image is very large and cluttered

I need help been trying to deploy it but nothing is happening. I have installed the other stuff please help

HEllo , you install a war ?