Look at the host name. It will at times include :portnumber - perhaps any time it's not the defaulot 80. -- Ray B. Morris supp...@bettercgi.com
On 01/18/2009 01:36:14 PM, wolfgang wrote: > Hi there, > > I can not get a port number if my apache module is set in the main > server config and listen port is set to 10080. > ( "the main server config" means other than virtual host configs. ) > > When my apache module is set in the main server config as follows and > a client requests "http://www.example.com:10080". > > In httpd.conf, > ... > Listen 10080 > <Location "/"> > SetHandler mymodule > </Location> > .... > > Then, in mymodule I get the following results. > > request_rec->server->is_virtual is 0. > ap_get_server_port(request_rec)" is 80. <----- 80 !? why not > 10080 ?? > request_rec->server->port is 0. <----- ZERO !? > hm... > request_rec->server->addrs->host_port is 0. <----- ZERO... Sure, my > module is not in a virtual host. > > But if I set the module in a virtual host config as follows and a > client requests "http://www.example.com:10080" > > In httpd.conf, > ... > Listen 10080 > NameVirtualHost *:10080 > <VirtualHost *:10080> > ServerName www.example.com > DocumentRoot "htdocs" > ... > <Location "/"> > SetHandler mymodule > </Location> > </VirtualHost> > > Then, in mymodule I get the following results. > > request_rec->server->is_virtual is 1. > ap_get_server_port(request_rec)" is 80. > request_rec->server->port is 0. > request_rec->server->addrs->host_port is 10080. <--- GOTCHA ! > > How can I get the port number when my apache module is set in the > main > server config ?? > > The version of my apache is 2.2.11 with mod_ssl but EAPI is not > enabled. > > > Regards, > > wolfgang > >