2

I am unable to get a valid response from my server (Ubuntu 16.04) at DigitalOcean after installing OSRM succefully. I have followed the instructions here:

https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM

When running the following:

osrm-routed netherlands-latest.osrm

I am getting the following output in my console:

[info] starting up engines, v5.18.0
[info] Threads: 2
[info] IP address: 0.0.0.0
[info] IP port: 5000
[info] http 1.1 compression handled by zlib version 1.2.8
[info] Listening on: 0.0.0.0:5000
[info] running and waiting for requests

Now when I try to access my server at port 5000:

http://123.456.789.000:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true

Is not giving me any response (timeout). I tried the actual domain name as well.

I have also tried to setup a reverse proxy. But apache is also not giving me any logs. Note that this is in my config (/etc/apache2/sites-available/000-default.conf):

<VirtualHost *:8080>
    ServerName my.domain.nl
    ProxyPass               /       http://localhost:5000
    ProxyPassReverse        /       http://localhost:5000
    ProxyRequests     Off

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

I have also verified that no firewall is running. Any idea what I could be missing here?

xfscrypt
  • 16
  • 5
  • 28
  • 59
  • Do you have any log output for Apache and OSRM? – Oliver May 18 '18 at 17:07
  • @oliver as mentioned , there are no log outputs from apache. The log for OSRM is seen in my question. Last line says it’s waiting for requests – xfscrypt May 19 '18 at 05:42
  • @apfz can you try running a request locally like: `http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true` – themarex May 20 '18 at 11:26
  • @themarex. I am getting the following response in the terminal: root@myapi:~# curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true {"message":"Number of coordinates needs to be at least two.","code":"InvalidOptions"}13.385983,52.496891?steps=true: command not found. So it looks like there is a response at least. – xfscrypt May 20 '18 at 12:25
  • @themarex even replacing 127.0.0.1 with the public ip of the server is it giving the response. just that through the browser/ postman it is not giving a response – xfscrypt May 20 '18 at 12:28
  • If your virtual host with reverse proxy is listening on port 8080 as shown above, you should try connecting to `http://external.ip:8080/route...` or `http://my.domain.nl:8080/route..` instead. – grudolf May 22 '18 at 18:10
  • @grudolf yes it is something I tried to do. but no luck as there is no response – xfscrypt May 23 '18 at 12:20
  • try starting osrm-routed with --port 5001 – Raphael Schumann Dec 11 '19 at 17:28

1 Answers1

1

Go to your apache2.conf file and then paste the following line:

ProxyPass /osrm http://localhost:5000

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

Then type this command to stop and start your apache2:

sudo service apache2 stop

sudo service apache2 start

After that go to your browser and check the link below:

https://your_server_ip_or_domain_name/osrm/table/v1/driving/13.388860,52.517037;13.385983,52.496891?annotations=distance

This works for me.

Lambda Theta
  • 35
  • 1
  • 10