You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Da...@netscape.net on 2000/06/20 21:30:27 UTC

Protcol modules and virtual hosting

As mentioned in a previous email, I have written a module to speak a different protocol than HTTP based on the Apache 2.0 echo module. Following a suggestion from the list, I am trying to listen on a different port for my protocol than HTTP, and want to do this with port-based virtual hosting. Like the echo module, I didn't define a merge_server_config(), which from what I read should cause the VirtualHost arguments to win out. I couldn't get it to work properly (it ignored my turning the module "on" if it was in the virtualserver block), so I went back to the stock 2.0a4 code and the echo module and hit the same problem. I saw a few bug reports about VirtualHost problems, but none seem quite the same -- I'm not sure if I am doing something wrong in my config file (quite possible) or if this is a real problem. The server config I tried is:

User webuser
Group webgroup
Listen 127.0.0.1:5100
Listen 127.0.0.1:80
LockFile /var/run/apache-lock 
ScriptAlias /cgi-bin /usr/scratch/apache/www/cgi-bin
DocumentRoot /usr/scratch/apache/www/htdocs/


<VirtualHost 127.0.0.1:5100>
ErrorLog /usr/scratch/apache/www/logs/error_log2
TransferLog /usr/scratch/apache/www/logs/trans_log2
ProtocolEcho yes
</VirtualHost>

If I move the line "ProtocolEcho yes" out of the VirtualHost block then both ports have echo, in the block, neither does.

Thanks!

David Bryan

----------
Get your own FREE, personal Netscape Webmail account today at http://home.netscape.com/webmail/

Re: Protcol modules and virtual hosting

Posted by Ben Laurie <be...@algroup.co.uk>.
rbb@covalent.net wrote:
> 
> On Tue, 4 Jul 2000, Ben Laurie wrote:
> 
> > rbb@covalent.net wrote:
> > >
> > > I do not believe that Apache 2.0 currently allows different protocol
> > > modules on different virtual hosts.  Nobody has really tried this, so it
> > > hasn't been implemented.  :-)
> >
> > Errr ... yes they have! That was the whole bleedin' point. I suspect
> > David's problem was that the merging of "ProtocolEcho" is not as
> > expected - he needs to declare _two_ VirtualHost blocks, so that
> > ProtocolEcho is not inherited from the main server. At least, I think
> > so!
> 
> I have two different reports of this not working, so I would bet that
> somebody broke this at some point.  either that, or we need to document
> how to make it work better.  :-)

OK, I'll take a look at it some time. Soon, I hope.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

Coming to ApacheCon Europe 2000? http://apachecon.com/

Re: Protcol modules and virtual hosting

Posted by rb...@covalent.net.
On Tue, 4 Jul 2000, Ben Laurie wrote:

> rbb@covalent.net wrote:
> > 
> > I do not believe that Apache 2.0 currently allows different protocol
> > modules on different virtual hosts.  Nobody has really tried this, so it
> > hasn't been implemented.  :-)
> 
> Errr ... yes they have! That was the whole bleedin' point. I suspect
> David's problem was that the merging of "ProtocolEcho" is not as
> expected - he needs to declare _two_ VirtualHost blocks, so that
> ProtocolEcho is not inherited from the main server. At least, I think
> so!

I have two different reports of this not working, so I would bet that
somebody broke this at some point.  either that, or we need to document
how to make it work better.  :-)

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: Protcol modules and virtual hosting

Posted by Ben Laurie <be...@algroup.co.uk>.
rbb@covalent.net wrote:
> 
> I do not believe that Apache 2.0 currently allows different protocol
> modules on different virtual hosts.  Nobody has really tried this, so it
> hasn't been implemented.  :-)

Errr ... yes they have! That was the whole bleedin' point. I suspect
David's problem was that the merging of "ProtocolEcho" is not as
expected - he needs to declare _two_ VirtualHost blocks, so that
ProtocolEcho is not inherited from the main server. At least, I think
so!

Cheers,

Ben.

> 
> Ryan
> 
> On Tue, 20 Jun 2000 DavidABryan@netscape.net wrote:
> 
> > As mentioned in a previous email, I have written a module to speak a different protocol than HTTP based on the Apache 2.0 echo module. Following a suggestion from the list, I am trying to listen on a different port for my protocol than HTTP, and want to do this with port-based virtual hosting. Like the echo module, I didn't define a merge_server_config(), which from what I read should cause the VirtualHost arguments to win out. I couldn't get it to work properly (it ignored my turning the module "on" if it was in the virtualserver block), so I went back to the stock 2.0a4 code and the echo module and hit the same problem. I saw a few bug reports about VirtualHost problems, but none seem quite the same -- I'm not sure if I am doing something wrong in my config file (quite possible) or if this is a real problem. The server config I tried is:
> >
> > User webuser
> > Group webgroup
> > Listen 127.0.0.1:5100
> > Listen 127.0.0.1:80
> > LockFile /var/run/apache-lock
> > ScriptAlias /cgi-bin /usr/scratch/apache/www/cgi-bin
> > DocumentRoot /usr/scratch/apache/www/htdocs/
> >
> >
> > <VirtualHost 127.0.0.1:5100>
> > ErrorLog /usr/scratch/apache/www/logs/error_log2
> > TransferLog /usr/scratch/apache/www/logs/trans_log2
> > ProtocolEcho yes
> > </VirtualHost>
> >
> > If I move the line "ProtocolEcho yes" out of the VirtualHost block then both ports have echo, in the block, neither does.
> >
> > Thanks!
> >
> > David Bryan
> >
> > ----------
> > Get your own FREE, personal Netscape Webmail account today at http://home.netscape.com/webmail/
> >
> 
> _______________________________________________________________________________
> Ryan Bloom                              rbb@apache.org
> 406 29th St.
> San Francisco, CA 94131
> -------------------------------------------------------------------------------

--
http://www.apache-ssl.org/ben.html

Coming to ApacheCon Europe 2000? http://apachecon.com/

Re: Protcol modules and virtual hosting

Posted by Da...@netscape.net.
new-httpd@apache.org wrote:

Thanks! Sure, I'll be more than happy to try to make a list -- mostly 
things like getting some of the information stored in the request object
in a clean way (server port, server name, remote_host) and things like
getting permission of a file (for example, is a file executable?) that in
mod_cgi.c are obtained using information set inside the core, but I'll
try to make up a list. 

I understand I am shooting at a moving target here, but I figured input 
into how things went with a protocol module in the early stages couldn't
hurt. 

    --David Bryan

> <snipped comments>
> 
> I'll look into the stuff I snipped out sometime next week probably
> 
> > BTW, the protocol module I am making is basically done and the structure 
> > provided makes them pretty easy to write -- good job! I had a bit of a
> > learning curve and few trial and error things, but other than the fact that
> > many of the useful API calls wanted a request object (which seems a rather
> > HTTP specific structure) requiring me to rip out their internals and 
> > duplicate them in my module, it worked well. If the UDP support mentioned 
> > for WAP gets in there, and some new API calls for useful calls that don't
> > need request_objects, new protocols should start multiplying :)
> 
> Is there any chance you could list some of the "useful" API's that are
> requiring request_rec's?  I suspect some of those API's shouldn't be used
> in non-http servers, because they are http specific.  I also suspect that
> some of them need to be abstracted a bit to make them more useful.
> 
> To be honest, I do not see much work being done in the way of making it
> easy for new protocol modules to be written until 2.0 at least reaches
> beta.  Of course, if somebody else does the work, then cool.  But, most of
> us are interested in getting the web server stable before we start
> tackling the other problems with the design of a generic server framework.
> 
> Ryan
> 
> _______________________________________________________________________________
> Ryan Bloom                          rbb@apache.org
> 406 29th St.
> San Francisco, CA 94131
> -------------------------------------------------------------------------------
> 
> 

----------
Get your own FREE, personal Netscape Webmail account today at http://home.netscape.com/webmail/

Re: Protcol modules and virtual hosting

Posted by rb...@covalent.net.
<snipped comments>

I'll look into the stuff I snipped out sometime next week probably

> BTW, the protocol module I am making is basically done and the structure 
> provided makes them pretty easy to write -- good job! I had a bit of a
> learning curve and few trial and error things, but other than the fact that
> many of the useful API calls wanted a request object (which seems a rather
> HTTP specific structure) requiring me to rip out their internals and 
> duplicate them in my module, it worked well. If the UDP support mentioned 
> for WAP gets in there, and some new API calls for useful calls that don't
> need request_objects, new protocols should start multiplying :)

Is there any chance you could list some of the "useful" API's that are
requiring request_rec's?  I suspect some of those API's shouldn't be used
in non-http servers, because they are http specific.  I also suspect that
some of them need to be abstracted a bit to make them more useful.

To be honest, I do not see much work being done in the way of making it
easy for new protocol modules to be written until 2.0 at least reaches
beta.  Of course, if somebody else does the work, then cool.  But, most of
us are interested in getting the web server stable before we start
tackling the other problems with the design of a generic server framework.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: Protcol modules and virtual hosting

Posted by Da...@netscape.net.
I don't see how this is any different than any other module. The module
config has a flag called bEnabled in the case of mod_echo, and if it is
1 it runs, if 0 it returns DECLINED. The module config structure controls 
this, no differently than any other module. Has anybody gotten port based
virtual hosting working for other modules?

The weird thing is when you trace the program, create_echo_server_config 
gets called twice, creating the configuration with the module turned off
twice, then echo_on gets called once, turning it on for the second config,
which is just what you would expect. Then, it gets strange. Two MORE config
are created, and echo_on is called on the fourth (so we have 4 config 
structures, the second and fourth set to bEnable, the other two not). If
you trace incoming connections, they all get passed the third structure 
created, which has echo off. This doesn't really look like a protocol 
module specific problem -- either a bug or I am just using a bad config
file.

BTW, the protocol module I am making is basically done and the structure 
provided makes them pretty easy to write -- good job! I had a bit of a
learning curve and few trial and error things, but other than the fact that
many of the useful API calls wanted a request object (which seems a rather
HTTP specific structure) requiring me to rip out their internals and 
duplicate them in my module, it worked well. If the UDP support mentioned 
for WAP gets in there, and some new API calls for useful calls that don't
need request_objects, new protocols should start multiplying :)

    Thanks for any help!

    David Bryan

new-httpd@apache.org wrote:
>
> 
> I do not believe that Apache 2.0 currently allows different protocol
> modules on different virtual hosts.  Nobody has really tried this, so it
> hasn't been implemented.  :-)
> 
> Ryan
> 
> On Tue, 20 Jun 2000 DavidABryan@netscape.net wrote:
> 
> > As mentioned in a previous email, I have written a module to speak a different protocol than HTTP based on the Apache 2.0 echo module. Following a suggestion from the list, I am trying to listen on a different port for my protocol than HTTP, and want to do this with port-based virtual hosting. Like the echo module, I didn't define a merge_server_config(), which from what I read should cause the VirtualHost arguments to win out. I couldn't get it to work properly (it ignored my turning the module "on" if it was in the virtualserver block), so I went back to the stock 2.0a4 code and the echo module and hit the same problem. I saw a few bug reports about VirtualHost problems, but none seem quite the same -- I'm not sure if I am doing something wrong in my config file (quite possible) or if this is a real problem. The server config I tried is:
> > 
> > User webuser
> > Group webgroup
> > Listen 127.0.0.1:5100
> > Listen 127.0.0.1:80
> > LockFile /var/run/apache-lock 
> > ScriptAlias /cgi-bin /usr/scratch/apache/www/cgi-bin
> > DocumentRoot /usr/scratch/apache/www/htdocs/
> > 
> > 
> > <VirtualHost 127.0.0.1:5100>
> > ErrorLog /usr/scratch/apache/www/logs/error_log2
> > TransferLog /usr/scratch/apache/www/logs/trans_log2
> > ProtocolEcho yes
> > </VirtualHost>
> > 
> > If I move the line "ProtocolEcho yes" out of the VirtualHost block then both ports have echo, in the block, neither does.
> > 
> > Thanks!
> > 
> > David Bryan
> > 
> > ----------
> > Get your own FREE, personal Netscape Webmail account today at http://home.netscape.com/webmail/
> > 
> 
> 
> _______________________________________________________________________________
> Ryan Bloom                          rbb@apache.org
> 406 29th St.
> San Francisco, CA 94131
> -------------------------------------------------------------------------------
> 
> 

----------
Get your own FREE, personal Netscape Webmail account today at http://home.netscape.com/webmail/

Re: Protcol modules and virtual hosting

Posted by rb...@covalent.net.
I do not believe that Apache 2.0 currently allows different protocol
modules on different virtual hosts.  Nobody has really tried this, so it
hasn't been implemented.  :-)

Ryan

On Tue, 20 Jun 2000 DavidABryan@netscape.net wrote:

> As mentioned in a previous email, I have written a module to speak a different protocol than HTTP based on the Apache 2.0 echo module. Following a suggestion from the list, I am trying to listen on a different port for my protocol than HTTP, and want to do this with port-based virtual hosting. Like the echo module, I didn't define a merge_server_config(), which from what I read should cause the VirtualHost arguments to win out. I couldn't get it to work properly (it ignored my turning the module "on" if it was in the virtualserver block), so I went back to the stock 2.0a4 code and the echo module and hit the same problem. I saw a few bug reports about VirtualHost problems, but none seem quite the same -- I'm not sure if I am doing something wrong in my config file (quite possible) or if this is a real problem. The server config I tried is:
> 
> User webuser
> Group webgroup
> Listen 127.0.0.1:5100
> Listen 127.0.0.1:80
> LockFile /var/run/apache-lock 
> ScriptAlias /cgi-bin /usr/scratch/apache/www/cgi-bin
> DocumentRoot /usr/scratch/apache/www/htdocs/
> 
> 
> <VirtualHost 127.0.0.1:5100>
> ErrorLog /usr/scratch/apache/www/logs/error_log2
> TransferLog /usr/scratch/apache/www/logs/trans_log2
> ProtocolEcho yes
> </VirtualHost>
> 
> If I move the line "ProtocolEcho yes" out of the VirtualHost block then both ports have echo, in the block, neither does.
> 
> Thanks!
> 
> David Bryan
> 
> ----------
> Get your own FREE, personal Netscape Webmail account today at http://home.netscape.com/webmail/
> 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------