removing access from 8082

prazmmer9 years ago

How do we change the port to 80 while deploying the installation in the server

Anton Tananaev9 years ago

You can change port in the configuration file:

https://www.traccar.org/configuration-file/

prazmmer9 years ago

when i change the web.port to 80, it gives an error

the error in the log file is:

WARN: Address already in use - BindException (... < WebServer:166 < Main:34 < ...)

Anton Tananaev9 years ago

It means that you already have some other process in the system that uses port 80.

prazmmer9 years ago

yes the apache server is listening to 80.

prazmmer9 years ago

my server host is not willing to open any other ports for me. is there any way i can direct the application to 80. i built the program using netbeans and deployed the jar file in the glassfish server, but it didnot work.

Anton Tananaev9 years ago

You can use Apache proxy to make Traccar available on port 80.

Acastro7 years ago

Anton apparently the reverse proxy only updates the web every one minute and not constantly as per port 8082

Castillo6 years ago

@Acastro I used the following VirtualHost to make Traccar access from port 80:

< IfModule mod_ssl.c>
< VirtualHost *:443>
    ServerName traccar.myhost.com
    DocumentRoot /var/www
    CustomLog /var/log/apache2/traccaraccess.log combined
    ErrorLog /var/log/apache2/traccar-error.log

# Traccar service
    ProxyRequests off

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

    ProxyPass / http://localhost:8082/
    ProxyPassReverse / http://localhost:8082/


< IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
< /IfModule>

SSLCertificateFile /etc/letsencrypt/live/traccar.myhost.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/traccar.myhost.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
< /VirtualHost>
< /IfModule>