Re: helloworld module won't load

2009-03-31 Thread Sorin Manolache
On Tue, Mar 31, 2009 at 07:44, Richard Langly
richard.ringo.lan...@gmail.com wrote:
 I'm running gentoo and trying to see my helloworld module which I got
 from the apache modules book. So I try to hit
 http://10.0.2.20/helloworld, but nothing happens exept that I get a
 'file does not exist' in the apache errors.log.

 When I run apache2 -M, I don't see my module listed anywhere's. My
 module compiled and installed fine in /usr/lib64/apache2/modules when
 I did a 'apxs -cia mod_helloworld.c'

 Here's the file located in /etc/apache2/modules.d/
 ---
 LoadModule helloworld_module    modules/mod_helloworld.so

 Location /helloworld
    SetHandler helloworld
 /Location
 ---

 I've also tried many other combinations of -D HELLO to the APACHE_OPTS
 line in /etc/conf.d/apache2 (just like the other gentoo module *.conf
 files, and restarted the server, but nothing has worked.

 I've done everything the book said, and all seems fine, except I see
 nowhere's that my module has loaded.

I have no experience on how apache is configured on gentoo, but here
is what you could try:

Check that the conf files under /etc/apache2/modules.d/ are loaded
into the server. Are there other files in that directory? If yes, are
the modules they refer to loaded? If there are files, but the
corresponding modules are not loaded, write something like Include
/etc/apache2/modules.d/* in the main apache config file. If there are
other files and the modules are loaded, just your module is not, then
there's a problem with your LoadModule configuration directive.

Paths like modules/mod_helloworld.so (that is without a forward slash
at the beginning) are relative to the ServerRoot. Check the ServerRoot
directive in your apache main conf file. Check how the other modules
specified their paths. In order to avoid any ambiguity, put the
absolute path, i.e. something like
/usr/lib/apache2/modules/mod_helloworld.so (a path that starts with a
forward slash).

On debian apache's main conf file (the file from which all the other
are included) is /etc/apache2/apache2.conf. I don't know which is the
main conf file on gentoo. It should be either
/etc/apache2/apache2.conf or /etc/apache2/httpd.conf but it depends on
how the apache compilation was configured.

Hope this helps,
S


-- 
A: Because it reverses the logical flow of conversation.
Q: Why is top-posting frowned upon?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


helloworld module won't load

2009-03-30 Thread Richard Langly
I'm running gentoo and trying to see my helloworld module which I got
from the apache modules book. So I try to hit
http://10.0.2.20/helloworld, but nothing happens exept that I get a
'file does not exist' in the apache errors.log.

When I run apache2 -M, I don't see my module listed anywhere's. My
module compiled and installed fine in /usr/lib64/apache2/modules when
I did a 'apxs -cia mod_helloworld.c'

Here's the file located in /etc/apache2/modules.d/
---
LoadModule helloworld_modulemodules/mod_helloworld.so

Location /helloworld
SetHandler helloworld
/Location
---

I've also tried many other combinations of -D HELLO to the APACHE_OPTS
line in /etc/conf.d/apache2 (just like the other gentoo module *.conf
files, and restarted the server, but nothing has worked.

I've done everything the book said, and all seems fine, except I see
nowhere's that my module has loaded.