[Modcplusplus-user] Re: It works.
Brought to you by:
gr84b8,
johnksterling
From: John S. <jo...@st...> - 2005-03-31 12:14:34
|
Hi Graf - Glad to hear the install problems are resolved. The problem below is=20 probably configuration related - in your directory block you have=20 'AddHandler test_handler' - it should be AddCppHandler test_handler. =20 The AddCppHandler, however, doesn't support only calling if for certain=20= extensions. To solve that you can use PassCPPVar to tell your module=20 the extensions that it should handle, and have it return DECLINED for=20 all others. Let me know if you have any more questions or problems - or if you have=20= suggestions. I'm happy to extend the features if you have some good=20 ideas. John On Mar 31, 2005, at 3:46 AM, Graf L=E1szl=F3 wrote: > Hi John, > > The installation of the latest version (1.5.1) was succesful. > But still I have some questions. > > My cpp file looks like this: > > #include "apache_handler.h" > > class TestHandler : public ApacheHandler > { > public: > TestHandler(void); > ~TestHandler(void); > int handler(ApacheRequestRec *pRequest); > }; > > TestHandler::TestHandler(void) { > ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "constructing a=20 > mod_cplusplus handler."); > } > > TestHandler::~TestHandler(void) { > ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "destroying a=20 > mod_cplusplus handler."); > } > > int TestHandler::handler(ApacheRequestRec *pRequest) > { > ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "handling, handling,=20= > handling."); > pRequest->rprintf("\nThis handler is called for user %s",=20 > pRequest->user()); > pRequest->rputs("\nLets Dump The Request!\n"); > pRequest->dump(); > return OK; > } > > ApacheHandler *instanciate_test() > { > return new TestHandler(); > } > > cpp_factory_t test_handler =3D { > instanciate_test, > NULL, > NULL, > NULL, > }; > > My httpd.conf contains these lines: > > LoadModule cplusplus_module=20 > /usr/local/apache2/modules/libmod_cplusplus.so > > and I defined the followings: > > LoadCPPHandler test_handler =20 > /usr/local/apache2/modules/test_handler.so > > Alias /cppt/ "/home/grafl/c_cpp/mod_apache2/mod_cpp_test/" > <Directory "/home/grafl/c_cpp/mod_apache2/mod_cpp_test"> > AllowOverride None > Options Indexes FollowSymLinks > Order allow,deny > Allow from all > AddHandler test_handler .axf > </Directory> > > In this folder I have an index.axf file which contains only HTML=20 > mark-up. > > When I point my browser to http://host/cppt/index.axf it asks me to=20 > download or save the file. > Second, none of the operations "ap_log_error" works. > > --=20 > Graf L=E1szl=F3 > > \\|// > (O-O) > --oOO--(_)--OOo--- > --------------------------- > 100% =FAjrahasznos=EDtott bitek > |