troglobit/merecat

About the configuration file

pioneerAlone opened this issue · 6 comments

Is the ‘#’ of all configuration options in merecat.conf not a comment, but is it enabled by default?

They are supposed to illustrate the default value for each setting, but commented-out. Simliar to how SSH config files, and other similar UNIX tools.

@pioneerAlone if you are satisfied with my answer, maybe we can close this issue?

As I thought, I will configure it.

#cgi "**.cgi|/cgi-bin/*" {
# enabled = false
# limit = 50
#}
Changed to
cgi "**.cgi|/cgi-bin/*" {
     Enabled = true
     Limit = 50
}

After that, execute [systemctl restart merecat.service];
Enter "127.0.0.1/cgi-bin/ssi" in the browser; the display is [404 Not Found]
这样是对的吗?
Because of the project, I need to port an http server on the embedded device, I need to be able to interact, set and modify the parameters, provide basic display, but I will not use it.

It's definitely possible to run CGI scripts with Merecat, but /cgi-bin/ssi is not a very user-friendly example, nor is the above how to use it. (See the man page(s) for more on Server-Side Includes, SSI).

However, http://127.0.0.1/cgi-bin/printenv should work more as you'd expect.

This is actually a very good topic for a blog post, so I'll try to write something up tonight (CET) to showcase the CGI capabilities with Merecat. If you're still interested that is.

Hi again, I went ahead and wrote that blog post anyway. Maybe you've moved on to some other web server by now, but here goes. Maybe someone else will find this thread useful one day :)

https://troglobit.com/2019/08/Basic-CGI-in-C-with-Merecat-httpd/

thanks