public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* OT, please help with apache2 RewriteRule
@  Gregory Nowak
   ` Trevor Astrope
   ` northstar1950
  0 siblings, 2 replies; 10+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: speakup

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all.

Please excuse the off topic post, but there are lots of people on here
smarter than myself, and I figured it wouldn't hurt to ask.

I've been trying to use RewriteRule in apache2 for a couple of hours
now to do url redirection, and can't get it to work. Here's the
situation, I'm running apache2, and have the following in my
virtualhost container:

"RewriteEngine on
RewriteRule ^/cgi-bin/\?list=(.*)$ /cgi-bin/ezmlm-browse\?list=$1"

Here's what I want to do. If someone goes to
http://www.example.com/cgi-bin/?list=... I want them to be
redirected to http://www.example.com/cgi-bin/ezmlm-browse?list=... The
"..." here represents anything that comes after the "?list=" part.

I'll admit that I haven't used regular expressions much, and that
they're definitely not one of my strong points. BTW, the rewrite
module itself is setup properly, I have another RewriteRule in that
same virtualhost container working just fine already. The problem is
getting the regexp right. If someone could please tell me where I'm
going wrong here, I would be grateful. Thanks in advance for any help, which would
be much appreciated.

Greg


- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmHWhcACgkQ7s9z/XlyUyA2DgCgvP/u/YcwsdZijj9GCl1Yws+d
wWoAn3s5vMCJgVy0xitN2YK+ijACOTn8
=OTzH
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OT, please help with apache2 RewriteRule
   OT, please help with apache2 RewriteRule Gregory Nowak
@  ` Trevor Astrope
     ` Gregory Nowak
   ` northstar1950
  1 sibling, 1 reply; 10+ messages in thread
From: Trevor Astrope @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

It looks like you have a trailing quote at the end of the rule. Also, try 
adding an explicit action at the end. I'm not sure if redirect is the 
default action or not, but try adding [R] or [PT] to the end of the rule.

On Mon, 2 Feb 2009, Gregory Nowak wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all.
>
> Please excuse the off topic post, but there are lots of people on here
> smarter than myself, and I figured it wouldn't hurt to ask.
>
> I've been trying to use RewriteRule in apache2 for a couple of hours
> now to do url redirection, and can't get it to work. Here's the
> situation, I'm running apache2, and have the following in my
> virtualhost container:
>
> "RewriteEngine on
> RewriteRule ^/cgi-bin/\?list=(.*)$ /cgi-bin/ezmlm-browse\?list=$1"
>
> Here's what I want to do. If someone goes to
> http://www.example.com/cgi-bin/?list=... I want them to be
> redirected to http://www.example.com/cgi-bin/ezmlm-browse?list=... The
> "..." here represents anything that comes after the "?list=" part.
>
> I'll admit that I haven't used regular expressions much, and that
> they're definitely not one of my strong points. BTW, the rewrite
> module itself is setup properly, I have another RewriteRule in that
> same virtualhost container working just fine already. The problem is
> getting the regexp right. If someone could please tell me where I'm
> going wrong here, I would be grateful. Thanks in advance for any help, which would
> be much appreciated.
>
> Greg
>
>
> - --
> web site: http://www.romuald.net.eu.org
> gpg public key: http://www.romuald.net.eu.org/pubkey.asc
> skype: gregn1
> (authorization required, add me to your contacts list first)
>
> - --
> Free domains: http://www.eu.org/ or mail dns-manager@EU.org
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkmHWhcACgkQ7s9z/XlyUyA2DgCgvP/u/YcwsdZijj9GCl1Yws+d
> wWoAn3s5vMCJgVy0xitN2YK+ijACOTn8
> =OTzH
> -----END PGP SIGNATURE-----
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OT, please help with apache2 RewriteRule
   ` Trevor Astrope
@    ` Gregory Nowak
  0 siblings, 0 replies; 10+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There are no quotes in the rule, I only enclosed what I have in quotes
for clarity, so disregard the quotes when reading. I also tried both
[R] and [PT] like you suggested at the end of the rule, and they don't
make a difference. Thanks.

Greg


On Mon, Feb 02, 2009 at 03:53:03PM -0500, Trevor Astrope wrote:
> It looks like you have a trailing quote at the end of the rule. Also, try 
> adding an explicit action at the end. I'm not sure if redirect is the  
> default action or not, but try adding [R] or [PT] to the end of the rule.
>


- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmHYa4ACgkQ7s9z/XlyUyAtrQCg1NHJbkFVGj8aYsXPLXGBzon9
HdgAnjnvnYDQeZJfHo4tMhJvwKn7wk4e
=iilS
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OT, please help with apache2 RewriteRule
   OT, please help with apache2 RewriteRule Gregory Nowak
   ` Trevor Astrope
@  ` northstar1950
     ` Gregory Nowak
  1 sibling, 1 reply; 10+ messages in thread
From: northstar1950 @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

try this line in the head section of your html file:

<meta http-equiv="refresh" content="10; url=replace.this.with.your.url">
Legend has it that on Monday 2/2/2009 02:39 PM, Gregory Nowak said:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hi all.
>
>Please excuse the off topic post, but there are lots of people on here
>smarter than myself, and I figured it wouldn't hurt to ask.
>
>I've been trying to use RewriteRule in apache2 for a couple of hours
>now to do url redirection, and can't get it to work. Here's the
>situation, I'm running apache2, and have the following in my
>virtualhost container:
>
>"RewriteEngine on
>RewriteRule ^/cgi-bin/\?list=(.*)$ /cgi-bin/ezmlm-browse\?list=$1"
>
>Here's what I want to do. If someone goes to
>http://www.example.com/cgi-bin/?list=... I want them to be
>redirected to http://www.example.com/cgi-bin/ezmlm-browse?list=... The
>"..." here represents anything that comes after the "?list=" part.
>
>I'll admit that I haven't used regular expressions much, and that
>they're definitely not one of my strong points. BTW, the rewrite
>module itself is setup properly, I have another RewriteRule in that
>same virtualhost container working just fine already. The problem is
>getting the regexp right. If someone could please tell me where I'm
>going wrong here, I would be grateful. Thanks in advance for any 
>help, which would
>be much appreciated.
>
>Greg
>
>
>- --
>web site: http://www.romuald.net.eu.org
>gpg public key: http://www.romuald.net.eu.org/pubkey.asc
>skype: gregn1
>(authorization required, add me to your contacts list first)
>
>- --
>Free domains: http://www.eu.org/ or mail dns-manager@EU.org
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.4.9 (GNU/Linux)
>
>iEYEARECAAYFAkmHWhcACgkQ7s9z/XlyUyA2DgCgvP/u/YcwsdZijj9GCl1Yws+d
>wWoAn3s5vMCJgVy0xitN2YK+ijACOTn8
>=OTzH
>-----END PGP SIGNATURE-----
>_______________________________________________
>Speakup mailing list
>Speakup@braille.uwo.ca
>http://speech.braille.uwo.ca/mailman/listinfo/speakup


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OT, please help with apache2 RewriteRule
   ` northstar1950
@    ` Gregory Nowak
       ` Tony Baechler
  0 siblings, 1 reply; 10+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks, but that's not going to work, because there is no html file,
there's only (an improperly designed in my humble opinion) cgi
program. The problem is this, you go to
www.example.com/cgi-bin/ezmlm-browse and that's fine. However, when
ezmlm-browse generates urls, it generates them as
www.example.com/cgi-bin/?list=... and not as
www.example.com/cgi-bin/ezmlm-browse?list=... which is a redirection
that will need to be done by apache itself, and can't be done from an
html file.

Greg


On Mon, Feb 02, 2009 at 07:20:38PM -0600, northstar1950@att.net wrote:
> try this line in the head section of your html file:
>
> <meta http-equiv="refresh" content="10; url=replace.this.with.your.url">


- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmHnqIACgkQ7s9z/XlyUyBXvACgxN4eyRP+L6HmOK25sVVSb9Cu
YvwAoKm6undXbr2+rVQ0tFQlqzEOTk1Q
=V6z9
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OT, please help with apache2 RewriteRule
     ` Gregory Nowak
@      ` Tony Baechler
         ` Gregory Nowak
  0 siblings, 1 reply; 10+ messages in thread
From: Tony Baechler @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Hi,

I know this doesn't solve your problem, but I would suggest not using 
ezmlm cgi at all.  It has known security problems that probably won't be 
fixed.  Instead, I suggest mhonarc or similar.  It will generate 
archives automatically as new mail is posted assuming it's set up 
correctly.  There's of course Mailman which is web-based.  I think ezmlm 
itself is fine, it's the cgi that's not secure and has bugs.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OT, please help with apache2 RewriteRule
       ` Tony Baechler
@        ` Gregory Nowak
           ` Mailing list archiving Tony Baechler
  0 siblings, 1 reply; 10+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Feb 03, 2009 at 03:49:25AM -0800, Tony Baechler wrote:
> I know this doesn't solve your problem, but I would suggest not using  
> ezmlm cgi at all.  It has known security problems that probably won't be  
> fixed.

As I mentioned in my last post to this thread, I already solved my
problem. I know ezmlm-cgi has many drawbacks, which is why I finally
decided to switch to ezmlm-browse.

> Instead, I suggest mhonarc or similar.  It will generate  
> archives automatically as new mail is posted assuming it's set up  
> correctly.

I just ran aptitude show mhonarc, and all it really tells me is that
it's a pearl-based mail to html archiver. How well does it integrate
into ezmlm-idx?

> There's of course Mailman which is web-based.

According to aptitude show mailman, it depends on exim4, and I'm not
dumping my existing qmail install, which is nicely doing all I need it
to do, in favor of exim, which is arguably less secure than qmail,
just so I can install mailman, so that's not an option. I won't even
mention the task of converting ezmlm subscriptions and archives over
to mailman.

> I think ezmlm  
> itself is fine, it's the cgi that's not secure and has bugs.

I agree, like I said, I'm not too happy with ezmlm-cgi, thus the
switch away from it. Thanks for your suggestions, and input.

Greg


- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmIlcIACgkQ7s9z/XlyUyDIYgCfYfK7Ip5RxEHfQFDzQUR/gNLy
RioAnAi9XITejlpsPA6KfHBoul76c9Cf
=09/w
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Mailing list archiving
         ` Gregory Nowak
@          ` Tony Baechler
             ` Gregory Nowak
  0 siblings, 1 reply; 10+ messages in thread
From: Tony Baechler @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

Hi,

First, let me clear up a myth.  Mailman doesn't require any specific 
mail transport agent.  There is no reason why it won't work with Qmail, 
Postfix, etc.  For some reason, Debian really likes pushing exim4.  If 
you install a dummy package providing mail-transport-agent or install 
the Qmail binary package generated from the Debian qmail-src package, 
you're fine.  It probably said that it depends on exim4 or 
mail-transport-agent.  I've been running Qmail since 2004 and tried to 
set up Mailman.  I admit that ezmlm is vastly easier but I never set up 
web archives because of the security issues.

The same applies with mhonarc.  It should integrate with any mailer or 
mailing list.  It even works on Usenet articles.  You can customize its 
output to some degree.  Basically you pass it the raw message text as 
the mail is received and it automatically converts it to html and 
updates its indexes.  I don't know if you're using vpopmail or similar 
with Qmail, but you could call mhonarc as part of the qmailqueue 
environment variable if you want all mail archived or only make it part 
of the ezmlm or mailing list user.  I've not used it on an actual 
production mailing list but I have used it on some news articles for 
testing.  The FAQ should give instructions to add to ezmlm.  Based on my 
setup here, I think you would do something like this in your .qmail file:

|/usr/bin/mhonarc
|ezmlm-whatever

Obviously, read the dot-qmail (5) man page and the mhonarc docs for full 
details.  Our mailing list never got off the ground, so archiving wasn't 
much of an issue.  I'm not familiar with ezmlm-browse, but I hope it 
masks addresses from spammers.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mailing list archiving
           ` Mailing list archiving Tony Baechler
@            ` Gregory Nowak
  0 siblings, 0 replies; 10+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: Speakup is a screen review system for Linux.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Feb 04, 2009 at 03:42:35AM -0800, Tony Baechler wrote:
> I'm not familiar with ezmlm-browse, but I hope it  
> masks addresses from spammers.

Yes, it does that, and adds more features that weren't found in
ezmlm-cgi
http://untroubled.org/ezmlm-browse/
Also, thanks for your clarification, and explanations. I've got
ezmlm-browse working now fully, and am happy with the switch so far.

Greg


- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmJ5/YACgkQ7s9z/XlyUyC2TwCfetiww+2WGKW6HZaf/RrWxMVJ
oj4AoLla/M1uqjhwNtn1odxm/6S9qNYZ
=2Z8O
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: OT, please help with apache2 RewriteRule
@  Gregory Nowak
  0 siblings, 0 replies; 10+ messages in thread
From: Gregory Nowak @  UTC (permalink / raw)
  To: speakup

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi again.

Well, after spending a few more hours with the apache2 manual, I
managed to figure this out. I'll post the solution for anyone who is
interested. For those who aren't, use your delete key now.

Here's what the rule for doing what I wanted to do looks like, and I
won't put the quotes in for clarity this time:

- --- cut here ---
RewriteCond %{QUERY_STRING} ^list=(.*)$
RewriteRule ^/cgi-bin/$ /cgi-bin/ezmlm-browse [R]
- --- end here ---

You of course need to turn on the RewriteEngine first. Also,
RewriteLog, and RewriteLogLevel proved vital when tweaking to get the
final result, once I figured out the basics.

What finally tipped me off was the statement that RewriteCond is used
to conditionally run a RewriteRule, based on environment variables,
and the information that QUERY_STRING holds "info" passed to cgi
scripts.

Complexity is what makes apache so neat and versatile, but it's also
the complexity that makes you want to howl in frustration at the top of your lungs,
and slam your fist into your poor pc, (no, I wasn't howling, and
bashing my pc, but I sure had the urge to do both).

Greg


- -- 
web site: http://www.romuald.net.eu.org
gpg public key: http://www.romuald.net.eu.org/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

- --
Free domains: http://www.eu.org/ or mail dns-manager@EU.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmH540ACgkQ7s9z/XlyUyDKOwCdFikmsr5idioRYo+puWwso757
Nn4An2hfA1/XjI8wMzY+jCnh+Yg/A0cm
=DZ0w
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 OT, please help with apache2 RewriteRule Gregory Nowak
 ` Trevor Astrope
   ` Gregory Nowak
 ` northstar1950
   ` Gregory Nowak
     ` Tony Baechler
       ` Gregory Nowak
         ` Mailing list archiving Tony Baechler
           ` Gregory Nowak
 OT, please help with apache2 RewriteRule Gregory Nowak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).