How to Install Traccar as sub-folder to my domain

Hi Anton,

How to install traccar as subfolder in my server.
in that server, php website is hosted in mydomain.com

i want to install traccar in mydomain.com/traccar.

I tried https://www.traccar.org/secure-connection/ this, but when going to mydomain.com/traccar
503 error is coming.

help me to resolve the issue.

Thankyou....

Slawek5 years ago

maybe try to other way make subdomain traccar.mydomain.com or monitoring.mydomain.com

Same Problem with Sub-Domain Also..!

Slawek5 years ago

show config file apache2

Manfred5 years ago

Have the same Problem:
New Ubuntu server installation, SSL from letsencrypt, server is running with https://[mydomain.org]. Traccar is working well on http://localhost:8082.
I want to run traccar now on https://[mydomain.org]/traccar.
Have setup the virtual host like described in https://www.traccar.org/secure-connection/, but I get a 404 Not Found.

What goes wrong here?

Here is the traccar VirtualHost configuration (exactly like on the traccar support site):

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>

                ServerName www.example.com
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/html/

                ProxyPass        /traccar/api/socket ws://localhost:8082/api/socket
                ProxyPassReverse /traccar/api/socket ws://localhost:8082/api/socket

                ProxyPass        /traccar/ http://localhost:8082/
                ProxyPassReverse /traccar/ http://localhost:8082/
                
                ProxyPassReverseCookiePath / /traccar/

                Redirect permanent /traccar /traccar/

                SSLEngine on
                Include               /etc/letsencrypt/options-ssl-apache.conf
                SSLCertificateFile    /etc/letsencrypt/live/www.example.com/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/www.example.com/privkey.pem

        </VirtualHost>
</IfModule>

Here is the default VirtualHost configuration:

<IfModule mod_ssl.c>
          <VirtualHost *:443>
                         # The ServerName directive sets the request scheme, hostname and port that
                         # the server uses to identify itself. This is used when creating
                         # redirection URLs. In the context of virtual hosts, the ServerName
                         # specifies what hostname must appear in the request's Host: header to
                         # match this virtual host. For the default virtual host (this file) this
                         # value is not decisive as it is used as a last resort host regardless.
                         # However, you must set it for any further virtual host explicitly.
                         #ServerName www.example.com

                         ServerAdmin webmaster@localhost
                         DocumentRoot /var/www/html

                         # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                         # error, crit, alert, emerg.
                         # It is also possible to configure the loglevel for particular
                         # modules, e.g.
                         #LogLevel info ssl:warn

                         ErrorLog ${APACHE_LOG_DIR}/error.log
                         CustomLog ${APACHE_LOG_DIR}/access.log combined

                         # For most configuration files from conf-available/, which are
                         # enabled or disabled at a global level, it is possible to
                         # include a line for only one particular virtual host. For example the
                         # following line enables the CGI configuration for this host only
                         # after it has been globally disabled with "a2disconf".
                         #Include conf-available/serve-cgi-bin.conf


                       ServerName www.example.com
                       ServerAlias example.com
                       Include               /etc/letsencrypt/options-ssl-apache.conf
                       SSLCertificateFile    /etc/letsencrypt/live/www.example.com/fullchain.pem
                       SSLCertificateKeyFile /etc/letsencrypt/live/www.example.com/privkey.pem
          </VirtualHost>
</IfModule>
Slawek5 years ago
    ServerName your.domain.com 
    ServerAlias www.your.domain.com 
    ProxyRequests off 
     
    ProxyPass /api/socket ws://ipyourdomain:8082/api/socket 
    ProxyPassReverse /api/socket ws://ipyourdomain:8082/api/socket    
    
    ProxyPass / http://ipyourdomain:8082/ 
    ProxyPassReverse / http://ipyourdomain:8082/ 	
Manfred5 years ago

Isn't that the version which runs traccar in the root of the server? I want to run it in the subdirectory /traccar/.