You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rob Belics <ro...@charter.net> on 2005/11/04 01:58:44 UTC

[users@httpd] Serving dynamic pages with C

I would like my Apache server to dynamically create and serve some web 
pages using 'C'.  I am not interested in using the default CGI or Perl.  
I have gotten myself turned round and round for weeks on how to do 
this.  I know I need to use the API but I don't understand where 
handlers and modules fit in.

An example of where I am confused.  If a request for index.html comes 
in, would I have AddHandler myhandler .html in httpd.conf and write code 
for 'myhandler' to do this?  Wouldn't 'myhandler' actually be a module?  
Or are modules just a collection of handlers like a library?

I think I might have enough information to know how to write a module if 
I just knew how Apache knew when and where to call my 'whatever' but I 
just need some direction.

Thanks.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Restricting request methods

Posted by Joshua Slive <js...@gmail.com>.
On 11/8/05, Eruch Kapadia <ek...@cisco.com> wrote:
>
> Folks,
>
> I am trying to restrict certain request methods that the apache server can
> accept.  For example i would like to disable TRACE, and DELETE methods.
>
> Please advise how this can be done.

To start with, you are most likely wasting your time.  The TRACE
method is not dangerous, and the DELETE method is probably already
rejected by apache, unless you have mod_dav active and unprotected. 
So you are better off ignoring whatever silly security checklist you
are following.

But anyway, DELETE can be restricted as follows:

<Limit DELETE>
Order Allow,Deny
Deny from all
</Limit>

And TRACE can be disabled with the TraceEnable directive in 1.3.34 or
2.0.55 or later.  In earlier versions, you need mod_rewrite to disable
TRACE as in
http://www.apacheweek.com/issues/03-01-24#news

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Restricting request methods

Posted by Eruch Kapadia <ek...@cisco.com>.
Folks,

I am trying to restrict certain request methods that the apache server can 
accept.  For example i would like to disable TRACE, and DELETE methods.

Please advise how this can be done.

Regards

-- Eruch --

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Joshua Kogut <jm...@gmail.com>.
Cool, I should try that out.

btw:I am not so great, I know *nothing*. Just have lots of opinions.

On 11/4/05, Sean Conner <se...@conman.org> wrote:
>
> It was thus said that the Great Joshua Kogut once stated:
> >
> > Also, what advantages over perl, php, heck, even asp does C have? Many
> of
> > these server-side languages have syntax that is closely related to C.
> > There's a better way to do this, and you would be saving yourself alot
> of
> > time and effort.
>
> Speed (which may not be all that much of an advantage) and size (Perl and
> PHP are both huge). It also doesn't hurt if you have a library to help
> with
> the CGI side of things (and I do---been in constant development since
> 1996).
> It even includes a templating system [1][2]. It's also about 24k of
> compiled code, which today isn't all that large at all.
>
> Of course, it helps to know C when using the code. [4]
>
> -spc (And it's GNU GPLed too! Although the documentation is a bit
> lacking ... )
>
> [1] Well, not quite yet as the code has finally stabalized to a point
> where I can consider adding it to the base library.
>
> [2] It's a simple templating system that has the benefit [3] that it is
> impossible to include program code in the templates.
>
> [3] At least, *I* consider it a benefit.
>
> [4] No buffer overflows that I've been able to find---string and file
> manipuation have been abstracted and it's very rare that I actually
> have to deal with a character buffer directly.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


--
|| jmkogut ||
email: jmkogut@gmail.com
|| Networking: Where all your problems are category 5. ||

Re: [users@httpd] Serving dynamic pages with C

Posted by Joshua Kogut <jm...@gmail.com>.
OP?? What in the world does that have to do with this. (Define: OP)

On 11/4/05, Rob Belics <ro...@charter.net> wrote:
>
> As far as I'm concerned as the OP, this is off topic and I'm not
> interested in hearing more about it.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


--
|| jmkogut ||
email: jmkogut@gmail.com
|| Networking: Where all your problems are category 5. ||

Re: [users@httpd] Serving dynamic pages with C

Posted by Rob Belics <ro...@charter.net>.
As far as I'm concerned as the OP, this is off topic and I'm not 
interested in hearing more about it.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Joshua Kogut <jm...@gmail.com>.
I am not warring, I am just wondering why C?

ALSO, I did not START that php vs perl thread. I dropped the topic and
somebody else picked it back up in a new thread.
I am just an innocent person wanting to know more. So don't blame me for
somebody elses ignoreance. </flame>

On 11/4/05, Nick Kew <ni...@webthing.com> wrote:
>
> On Friday 04 November 2005 15:40, Joshua Kogut wrote:
> > Also, what advantages over perl, php, heck, even asp does C have?
>
> Haven't we had enough language wars here in your php-vs-perl thread?
> Each has its place, and you wouldn't have perl or php - let alone their
> apache bindings - if someone hadn't written them in C.
>
> --
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


--
|| jmkogut ||
email: jmkogut@gmail.com
|| Networking: Where all your problems are category 5. ||

Re: [users@httpd] Serving dynamic pages with C

Posted by Nick Kew <ni...@webthing.com>.
On Friday 04 November 2005 15:40, Joshua Kogut wrote:
> Also, what advantages over perl, php, heck, even asp does C have?

Haven't we had enough language wars here in your php-vs-perl thread?
Each has its place, and you wouldn't have perl or php - let alone their
apache bindings - if someone hadn't written them in C.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Octavian Rasnita <or...@fcc.ro>.
From: "Joshua Kogut" <jm...@gmail.com>

Also, what advantages over perl, php, heck, even asp does C have? Many of
these server-side languages have syntax that is closely related to C.
There's a better way to do this, and you would be saving yourself alot of
time and effort.

A combined idea could be to use the Apache module mod_perl, and there are
more ways of creating modules for mod_perl using the C language.

Teddy


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Joshua Kogut <jm...@gmail.com>.
Also, what advantages over perl, php, heck, even asp does C have? Many of
these server-side languages have syntax that is closely related to C.
There's a better way to do this, and you would be saving yourself alot of
time and effort.

On 11/3/05, Sean Davis <sd...@mail.nih.gov> wrote:
>
>   ----- Original Message -----
> *From:* Joshua Slive <js...@gmail.com>
> *To:* users@httpd.apache.org
> *Sent:* Thursday, November 03, 2005 8:14 PM
> *Subject:* Re: [users@httpd] Serving dynamic pages with C
>
> On 11/3/05, Rob Belics <ro...@charter.net> wrote:
> > I would like my Apache server to dynamically create and serve some web
> > pages using 'C'. I am not interested in using the default CGI or Perl.
>
> Keep in mind that you can use 'C' (as in C language, I suppose you mean)
> to generate HTML. If you respect CGI, then C programs can be used as CGI
> scripts. They can be VERY fast--see http://genome.ucsc.edu as an example
> of set of compiled C-code running a website.
>
> Sean
>



--
|| jmkogut ||
email: jmkogut@gmail.com
|| Networking: Where all your problems are category 5. ||

Re: [users@httpd] Serving dynamic pages with C

Posted by Sean Davis <sd...@mail.nih.gov>.
Re: [users@httpd] Serving dynamic pages with C
  ----- Original Message ----- 
  From: Joshua Slive 
  To: users@httpd.apache.org 
  Sent: Thursday, November 03, 2005 8:14 PM
  Subject: Re: [users@httpd] Serving dynamic pages with C


  On 11/3/05, Rob Belics <ro...@charter.net> wrote: 
  > I would like my Apache server to dynamically create and serve some web 
  > pages using 'C'.  I am not interested in using the default CGI or Perl. 


Keep in mind that you can use 'C' (as in C language, I suppose you mean) to generate HTML.  If you respect CGI, then C programs can be used as CGI scripts.  They can be VERY fast--see http://genome.ucsc.edu as an example of set of compiled C-code running a website.  

Sean

Re: [users@httpd] Serving dynamic pages with C

Posted by Joshua Slive <js...@gmail.com>.
On 11/3/05, Rob Belics <ro...@charter.net> wrote:
> I would like my Apache server to dynamically create and serve some web
> pages using 'C'.  I am not interested in using the default CGI or Perl.
> I have gotten myself turned round and round for weeks on how to do
> this.  I know I need to use the API but I don't understand where
> handlers and modules fit in.
>
> An example of where I am confused.  If a request for index.html comes
> in, would I have AddHandler myhandler .html in httpd.conf and write code
> for 'myhandler' to do this?  Wouldn't 'myhandler' actually be a module?
> Or are modules just a collection of handlers like a library?
>
> I think I might have enough information to know how to write a module if
> I just knew how Apache knew when and where to call my 'whatever' but I
> just need some direction.

Modules are simply bits of code added to apache.  They can contain
handlers, filters, access checkers, or other bits that plug into
request processing.  Writing a module that impliments a handler is not
terribly complicated, but it does require a decent understanding of
the API.  And the documentation is probably a little thin.

I'd start by finding the existing module that most closely resembles
what you want to do, and then work from there.  Documentation is at
http://httpd.apache.org/docs/2.1/developer/
(focus on the external resources, which are more up to date).
There is also a mailing list dedicated to this topic at
http://modules.apache.org/subscribe

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Boysenberry Payne <bo...@humaniteque.com>.
What list is the Apache Modules list, I'll sign up for that one too.
Never hurts to learn new things.

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Nov 5, 2005, at 12:18 PM, Nick Kew wrote:

> On Saturday 05 November 2005 18:14, Boysenberry Payne wrote:
>> I didn't know it was abandoned, sorry.
>> Is there going to be an equivalent?
>
> With a bit of luck there'll be a real book on the subject:-)
>
> On the apache modules list I said "watch this space".  I guess this 
> list
> might just get to hear of relevant news too.
>
> -- 
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Nick Kew <ni...@webthing.com>.
On Saturday 05 November 2005 18:14, Boysenberry Payne wrote:
> I didn't know it was abandoned, sorry.
> Is there going to be an equivalent?

With a bit of luck there'll be a real book on the subject:-)

On the apache modules list I said "watch this space".  I guess this list
might just get to hear of relevant news too.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Boysenberry Payne <bo...@humaniteque.com>.
I didn't know it was abandoned, sorry.
Is there going to be an equivalent?


Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Nov 5, 2005, at 12:10 PM, Nick Kew wrote:

> On Saturday 05 November 2005 18:04, Boysenberry Payne wrote:
>> It probably the best one until this comes out:
>>
>> http://www.amazon.com/exec/obidos/tg/detail/-/1590594436/002-2785792
>> -3636047?v=glance
>
> Good grief!  That one was abandoned a *long* time ago.  Don't say 
> Amazon
> are taking orders on it?
>
> -- 
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Nick Kew <ni...@webthing.com>.
On Saturday 05 November 2005 18:04, Boysenberry Payne wrote:
> It probably the best one until this comes out:
>
> http://www.amazon.com/exec/obidos/tg/detail/-/1590594436/002-2785792
> -3636047?v=glance

Good grief!  That one was abandoned a *long* time ago.  Don't say Amazon
are taking orders on it?

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Boysenberry Payne <bo...@humaniteque.com>.
It probably the best one until this comes out:

http://www.amazon.com/exec/obidos/tg/detail/-/1590594436/002-2785792 
-3636047?v=glance


Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Nov 4, 2005, at 5:02 PM, Nick Kew wrote:

> On Friday 04 November 2005 16:56, Boysenberry Payne wrote:
>> I good book to check out is Writing Apache Modules with Perl and C by
>> O'Reilly.
>
> Well, it's no doubt better than nothing, but it's too old to apply to  
> much
> more than CGI-replacement level development with current apache  
> versions.
>
> -- 
> Nick Kew
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server  
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Nick Kew <ni...@webthing.com>.
On Friday 04 November 2005 16:56, Boysenberry Payne wrote:
> I good book to check out is Writing Apache Modules with Perl and C by
> O'Reilly.

Well, it's no doubt better than nothing, but it's too old to apply to much
more than CGI-replacement level development with current apache versions.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving dynamic pages with C

Posted by Boysenberry Payne <bo...@humaniteque.com>.
I good book to check out is Writing Apache Modules with Perl and C by 
O'Reilly.

http://www.oreilly.com/catalog/wrapmod/desc.html

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Nov 3, 2005, at 6:58 PM, Rob Belics wrote:

> I would like my Apache server to dynamically create and serve some web 
> pages using 'C'.  I am not interested in using the default CGI or 
> Perl.  I have gotten myself turned round and round for weeks on how to 
> do this.  I know I need to use the API but I don't understand where 
> handlers and modules fit in.
>
> An example of where I am confused.  If a request for index.html comes 
> in, would I have AddHandler myhandler .html in httpd.conf and write 
> code for 'myhandler' to do this?  Wouldn't 'myhandler' actually be a 
> module?  Or are modules just a collection of handlers like a library?
>
> I think I might have enough information to know how to write a module 
> if I just knew how Apache knew when and where to call my 'whatever' 
> but I just need some direction.
>
> Thanks.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org