You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Joakim Bomelin <jo...@bomelin.com> on 2002/07/02 17:41:42 UTC

Apache module using Xalan

Since nobody seems to be able to give me an answer I put togheter some code 
which I compiled with gcc -o xala_test xalan_test.c -lxalan-c1_3, and it 
worked. I used both XalanTransformToHandler and XalanTransformToFile, and it 
all worked.

So I took the same code and put it together as an apachemodule (I based it on 
the code coming out of apxs -g -n foo), and it started causing Apache to 
segfault. I tried to hard code the filenames, using files in a directory which 
was chmodded 777, in case some trouble with privileges was the problem, but 
that didn't help.

I clearly was misstaking when I thought that Xalan being an Apache product 
would work good together with the httpd.

I still haven't got the ApacheModuleXSLT in samples/ to work, either.

It is of great importance to me that I produce a working set up with Apache 
handling the XML transformation, and not as a CGI. Could anyone at least try to 
help me, please?

/Joakim


Quoting Joakim Bomelin <jo...@bomelin.com>:
> 
> So I got the module runnig after some hacking. But when I request foo.html
> the 
> Apache child segfaults. When I comment out error =
> XalanTransformToHandler(...) 
> and call xalan_output_handler and xalan_flush_handler manually from
> xsl_handler 
> everything is allright. I have checked so that the request_rec i correctly 
> bypassed to the handlers and everything, but no matter what I do call to 
> XalanTransformToHandler keeps generating a segfault. I took the exact same
> code 
> and transformed it into a good old executable, and it worked... so I have no
> 
> idea what to do. gdb:ing httpd didn't help me, either...
> 
> Anyone?
> 
> /Joakim
> 
> Quoting Joakim Bomelin <jo...@bomelin.com>:
> > 
> > Hi.
> > I tried to compile ApacheModuleXSLT using the Makefile in Xalan, but that
> 
> > didn't work out. So I used apxs -i -a -c mod_xslt.c -lxalan-c1_3, which
> > worked 
> > out OK.
> > 
> > According to http://xml.apache.org/xalan-c/samples.html#apachemodulexslt
> I
> > put 
> > AddModule mod_xslt.c and LoadModule xslt_module mod_xslt.so in my
> httpd.conf,
> > 
> > and I get "Cannot add module via name 'mod_xslt.c': not in list of loaded
> 
> > modules". If I use only LoadModule xslt_module mod_xslt.so Apache starts
> up
> > OK, 
> > so I carry on with adding
> > <Location /xslt/>
> >   AddHandler xslt_module .html
> > </Location>
> > to my VirtualHost in httpd.conf. When I point my browser to 
> > http://mecka1.pennans.net/xslt/foo.html I get a 404 (see log-entry below),
> 
> > allthough both foo.xml and foo.xsl resides in xslt/ in the document root.
> > 
> > [Sun Jun 30 14:45:48 2002] [notice] Apache/1.3.19 (Unix)
> mod_xslt/Xalan/1.0
> > 
> > PHP/4.0.4pl1 mod_perl/1.25 configured -- resuming normal operations
> > [Sun Jun 30 14:45:48 2002] [notice] suEXEC mechanism enabled 
> > (wrapper: /usr/local/apache/bin/suexec)
> > [Sun Jun 30 14:47:15 2002] [error] [client 10.0.0.15] File does not 
> > exist: /home/www/mecka1.pennans.net/xslt/foo.html
> > 
> > What can I do to fix this?
> > I use Apache 1.3.19, Slackware 7.1 and Linux 2.2.16 (old stuff, I know
> :))
> > 
> > /Joakim
> > 
> 
> 
> 



Re: Apache module using Xalan

Posted by Nouguier Olivier <ol...@wanadoo.fr>.
hi all,

	I'm really not an expert in c or xalan, but I had segfault when I
compile my module and apache were compiled with different version of gcc
( 2 vs 3 ).

Hope it helps
Le mar 02/07/2002 à 17:41, Joakim Bomelin a écrit :
> 
> Since nobody seems to be able to give me an answer I put togheter some code 
> which I compiled with gcc -o xala_test xalan_test.c -lxalan-c1_3, and it 
> worked. I used both XalanTransformToHandler and XalanTransformToFile, and it 
> all worked.
> 
> So I took the same code and put it together as an apachemodule (I based it on 
> the code coming out of apxs -g -n foo), and it started causing Apache to 
> segfault. I tried to hard code the filenames, using files in a directory which 
> was chmodded 777, in case some trouble with privileges was the problem, but 
> that didn't help.
> 
> I clearly was misstaking when I thought that Xalan being an Apache product 
> would work good together with the httpd.
> 
> I still haven't got the ApacheModuleXSLT in samples/ to work, either.
> 
> It is of great importance to me that I produce a working set up with Apache 
> handling the XML transformation, and not as a CGI. Could anyone at least try to 
> help me, please?
> 
> /Joakim
> 
> 
> Quoting Joakim Bomelin <jo...@bomelin.com>:
> > 
> > So I got the module runnig after some hacking. But when I request foo.html
> > the 
> > Apache child segfaults. When I comment out error =
> > XalanTransformToHandler(...) 
> > and call xalan_output_handler and xalan_flush_handler manually from
> > xsl_handler 
> > everything is allright. I have checked so that the request_rec i correctly 
> > bypassed to the handlers and everything, but no matter what I do call to 
> > XalanTransformToHandler keeps generating a segfault. I took the exact same
> > code 
> > and transformed it into a good old executable, and it worked... so I have no
> > 
> > idea what to do. gdb:ing httpd didn't help me, either...
> > 
> > Anyone?
> > 
> > /Joakim
> > 
> > Quoting Joakim Bomelin <jo...@bomelin.com>:
> > > 
> > > Hi.
> > > I tried to compile ApacheModuleXSLT using the Makefile in Xalan, but that
> > 
> > > didn't work out. So I used apxs -i -a -c mod_xslt.c -lxalan-c1_3, which
> > > worked 
> > > out OK.
> > > 
> > > According to http://xml.apache.org/xalan-c/samples.html#apachemodulexslt
> > I
> > > put 
> > > AddModule mod_xslt.c and LoadModule xslt_module mod_xslt.so in my
> > httpd.conf,
> > > 
> > > and I get "Cannot add module via name 'mod_xslt.c': not in list of loaded
> > 
> > > modules". If I use only LoadModule xslt_module mod_xslt.so Apache starts
> > up
> > > OK, 
> > > so I carry on with adding
> > > <Location /xslt/>
> > >   AddHandler xslt_module .html
> > > </Location>
> > > to my VirtualHost in httpd.conf. When I point my browser to 
> > > http://mecka1.pennans.net/xslt/foo.html I get a 404 (see log-entry below),
> > 
> > > allthough both foo.xml and foo.xsl resides in xslt/ in the document root.
> > > 
> > > [Sun Jun 30 14:45:48 2002] [notice] Apache/1.3.19 (Unix)
> > mod_xslt/Xalan/1.0
> > > 
> > > PHP/4.0.4pl1 mod_perl/1.25 configured -- resuming normal operations
> > > [Sun Jun 30 14:45:48 2002] [notice] suEXEC mechanism enabled 
> > > (wrapper: /usr/local/apache/bin/suexec)
> > > [Sun Jun 30 14:47:15 2002] [error] [client 10.0.0.15] File does not 
> > > exist: /home/www/mecka1.pennans.net/xslt/foo.html
> > > 
> > > What can I do to fix this?
> > > I use Apache 1.3.19, Slackware 7.1 and Linux 2.2.16 (old stuff, I know
> > :))
> > > 
> > > /Joakim
> > > 
> > 
> > 
> > 
> 
> 
-- 
My mother always used to tell me, "The early bird gets the worm."
The message seemed pretty clear to me: If you sleep late, you're
a lot less likely to be killed by a bird.
-- Elliott Downing