|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
wrong port number in makeurlHi Rivetters
I'm dealing with a perhaps lesser, but rather annoying problem. I'm running a development website on an apache2 instance tied to the port 8080. The website uses an error handler tied to the 404 error code in order to intercept some old urls and remap them to the new pages via the http protocol and the 'header redirect' command. This works on the server running on the default port (80) but fails when the webserver runs on the port 8080 because the environment of the error handler retains 80 as port number. I checked this out by shutting down the regular apache server on the port 80 to avoid possible interferences and logging the other server's environment into the error log (load_env ENV; puts stderr $ENV(SERVER_PORT)) As a consequence the command 'makeurl' (a quite simple wrapper of ap_construct_url) builds a wrong url and the requests are redirected to the wrong webserver. 'ap_construct_url' code is very simple too and left me clueless about the reason for this. I googled this problem but found out nothing. any idea? Is the core mishandling the error? -- Massimo P.S. I also noticed that, after works on the server this list has been renamed as rivet-cvs. David, should we signal this to the infrastructure? --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscribe@... For additional commands, e-mail: rivet-dev-help@... |
|
|
Re: wrong port number in makeurl> I'm running a development website on an apache2
> instance tied to the port 8080. The website uses an error handler > tied to the 404 error code in order to intercept some old urls > and remap them to the new pages via the http protocol and > the 'header redirect' command. This works on the server Why not use mod_rewrite for this? Or even plain old mod_alias. For instance: <Directory /www/dedasys.com/dedasys> Redirect permanent /articles http://www.welton.it/articles Redirect permanent /davidw http://www.welton.it/davidw Redirect permanent /freesoftware http://www.welton.it/freesoftware > running on the default port (80) but fails when the webserver > runs on the port 8080 because the environment > of the error handler retains 80 as port number. > I checked this out by shutting down the regular apache > server on the port 80 to avoid possible interferences > and logging the other server's environment into the error > log (load_env ENV; puts stderr $ENV(SERVER_PORT)) > As a consequence the command 'makeurl' (a quite simple > wrapper of ap_construct_url) builds a wrong url and the > requests are redirected to the wrong webserver. 'ap_construct_url' > code is very simple too and left me clueless about the > reason for this. I googled this problem but found out nothing. > any idea? Is the core mishandling the error? Seems weird... Can you create a test case for it? > -- Massimo > > P.S. I also noticed that, after works on the server this list > has been renamed as rivet-cvs. David, should we signal this to > the infrastructure? Looks like rivet-dev here. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscribe@... For additional commands, e-mail: rivet-dev-help@... |
|
|
Re: wrong port number in makeurlOn Thu, 5 Feb 2009 22:45:52 +0100, David Welton wrote
> > I'm running a development website on an apache2 > > instance tied to the port 8080. The website uses an error handler > > tied to the 404 error code in order to intercept some old urls > > and remap them to the new pages via the http protocol and > > the 'header redirect' command. This works on the server > > Why not use mod_rewrite for this? Or even plain old mod_alias. For > instance: > > <Directory /www/dedasys.com/dedasys> > Redirect permanent /articles > http://www.welton.it/articles Redirect permanent /davidw > Redirect permanent /freesoftware http://www.welton.it/freesoftware > The aliases are in a database. I have some plan to extend this mechanism to some dynamical content on the website. I don't have experience with mod_rewrite, would it help with a database? > > As a consequence the command 'makeurl' (a quite simple > > wrapper of ap_construct_url) builds a wrong url and the > > requests are redirected to the wrong webserver. 'ap_construct_url' > > code is very simple too and left me clueless about the > > reason for this. I googled this problem but found out nothing. > > > any idea? Is the core mishandling the error? > > Seems weird... Can you create a test case for it? It is. Do you want me to add a new test in the test suite? Actually it should be simple: change the port of your apache server, add the line ErrorDocument 404 /errorscript.tcl errorscript.tcl loads the environment and logs its variables somehere. Run your browser and peek some page that doesn't exist. I still have to test it outside of a VirtualHost definition, that's a degree of freedom i haven't tested yet. Anyway apache is supposed to put the right port even in the case of a Virtual Host. > > > > > P.S. I also noticed that, after works on the server this list > > has been renamed as rivet-cvs. David, should we signal this to > > the infrastructure? > > Looks like rivet-dev here. > same for me now, but I swear, before i sent my message the list webpages had 'cvs' where 'dev' used to be. -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscribe@... For additional commands, e-mail: rivet-dev-help@... |
|
|
Re: wrong port number in makeurl>> Why not use mod_rewrite for this? Or even plain old mod_alias. For
>> instance: >> >> <Directory /www/dedasys.com/dedasys> >> Redirect permanent /articles >> http://www.welton.it/articles Redirect permanent /davidw > http://www.welton.it/davidw >> Redirect permanent /freesoftware http://www.welton.it/freesoftware > The aliases are in a database. I have some plan to extend this > mechanism to some dynamical content on the website. > I don't have experience with mod_rewrite, would it help with > a database? Hrm, yeah, in that case it might be trickier. Using the 404 handler, though, is sort of abusing the system, though:-) One thing you could do is something like this: Rewrite /foo/.* to /foo.tcl?realpath, with mod_rewrite, and then have foo.tcl manage the actual lookups. >> > As a consequence the command 'makeurl' (a quite simple >> > wrapper of ap_construct_url) builds a wrong url and the >> > requests are redirected to the wrong webserver. 'ap_construct_url' >> > code is very simple too and left me clueless about the >> > reason for this. I googled this problem but found out nothing. >> >> > any idea? Is the core mishandling the error? >> >> Seems weird... Can you create a test case for it? > > It is. Do you want me to add a new test in the test suite? Yes please! > Actually it should be simple: change the port of your apache > server, add the line > I still have to test it outside of a VirtualHost > definition, that's a degree of freedom i haven't tested yet. > Anyway apache is supposed to put the right port even in the > case of a Virtual Host. It is. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscribe@... For additional commands, e-mail: rivet-dev-help@... |
| Free embeddable forum powered by Nabble | Forum Help |