Bluehost.com Web Hosting $6.95

Without result

This is a discussion on Without result within the Windows Web Servers forums, part of the Web Server and Related Forums category; Hi all I am a newbie in apache module writing. Using MSVC++ 6.0 and Apache 1.3.33 on ...


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-03-2005
Laszlo
 
Posts: n/a
Default Without result

Hi all

I am a newbie in apache module writing.
Using MSVC++ 6.0 and Apache 1.3.33 on Windows 2000 Prof I
created the file mod_hello.c (see below) and I did attache
it to a dll project. The build was succesfuly. I made the
necesary changes in httpd.conf:

LoadFile "C:/Program Files/Microsoft Visual
Studio/MyProjects/apache/mod_hello/Debug/mod_hello.dll"

LoadModule hello_module "C:/Program Files/Microsoft Visual
Studio/MyProjects/apache/mod_hello/Debug/mod_hello.dll"

and

Alias /gl/ "C:/Program Files/Apache Group/Apache/htdocs/gl/"
<Directory "C:/Program Files/Apache Group/Apache/htdocs/gl">
SetHandler hello_module
</Directory>

After restarting the Apache server, I did access the site

http://abc/gl/index.html

but without result.

I access.log appears this line:

xxx.xxx.xxx.xxx [03/Jan/2005:13:10:47 +0100] "GET /gl/index.html
HTTP/1.1" 304 -

What is wrong?

Thank you in advance for your reply.
---------------------------------------------------------------
Laszlo Graf

-----------
mod_hello.c

#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
/* file: mod_hello.c */

/* here's the content handler */
static int hello_handler(request_rec *r) {
const char* hostname;
r->content_type = "text/html";
ap_send_http_header(r);
hostname = ap_get_remote_host(r->connection,r->per_dir_config,REMOTE_NAME);
ap_rputs("<HTML>\n" ,r);
ap_rputs("<HEAD>\n" ,r);
ap_rputs("<TITLE>Hello There</TITLE>\n" ,r);
ap_rputs("</HEAD>\n" ,r);
ap_rputs("<BODY>\n" ,r);
ap_rprintf(r,"<H1>Hello %s</H1>\n" ,hostname);
ap_rputs("Who would take this book seriously if the first example
didn't\n",r); ap_rputs("say \"hello world\"?\n" ,r);
ap_rputs("</BODY>\n" ,r);
ap_rputs("</HTML>\n" ,r);
return OK;
}

/* Make the name of the content handler known to Apache */
static handler_rec hello_handlers[] =
{
{"hello-handler", hello_handler},
{NULL}
};

/* Tell Apache what phases of the transaction we handle */
module MODULE_VAR_EXPORT hello_module =
{
STANDARD_MODULE_STUFF,
NULL, /* module initializer */
NULL, /* per-directory config creator */
NULL, /* dir config merger */
NULL, /* server config creator */
NULL, /* server config merger */
NULL, /* command table */
hello_handlers, /* [9] content handlers */
NULL, /* [2] URI-to-filename translation */
NULL, /* [5] check/validate user_id */
NULL, /* [6] check user_id is valid *here* */
NULL, /* [4] check access by host address */
NULL, /* [7] MIME type checker/setter */
NULL, /* [8] fixups */
NULL, /* [10] logger */
NULL, /* [3] header parser */
NULL, /* process initialization */
NULL, /* process exit/cleanup */
NULL /* [1] post read_request handling */
};
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:31 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0