Project

General

Profile

Is there anyway to run lighttpd in the command line?

Added by zoolop about 1 year ago

I do not want the web server daemon to start or etc. I want to send requests through the binary and receive a response. Is there such a way?


Replies (6)

RE: Is there anyway to run lighttpd in the command line? - Added by gstrauss about 1 year ago

You created an account to post this question, yet you failed to try the basic step of running lighttpd -h or man lighttpd before posting. Please do so and then ask a more detailed question.

RE: Is there anyway to run lighttpd in the command line? - Added by zoolop about 1 year ago

oh sorry about that
i found out the solution
thank you!

RE: Is there anyway to run lighttpd in the command line? - Added by zoolop about 1 year ago

I tried using the -1 option but it didnt work. I couldn't find any documentation. Here is my setup.
this is my configuration file

server.document-root = "/var/www/servers/pages/" 
server.modules = ( "mod_access", "mod_accesslog", "mod_alias", "mod_auth", "mod_authn_file", "mod_cgi", "mod_compress", "mod_deflate", "mod_dirlisting", "mod_evhost", "mod_expire", "mod_extforward", "mod_fastcgi", "mod_flv_streaming", "mod_indexfile", "mod_proxy", "mod_redirect", "mod_rewrite", "mod_rrdtool", "mod_scgi", "mod_secdownload", "mod_setenv", "mod_simple_vhost", "mod_sockproxy", "mod_ssi", "mod_staticfile", "mod_status", "mod_userdir", "mod_usertrack", "mod_vhostdb", "mod_webdav", "mod_wstunnel" )
server.port = 8080
index-file.names = ( "index.html" )
mimetype.assign = (
  ".html" => "text/html", 
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png" 
)

Then, I use this command lighttpd -f lighttpd.conf -D -1 test.txt
The file test.txt contains this
GET /index.html HTTP 1.0
I get this error: (server.c.489) lighttpd -1 stdin is not a socket
What is the solution to this?

RE: Is there anyway to run lighttpd in the command line? - Added by gstrauss about 1 year ago

There are comments in server.c about why lighttpd does not currently work with netcat, which uses pipes.

A read pipe and a write pipe are two separate file descriptors, whereas read and write occur on the same socket file descriptor.

RE: Is there anyway to run lighttpd in the command line? - Added by zoolop about 1 year ago

Thank you,
I found another way for it too work by adding a new command line option?
My new problem is that I cannot find the function that lighttpd uses to terminate the server. What is the function?

RE: Is there anyway to run lighttpd in the command line? - Added by gstrauss about 1 year ago

You just posted a question from a different forum post. You might think they are related, but you haven't linked them.

You're still posting development questions in the support forum.

Please learn some etiquette, or you will receive no further responses from me.

    (1-6/6)