[Libwebsockets] 404 response from lwsws using example configuration files

Andy Green andy at warmcat.com
Sun May 22 01:23:10 CEST 2016



On 05/22/2016 01:47 AM, Colin Adams wrote:
> So I read the README.lwsws.md <http://README.lwsws.md>, and installed
> the EXAMPLE conf files as suggested.
>
> But when I try to connect to http://localhost:7681/ I get a 404 response
> (coming from lwsws - confirmed using curl).

What's actually in

/usr/share/libwebsockets-test-server

on your machine?  Does it need adapting for /usr/local/share or some 
other install dir in your case?

> If I try http://localhost:7681/server-status, I get a 301 Redirect to

I wonder why... current master example doesn't have any redirect

https://github.com/warmcat/libwebsockets/blob/master/lwsws/etc-lwsws-conf.d-localhost-EXAMPLE

> the https version of the URL. And if I try THAT, then lwsws says
> forbidding on uri sanitation. Curl -v says:

The default lwsws JSON is set up for http.  Set these guys to your certs 
and uncomment them in the test vhost for that.

#     "host-ssl-key":  "/etc/pki/tls/private/libwebsockets.org.key",
#     "host-ssl-cert": "/etc/pki/tls/certs/libwebsockets.org.crt",
#     "host-ssl-ca":   "/etc/pki/tls/certs/libwebsockets.org.cer",

If you come with an ssl connection on a plain http one, he sees a bunch 
of nonsense which he rejects.

At any rate:

  - make sure you are on current master

  - make sure you did "sudo make install" on lws so there is the right 
stuff in the example asset dirs

  - make sure the JSON origin dirs in the mounts match where you 
installed things

  - make sure the effective user for lwsws (apache / uid 48 if you 
started him as root) can access the asset dirs

-Andy

> * Initializing NSS with certpath: sql:/etc/pki/nssdb
> *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
>    CApath: none
> * NSS error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG)
> * SSL received a record that exceeded the maximum permissible length.
> * Closing connection 0
>
>
>
>
>
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://libwebsockets.org/mailman/listinfo/libwebsockets
>



More information about the Libwebsockets mailing list