Published on Oct 22 2016 in Java Tomcat

Traccar can run on shared server (cPanel) standalone or in pair with OpenGTS. You need a few modifications to have it running.

Download and unpack the software. When trying to start installer on a server without root access we will get Permission denied'

Verifying archive integrity... All good.
Uncompressing traccar  100% line 488: ./ Permission denied

On shared server you will not be able to extraxt traccar to hardcoded /opt/traccar. You will need to modify the destination path and also the default HTTP port.

./ --keep --noexec --target traccar
Creating directory traccar
Verifying archive integrity... All good.
Uncompressing traccar  100%

Optionally modify UNIX_PATH in to use traccar directory in your home directory (this step is not really needed as only tries to make traccar autostarting on server boot).

sed -i 's/UNIX_PATH="\/opt/UNIX_PATH="~/' ~/traccar/

Update paths to your own home directory in XML config file:

sed -i "s#\/opt\/traccar#$HOME\/traccar#g" ~/traccar/conf/traccar.xml

Update HTTP port to a custom one assigned by your hosting provider (11111 in this example):

sed -i 's/>8082</>11111</' ~/traccar/conf/traccar.xml

Modify bin/traccar by adding return 0; under mustBeRootOrExit() { and installdaemon() {

sed -i -e '/mustBeRootOrExit() {/a return 0;' -e '/installdaemon() {/a return 0;' ~/traccar/bin/traccar

This way you skip installation of startup script in its default location that is impossible on shared server anyway.

You can now start traccar with:

cd ~/traccar/bin/
./traccar start
Starting traccar...
Waiting for traccar......
running: PID:632085