[Modcplusplus-user] Re: It works.
Brought to you by:
gr84b8,
johnksterling
From: <gra...@ax...> - 2005-03-31 12:36:18
|
Thank you. With the change suggested by you it works, finally. An only for HTM and HTML extensions. 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 AddCppHandler test_handler PassCPPVar test_handler axf </Directory> But the PassCPPVar has no effect on its behaviour. I would like that the handler to be called only for axf extensions. By the way, do you know the project PAS [http://pas.sourceforge.net/] ? I intend to implement something like that using mod_cplusplus. László John Sterling wrote: > Hi Graf - > > Glad to hear the install problems are resolved. The problem below is > probably configuration related - in your directory block you have > 'AddHandler test_handler' - it should be AddCppHandler test_handler. > The AddCppHandler, however, doesn't support only calling if for certain > extensions. To solve that you can use PassCPPVar to tell your module > the extensions that it should handle, and have it return DECLINED for > all others. > > Let me know if you have any more questions or problems - or if you have > suggestions. I'm happy to extend the features if you have some good ideas. > > John > > On Mar 31, 2005, at 3:46 AM, Graf László 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 >> mod_cplusplus handler."); >> } >> >> TestHandler::~TestHandler(void) { >> ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "destroying a >> mod_cplusplus handler."); >> } >> >> int TestHandler::handler(ApacheRequestRec *pRequest) >> { >> ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "handling, handling, >> handling."); >> pRequest->rprintf("\nThis handler is called for user %s", >> pRequest->user()); >> pRequest->rputs("\nLets Dump The Request!\n"); >> pRequest->dump(); >> return OK; >> } >> >> ApacheHandler *instanciate_test() >> { >> return new TestHandler(); >> } >> >> cpp_factory_t test_handler = { >> instanciate_test, >> NULL, >> NULL, >> NULL, >> }; >> >> My httpd.conf contains these lines: >> >> LoadModule cplusplus_module >> /usr/local/apache2/modules/libmod_cplusplus.so >> >> and I defined the followings: >> >> LoadCPPHandler test_handler /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 mark-up. >> >> When I point my browser to http://host/cppt/index.axf it asks me to >> download or save the file. >> Second, none of the operations "ap_log_error" works. >> >> -- >> Graf László >> >> \\|// >> (O-O) >> --oOO--(_)--OOo--- >> --------------------------- >> 100% újrahasznosított bitek >> > -- Graf László \\|// (O-O) --oOO--(_)--OOo--- --------------------------- 100% újrahasznosított bitek |