Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old May 19th, 2001, 11:11 AM
jameshcollins jameshcollins is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Jacksonville, FL
Posts: 1 jameshcollins User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Getting a web page HREF to reference my C module via a Location command

The problem that I am having is that I cannot get link on my test web
page to access my module. Even though I have been writing code for may
years and C stuff since 1984, the web jargon is still new to so if I
make some mistakes please be tolerant. I do not know for sure if the
problem in the C module file, the httpd configuration file, or the web
page. I have included snippets from each (hopefully the relevant
ones). I am using release 1.3.19.

1. The C module file:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static const handler_rec mod_ALF_HandlerList[] =
{
{"ALF-Test", mod_ALF_Test_Handler},
{NULL}
};

module MODULE_VAR_EXPORT mod_ALF_module =
{
STANDARD_MODULE_STUFF,
mod_ALF_init, /* module initializer */
NULL, //mod_ALF_create_dir_config, /* per-directory config creator
*/
NULL, //mod_ALF_merge_dir_config, /* dir config merger */
NULL, //mod_ALF_create_server_config, /* server config creator
*/
NULL, //mod_ALF_merge_server_config, /* server config merger
*/
NULL, //mod_ALF_cmds, /* command table */
mod_ALF_HandlerList, /* [9] list of handlers */
NULL, //mod_ALF_translate_handler, /* [2] filename-to-URI
translation */
NULL, //mod_ALF_check_user_id, /* [5] check/validate user_id */

NULL, //mod_ALF_auth_checker, /* [6] check user_id is valid
*here* */
NULL, //mod_ALF_access_checker, /* [4] check access by host
address */
NULL, //mod_ALF_type_checker, /* [7] MIME type checker/setter
*/
NULL, //mod_ALF_fixer_upper, /* [8] fixups */
NULL, //mod_ALF_logger, /* [10] logger */
NULL, //mod_ALF_header_parser, /* [3] header parser */
mod_ALF_child_init, /* process initializer */
mod_ALF_child_exit, /* process exit/cleanup */
NULL, //mod_ALF_post_read_request /* [1] post read_request
handling */
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I know that the modules, it is loaded as a shared object using the
Apache make procedure, because I get the appropriate diagnostic messages
on "module initializer" and the "child_init" & "child_exit" routines.
(A side question, when apache is started as two different root process,
normally pid#746 & pid#747. My understanding of the O'Reilly book on
Apache is that a parent process is started which maintains the integrity
of the environment a forks off children to perform the actual work.
However why do I get two parent process call with two distinct pids. I
thought the "module initializer" would only be called once. Now back to
the primary issue.)

2. The configuration file, by order in the file, but not contiguous:
###########################
ServerRoot "/usr/WES"
###########################
DocumentRoot "/usr/WES/htdocs"
###########################
LoadModule mod_ALF_module libexec/mod_ALF.so
###########################
AddModule mod_ALF.c
###########################
<IfModule mod_ALF.c>
<Location /ALF/Test>
SetHandler ALF-Test
Order allow,deny
Allow from all
</Location>
ErrorLog /usr/WES/logs/error_log_ALF
</IfModule>
###########################
A note: The "IfModule" command along with the "ErrorLog" command are
there only to verify that the "Location" was being seen at start-up.
Also I have tried a full path name in the "Location" command because the
error log shows a 404 error and the full pathname.

3. The web page references, there are two, one with a full address and
one with a relative address. Both return with a 404 error and the
entries in the error log are the same:
###########################
<p>Putting the link to <A
HREF="http://web-enabled-solutions.com/ALF/Test">ALF 4</A> here.
###########################
<p>Putting the link to <A HREF="/ALF/Test">ALF 5</A> here.</p>
###########################

I have also tried full pathname based on: "DocumentRoot" in the
configuration file in both the configuration file's "Location" command
and the web page's "HREF".

Reply With Quote
  #2  
Old May 20th, 2001, 05:19 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Due to my limited C knowledge, I can't help you with the code. However,

<IfModule mod_ALF.c>
...
..
</IfModule>

The IfModule directive is the worst directive in Apache. It assumes everything to always return true. If it returns false, it's ignored without throwing any error. That said, if you really wanna see if your module is working, remove the <Ifmodule> block completely. If it fails, it surely will throw you some error to your default error log + apachectl configtest when you trying to start Apache.

>> Also I have tried a full path name in the "Location" command

Location always use relative path to your docroot, using full path of it is a violation to Apache and therefore it must fail.

Your docroot -> /usr/WES/htdocs
/ALF (relative path) -> /usr/WES/htdocs/AFS (full path)

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Getting a web page HREF to reference my C module via a Location command


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway