Connecting Tech Pros Worldwide Help | Site Map

mod_rewrite help: More than 32000 directories on Linux problem?

  #1  
Old July 17th, 2005, 10:19 AM
Support
Guest
 
Posts: n/a
Hello,

I am running RedHat & Apache. RedHat does not allow creating more
that 32000 subdirectories in one folder due to #defined constant
limitation in the core code.

I need to display 47000 directories on web page:
e.g. mydomain.com/andrew , mydomain.com/bill , etc. Each directory
contains .html/htm files and image files (*.jpg, *gif, jpeg etc.)

The directory structure has been created previosly some time ago and
worked perfectly on WinNT machine untill now. Modifying HTML seems to
be a big job to do.

Can anyone suggest a solution using mod_rewrite?

Thanks!

Dgrand
  #2  
Old July 17th, 2005, 10:19 AM
Daniel Tryba
Guest
 
Posts: n/a

re: mod_rewrite help: More than 32000 directories on Linux problem?


Support <dimag@my-deja.com> wrote:[color=blue]
> I am running RedHat & Apache. RedHat does not allow creating more
> that 32000 subdirectories in one folder due to #defined constant
> limitation in the core code.[/color]

What filesystem are you using?
[color=blue]
> I need to display 47000 directories on web page:
> e.g. mydomain.com/andrew , mydomain.com/bill , etc.[/color]
[snip]
[color=blue]
> Modifying HTML seems to be a big job to do.[/color]

No kidding :)

But a regexp equivalent to the rule below seems to be more efficient
than using the rewritengine.
[color=blue]
> Can anyone suggest a solution using mod_rewrite?[/color]

A simple workaround would be to reorganize directories like:
/a/andrew
or
/b/i/bill

With the rewrite engine it would become something like:
RewriteRule ^(.)(.*) /$1/$1$2

You'll need to lookup the exact syntax yourself :)

--

Daniel Tryba

  #3  
Old July 17th, 2005, 10:19 AM
Daniel Tryba
Guest
 
Posts: n/a

re: mod_rewrite help: More than 32000 directories on Linux problem?


Daniel Tryba <news_comp.lang.php@canopus.nl> wrote:[color=blue]
> No kidding :)
>
> But a regexp equivalent to the rule below seems to be more efficient
> than using the rewritengine.[/color]
(forgot half the sentence)
So spending some time to figure out how to edit the html might be the
longterm goal. Using sed/awk/perl/php or some other scripting magic to
rewrite href or img attributes shouldn't be to difficult eiter.

--

Daniel Tryba

  #4  
Old July 17th, 2005, 10:19 AM
Support
Guest
 
Posts: n/a

re: mod_rewrite help: More than 32000 directories on Linux problem?


Daniel,

thank you for the reply. That ia what I am doing now - moving all the
stuff into /a/andrew ; /b/bill etc. Anybody knows exact syntax for
Mod_rewrite for this sort of directory arrangment?
[color=blue][color=green]
>>RewriteRule ^(.)(.*) /$1/$1$2[/color][/color]
I've tried
RewriteRule ^([a-zA-Z]{1})(.*)$ /$1/$1$2 [L]
does not seem to work

DgranD

Daniel Tryba <news_comp.lang.php@canopus.nl> wrote in message news:<clmske$lkv$1@news.tue.nl>...[color=blue]
> Support <dimag@my-deja.com> wrote:[color=green]
> > I am running RedHat & Apache. RedHat does not allow creating more
> > that 32000 subdirectories in one folder due to #defined constant
> > limitation in the core code.[/color]
>
> What filesystem are you using?
>[color=green]
> > I need to display 47000 directories on web page:
> > e.g. mydomain.com/andrew , mydomain.com/bill , etc.[/color]
> [snip]
>[color=green]
> > Modifying HTML seems to be a big job to do.[/color]
>
> No kidding :)
>
> But a regexp equivalent to the rule below seems to be more efficient
> than using the rewritengine.
>[color=green]
> > Can anyone suggest a solution using mod_rewrite?[/color]
>
> A simple workaround would be to reorganize directories like:
> /a/andrew
> or
> /b/i/bill
>
> With the rewrite engine it would become something like:
> RewriteRule ^(.)(.*) /$1/$1$2
>
> You'll need to lookup the exact syntax yourself :)[/color]
  #5  
Old July 17th, 2005, 10:20 AM
Chung Leong
Guest
 
Posts: n/a

re: mod_rewrite help: More than 32000 directories on Linux problem?


"Daniel Tryba" <news_comp.lang.php@canopus.nl> wrote in message
news:clmske$lkv$1@news.tue.nl...[color=blue]
> Support <dimag@my-deja.com> wrote:[color=green]
> > I am running RedHat & Apache. RedHat does not allow creating more
> > that 32000 subdirectories in one folder due to #defined constant
> > limitation in the core code.[/color]
>
> What filesystem are you using?
>[color=green]
> > I need to display 47000 directories on web page:
> > e.g. mydomain.com/andrew , mydomain.com/bill , etc.[/color]
> [snip]
>[color=green]
> > Modifying HTML seems to be a big job to do.[/color]
>
> No kidding :)
>
> But a regexp equivalent to the rule below seems to be more efficient
> than using the rewritengine.
>[color=green]
> > Can anyone suggest a solution using mod_rewrite?[/color]
>
> A simple workaround would be to reorganize directories like:
> /a/andrew
> or
> /b/i/bill
>
> With the rewrite engine it would become something like:
> RewriteRule ^(.)(.*) /$1/$1$2[/color]

Or to reduce the amount of directory reorganization, just split them up into
two folders:

RewriteRule ^([a-j].*) /a-j/$1
RewriteRule ^(.*) /the-rest/$1


Closed Thread