Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

Apache mod_dir

Quote Reply
Apache mod_dir
I want to add the following to httpd.conf but just want someone to confirm that this is correct.

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.php index.php3 index.php4 index.cgi index.pl
</IfModule>



The thing that confused me was that the module in the modules directory was called mod_dir.so

So do I use the above code..or..


<IfModule mod_dir.so>
DirectoryIndex index.html index.htm index.shtml index.php index.php3 index.php4 index.cgi index.pl
</IfModule>




Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
You'd use the module name - mod_dir.c -- not the shared object module.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Apache mod_dir In reply to
Thanks Pugdog.....

Alex is doing some work for one of my friends so he answered my question via email......thanks anyway Smile

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
In Reply To:
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.php index.php3 index.php4 index.cgi index.pl
</IfModule>
When I added this to httpd.conf Apache crashed...why would this happen?

The names did go onto a second line....would that be anything to do with it?...ie...

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.php index.php3 index.php4
index.cgi index.pl
</IfModule>




Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
Yes, all on one line. =)

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Apache mod_dir In reply to
Ahhhhhhh thanks.

We had a bit of a panic last night when 5 sites went offline due to Apache crashing. Shocked

All the index file names don't fit on one line though so how would I get around that?

Would I use...

<IfModule>
DirectoryIndex File name up until the end of the line.........
</IfModule>

...then copy it on the next line?

<IfModule>
DirectoryIndex Rest of the file names here..........
</IfModule>

????

Thanks.



Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
No, you should use an editor that won't line wrap. =) i.e. use vi or something not pico.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Apache mod_dir In reply to
Ahh....ok thanks for the tip....Ive only used pico before and didn't realise there was a difference between the editors.

Hmmmm....I have a LOT to learn.

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
IF you are editing on Unix, I would strongly suggest "joe" (Joes Own Editor). It's got the best features of most of the simple editors, without all the learning overhead vi requires. It's quick, and I have not found it to fail me yet :) It was a really good suggestion by the guy who set up my server initially.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Apache mod_dir In reply to
Its Linux....where would I download this from?


Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
Search for it. I don't have the offical spot for it. I probably posted it somewhere before, but it came up quickly on a search for "joes own editor" or something.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Apache mod_dir In reply to
In Reply To:
without all the learning overhead vi requires
Aw, but pressing shift-G to go to the end of a file makes so much sense. ;)

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Apache mod_dir In reply to
Alex, I needed that :)

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Apache mod_dir In reply to
I wasnt sure if I should post a new thread or not but I decided against it.....I need serious advice here.

I pay for 100MB webspace with my current host and last week I was using 20MB of my space and when I took a look today I find that I am using 45MB even though I have not uploaded anything and not sent many emails etc.

So I contacted my host and this is what they said.........

>>It seems that there are 21,418 files in the
/www/cgi-bin/admin/sessions/ directory. <<

Hmmmmmmm........this is not too good....any quick ways to get rid of all these files and to stop this happening in the future?


Thanks

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
This is a bug in the session module, it's creating a file everytime you access a cgi script. You should rm all the files in that directory.

The new version will fix this..

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Apache mod_dir In reply to
Thanks......I was getting worried then.......especially as this is only a week or two worth of files....I would have used up all of my space in a couple of weeks at this rateShocked

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
Alex may need to address this.

Session files should be expunged after x-hours, the default is 3. The cookie should stay in your browser, with your username, for example, longer. But would need a new session after 3 hours of inactivity.

I haven't figured out what the sessions files do, but it's on my to-do list of things to investigate once I get the stable installed on several servers.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Apache mod_dir In reply to
Thanks Pugdog/Alex for researching/fixing this.....21,418 files is quite a lot and is a pretty big bug I'd say ;)

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
Sorry........I posted too soon.......I tried rm -r sessions and it seems to be doing something but it is taking a while =)



Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
Don't forget to put the sessions directory back, with server-write permissions!

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Apache mod_dir In reply to
Yup.....I remembered that

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Apache mod_dir In reply to
When using mod_dir, would the following be valid?

<IfModule mod_dir.c>
DirectoryIndex index.*
</IfModule>

Would that work?...Instead of writing out all the possible index file names.

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)