#61775 - 21/01/2002 13:15
PHP and khttp
|
enthusiast
Registered: 30/12/2000
Posts: 249
Loc: Dover, NJ
|
I know this has been talked about before (I think I brought it up), but is it possible to get khttp working with PHP? I don't know much about khttp or Linux in general, but as I understand it..normally the webserver would be configured to hand off PHP file requests to the PHP installation, and would be parsed and returned to the web server for sending out to the client. Would this ever be possible on the empeg, using Hijack's khttp server?
I'd love to have an envrionment that supports PHP so I can do my own scripting.
_________________________
- Chris
Orig. Empeg Queue position 2
|
Top
|
|
|
|
#61776 - 21/01/2002 13:32
Re: PHP and khttp
[Re: cwillenbrock]
|
new poster
Registered: 11/01/2002
Posts: 21
Loc: Bay Area
|
You might just want to use Apache on the Empeg. It can be configured/compiled to use pretty minimal resources (mainly a smaller memory footprint) so it shouldn't be too bad.
Regards
Amit
|
Top
|
|
|
|
#61777 - 21/01/2002 13:38
Re: PHP and khttp
[Re: amit]
|
enthusiast
Registered: 30/12/2000
Posts: 249
Loc: Dover, NJ
|
That would work, however I figured since I'm already running a web server with Hijack (and one that has a small enough footprint) it would be redundant to load a second. Also, I'm not nearly familiar enough with the Linux OS, let alone the empeg "version" of it to compile or install this myself without idiot-proof, step-by-step instructions.
_________________________
- Chris
Orig. Empeg Queue position 2
|
Top
|
|
|
|
#61778 - 21/01/2002 14:00
Re: PHP and khttp
[Re: cwillenbrock]
|
new poster
Registered: 11/01/2002
Posts: 21
Loc: Bay Area
|
Do take into account that a web server "built-in" into the kernel would typically serve static content, and should not deal with executable/dynamic content. I haven't looked at the khttpd source for the Hijack kernel, so I am not sure (I believe somebody will correct me if I'm wrong :-)), but you cannot serve non-static content with it.
Interestingly enough, the most recent khttpd implementatoin in the Linux kernel actually passes all requests for non-static information to a regular user space web server.
Regards
Amit
|
Top
|
|
|
|
#61779 - 21/01/2002 14:15
Re: PHP and khttp
[Re: cwillenbrock]
|
carpal tunnel
Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
|
Oh my goodness, no. I believe it would be a very bad idea to have an HTTP daemon that runs in kernel space serving PHP, CGI, or whatever else. I don't want some malformed PHP script causing a kernel panic on my Empeg. There are just too many security concerns, as well as problems with memory usage, to allow for PHP from a kernel HTTP daemon.
|
Top
|
|
|
|
#61780 - 21/01/2002 14:20
Re: PHP and khttp
[Re: tonyc]
|
enthusiast
Registered: 30/12/2000
Posts: 249
Loc: Dover, NJ
|
Ok, so..the short answer to my question is..no.
Thanks.
_________________________
- Chris
Orig. Empeg Queue position 2
|
Top
|
|
|
|
#61781 - 21/01/2002 14:24
Re: PHP and khttp
[Re: cwillenbrock]
|
new poster
Registered: 11/01/2002
Posts: 21
Loc: Bay Area
|
Yes, no to khttpd doing PHP. If you really want PHP, I will probably post instructions on doing a minimal Apache when my Empeg is up again.
Regards
Amit
Edited by amit (21/01/2002 17:28)
|
Top
|
|
|
|
#61782 - 21/01/2002 14:26
Re: PHP and khttp
[Re: amit]
|
enthusiast
Registered: 30/12/2000
Posts: 249
Loc: Dover, NJ
|
That would be lovely.
_________________________
- Chris
Orig. Empeg Queue position 2
|
Top
|
|
|
|
#61783 - 21/01/2002 18:26
Re: PHP and khttp
[Re: cwillenbrock]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14496
Loc: Canada
|
Just install a real full-service httpd, and then disable khttpd using this in config.ini:
[hijack]
khttpd_port=0
Then you can script to your heart's content.
-ml
|
Top
|
|
|
|
#61784 - 23/01/2002 18:46
Re: PHP and khttp
[Re: amit]
|
Pooh-Bah
Registered: 09/09/1999
Posts: 1721
Loc: San Jose, CA
|
If you want a mother of a hack, then you can write a file system that masquerades PHP. That way, you can use the built in hijack web server, and it will be fooled into serving out dynamic content masquerading as static files on this invented file system.
Of course, it would work equally well with FTP.
Of course, it doesn't have to be PHP, it can be anything.
Calvin
|
Top
|
|
|
|
#61785 - 23/01/2002 20:04
Re: PHP and khttp
[Re: eternalsun]
|
enthusiast
Registered: 30/12/2000
Posts: 249
Loc: Dover, NJ
|
You're making my brain hurt.
_________________________
- Chris
Orig. Empeg Queue position 2
|
Top
|
|
|
|
#61786 - 23/01/2002 21:55
Re: PHP and khttp
[Re: eternalsun]
|
new poster
Registered: 11/01/2002
Posts: 21
Loc: Bay Area
|
IMHO a relatively cleaner hack (from a software engineering point of view, and also security-wise) is to have an in-kernel web server serving static content, and to have configuration file(s) in /proc that can tell this kernel server to pass requests for dynamic data to a user-space daemon.
For example, khttpd can run on port 80, and a PHP (or whatever else) enabled web server, say Apache, on port 8080. We tell khttpd to pass on cgi-bin and PHP related requests to Apache. Indeed, the latest khttpd in the Linux kernel works this way.
Regards
Amit
|
Top
|
|
|
|
#61787 - 24/01/2002 07:36
Re: PHP and khttp
[Re: amit]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14496
Loc: Canada
|
For strict security, it's gotta be best to have a userland web server handling ALL content. Placing static handling into the kernel adds risk, but can speed things up considerably.
Some background for late-joiners:
The Hijack khttpd is not at all related to the standard Linux khttpd, and serves a different purpose and audience (Empeg owners!). One major difference is that Hijack can provide directory listings, whereas the standard one passes such requests on to userland.
Cheers
|
Top
|
|
|
|
|
|