| Author | 
  | 
samapache
 
 
  Joined: 18 Nov 2010 Posts: 7
 
  | 
 Posted: Mon 29 Nov '10 0:25    Post subject: How to Run mod_example on Windows XP machine | 
     | 
 
  | 
 
Hi,
 
I am working on the windows XP machine and installed Apache 2.2. I have also httpd-2.2.17 srs. I was able to compile mod_example and create mod_example.so file(through my post @ http://www.apachelounge.com/viewtopic.php?p=16879#16879 )
 
 
But I am unable to run this module. I have copied the so file in the C:\Apache2.2\modules directory and added:
 
 
LoadModule example_module modules/mod_example.so in the httpd.conf at C:\Apache2.2\conf and restarted the server. When I type:
 
http://localhost/example_handler in the browser i get HTTP 404 not found.
 
 
Please let me know how to run the example.
 
 
Thanks
 
sam | 
 
  | 
| Back to top | 
 | 
glsmith Moderator
  
  Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
  | 
 Posted: Mon 29 Nov '10 10:44    Post subject:  | 
     | 
 
  | 
 
| did you check your error log? What does it say about the 404? | 
 
  | 
| Back to top | 
 | 
samapache
 
 
  Joined: 18 Nov 2010 Posts: 7
 
  | 
 Posted: Thu 02 Dec '10 0:49    Post subject: Compiled and running | 
     | 
 
  | 
 
Hi,
 
Thanks for all your help. Its running now:
 
 
I did follloing in the httpd.conf file:
 
 
LoadModule example_module modules/mod_example.so
 
.
 
.
 
.
 
.
 
<Location /example-info>
 
SetHandler example-handler
 
</Location> 
 
 
Please make me understand:
 
There is a code in the example:
 
.
 
static int x_handler(request_rec *r)
 
{
 
    x_cfg *dcfg;
 
 
    if (strcmp(r->handler, "example-handler")) {
 
        return DECLINED;
 
    }
 
.
 
But this seems to be only comparing not assigning the module name. From where apache picked "example-handler" name?
 
 
thanks
 
sam | 
 
  | 
| Back to top | 
 | 
glsmith Moderator
  
  Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
  | 
 Posted: Thu 02 Dec '10 20:16    Post subject:  | 
     | 
 
  | 
 
Hi sam,
 
 
At this point in time I cannot help you to understand that. It does seem odd but I would need to study the context behind it.
 
I am glad you got it working however! | 
 
  | 
| Back to top | 
 | 
samapache
 
 
  Joined: 18 Nov 2010 Posts: 7
 
  | 
 Posted: Wed 08 Dec '10 2:53    Post subject: Debugging the mod_example | 
     | 
 
  | 
 
Hi,
 
As now my module is running, to understand it I need to debug it. 
 
 
1. Anyone has done module debugging in Apache on windows(VC++)?
 
2. I compiled the module through command prompt as I was not able to compile through VC2008. Please let me know how to compile if we need VC++ for debugging.
 
 
My other requirement it: Writing Apache modules in C++. Has anyone written modules in C++?
 
 
Please note: I have not compiled Apache server and i am running downloaded server binary only. Please let me know in order to debug my written modules
 
 
thanks
 
sam | 
 
  | 
| Back to top | 
 |