You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Israel Brewster <is...@frontierflying.com> on 2007/09/28 20:42:19 UTC

[users@httpd] Basic mod_rewrite help

I am running a personal webserver with apache 1.3.33 on Mac OS X  
10.4. I have a main site set up at the root level of http:// 
izzy.homeip.net, and a second site set up at the subdirectory of / 
~mongoose. I recently added virtual hosts to my configuration, so now  
http://izzy.homeip.net/~mongoose can be accessed directly at http:// 
mongoosedelta.homeip.net. This all works as expected. Now I would  
like to set things up such that if you typed http://izzy.homeip.net/ 
~mongoose the address is re-written to http:// 
mongoosedelta.homeip.net, for which I believe the correct tool to be  
mod_rewrite.

in my httpd.conf file there is the following sections at the root level:

LoadModule rewrite_module     libexec/httpd/mod_rewrite.so
AddModule mod_rewrite.c

<IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteCond %{REQUEST_METHOD} ^TRACE
     RewriteRule .* - [F]
</IfModule>

which came with the default install. In order to implement the  
desired changes, I added the following lines:

RewriteLog "/var/log/httpd/rewrite.log"
RewriteLogLevel 2

RewriteRule ^/~mongoose(.*) http://mongoosedelta.homeip.net/$1 [NC,L,R]

Yes, I know the R flag is redundant, however, all I am seeing in the  
rewrite log is entries like the following:

[28/Sep/2007:10:04:43 -0800] [izzy.homeip.net/sid#1840290] 
[rid#1822238/initial] (1) [per-dir /WebServer/Documents/] pass  
through /WebServer/Documents/favicon.ico

I have the root level of my webserver at /WebServer/Documents. Yes, I  
know it isn't standard, but I like it there :)

My first thought was that it wasn't matching the rule, maybe because  
of the ~ or something, so I tried several different variations on the  
match pattern, including the way to generic .*mongoose.* but nothing  
seems to have made a difference. At one point I was getting similar  
entries on the home directory for the /~mongoose page, but with  
subsiquent changes they stopped, and now I can't even get those back- 
I'm not sure what I changed to get them in the first place or make  
them stop. Can anyone tell me what I am missing here, and how I can  
make this work? Thanks.
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Basic mod_rewrite help

Posted by Israel Brewster <is...@frontierflying.com>.


On Sep 28, 2007, at 12:40 PM, Joshua Slive wrote:

> On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:
>>
>>
>>
>> On Sep 28, 2007, at 10:48 AM, Joshua Slive wrote:
>>
>>> On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:
>>>
>>>> which came with the default install. In order to implement the
>>>> desired changes, I added the following lines:
>>>
>>> WHERE exactly did you add the lines?
>>
>> Oh, right, sorry, should have mentioned that. I inserted these lines
>> at the end of the config file, outside of any configuration blocks.
>
> If the requests are being served by <VirtualHost>s, then you'll  
> need to read
> http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#vhosts

Perfect, thanks. That RewriteOptions inherit directive did the trick :)

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------

> (or simply place the directives inside the relevant <VirtualHost>  
> block).
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server  
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache error log message

Posted by JJB <on...@earthlink.net>.
We are running php 5.2, this is occuring on php 5.1.2!

 - Joel

William A. Rowe, Jr. wrote:
> JJB wrote:
>   
>> Has anyone seen this and do you have any idea what it means?:
>>
>> Parent: child process exited with status 3221225477
>>     
>
> PHP bug, this would be the httpd forum.
>
> http://bugs.php.net/bug.php?id=36055
>
> Apparently they know of it, that article's nice enough to point out
> how to backtrace, and from there, you can see if the bug is same as
> or different than the reported bug.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>   


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache error log message

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
JJB wrote:
> Has anyone seen this and do you have any idea what it means?:
> 
> Parent: child process exited with status 3221225477

PHP bug, this would be the httpd forum.

http://bugs.php.net/bug.php?id=36055

Apparently they know of it, that article's nice enough to point out
how to backtrace, and from there, you can see if the bug is same as
or different than the reported bug.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Apache error log message

Posted by JJB <on...@earthlink.net>.
Has anyone seen this and do you have any idea what it means?:

Parent: child process exited with status 3221225477

with a few other errors that also seem to occur randomly. A little 
research pulled up something to do with php4ts.dll

Our system only has php5ts.dll,

[Fri Aug 10 13:19:35 2007] [warn] pid file C:/Apache2.2/logs/httpd.pid 
overwritten -- Unclean shutdown of previous Apache run?
[Fri Aug 10 13:19:35 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.0 
configured -- resuming normal operations
[Fri Aug 10 13:19:35 2007] [notice] Server built: Jan  9 2007 23:17:20
[Fri Aug 10 13:19:35 2007] [notice] Parent: Created child process 1736
[Fri Aug 10 13:19:35 2007] [notice] Child 1736: Child process is running
[Fri Aug 10 13:19:35 2007] [notice] Child 1736: Acquired the start mutex.
[Fri Aug 10 13:19:35 2007] [notice] Child 1736: Starting 250 worker threads.
[Fri Aug 10 13:19:35 2007] [notice] Child 1736: Starting thread to 
listen on port 1179.
[Fri Aug 10 13:31:20 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.0 
configured -- resuming normal operations
[Fri Aug 10 13:31:20 2007] [notice] Server built: Jan  9 2007 23:17:20
[Fri Aug 10 13:31:20 2007] [notice] Parent: Created child process 1716
[Fri Aug 10 13:31:20 2007] [notice] Child 1716: Child process is running
[Fri Aug 10 13:31:20 2007] [notice] Child 1716: Acquired the start mutex.
[Fri Aug 10 13:31:20 2007] [notice] Child 1716: Starting 250 worker threads.
[Fri Aug 10 13:31:20 2007] [notice] Child 1716: Starting thread to 
listen on port 1179.
[Fri Aug 10 16:55:10 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.0 
configured -- resuming normal operations
[Fri Aug 10 16:55:10 2007] [notice] Server built: Jan  9 2007 23:17:20
[Fri Aug 10 16:55:10 2007] [notice] Parent: Created child process 1720
[Fri Aug 10 16:55:10 2007] [notice] Child 1720: Child process is running
[Fri Aug 10 16:55:10 2007] [notice] Child 1720: Acquired the start mutex.
[Fri Aug 10 16:55:10 2007] [notice] Child 1720: Starting 250 worker threads.
[Fri Aug 10 16:55:10 2007] [notice] Child 1720: Starting thread to 
listen on port 1179.
[Sat Aug 11 09:46:30 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.0 
configured -- resuming normal operations
[Sat Aug 11 09:46:30 2007] [notice] Server built: Jan  9 2007 23:17:20
[Sat Aug 11 09:46:30 2007] [notice] Parent: Created child process 1732
[Sat Aug 11 09:46:30 2007] [notice] Child 1732: Child process is running
[Sat Aug 11 09:46:30 2007] [notice] Child 1732: Acquired the start mutex.
[Sat Aug 11 09:46:30 2007] [notice] Child 1732: Starting 250 worker threads.
[Sat Aug 11 09:46:30 2007] [notice] Child 1732: Starting thread to 
listen on port 1179.
[Wed Aug 15 03:07:58 2007] [warn] pid file C:/Apache2.2/logs/httpd.pid 
overwritten -- Unclean shutdown of previous Apache run?
[Wed Aug 15 03:07:59 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.0 
configured -- resuming normal operations
[Wed Aug 15 03:07:59 2007] [notice] Server built: Jan  9 2007 23:17:20
[Wed Aug 15 03:07:59 2007] [notice] Parent: Created child process 1736
[Wed Aug 15 03:07:59 2007] [notice] Child 1736: Child process is running
[Wed Aug 15 03:07:59 2007] [notice] Child 1736: Acquired the start mutex.
[Wed Aug 15 03:07:59 2007] [notice] Child 1736: Starting 250 worker threads.
[Wed Aug 15 03:07:59 2007] [notice] Child 1736: Starting thread to 
listen on port 1179.
[Tue Aug 21 13:31:40 2007] [notice] Parent: child process exited with 
status 3221225477 -- Restarting.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Basic mod_rewrite help

Posted by Axel-Stéphane SMORGRAV <Ax...@europe.adp.com>.
If I may inject a related question here, I was recently surprised to discover the order in which rewrite rules are evaluated when using "RewriteOptions inherit" in a VH. It seems like the rewrite rules included in the VH are evaluated before the ones that are inherited.

Is that correct?
Is there any way to control this behaviour?


-ascs
 
-----Message d'origine-----
De : jslive@gmail.com [mailto:jslive@gmail.com] De la part de Joshua Slive
Envoyé : vendredi 28 septembre 2007 22:40
À : users@httpd.apache.org
Objet : Re: [users@httpd] Basic mod_rewrite help

On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:
>
>
>
> On Sep 28, 2007, at 10:48 AM, Joshua Slive wrote:
>
> > On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:
> >
> >> which came with the default install. In order to implement the 
> >> desired changes, I added the following lines:
> >
> > WHERE exactly did you add the lines?
>
> Oh, right, sorry, should have mentioned that. I inserted these lines 
> at the end of the config file, outside of any configuration blocks.

If the requests are being served by <VirtualHost>s, then you'll need to read http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#vhosts
(or simply place the directives inside the relevant <VirtualHost> block).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Basic mod_rewrite help

Posted by Joshua Slive <jo...@slive.ca>.
On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:
>
>
>
> On Sep 28, 2007, at 10:48 AM, Joshua Slive wrote:
>
> > On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:
> >
> >> which came with the default install. In order to implement the
> >> desired changes, I added the following lines:
> >
> > WHERE exactly did you add the lines?
>
> Oh, right, sorry, should have mentioned that. I inserted these lines
> at the end of the config file, outside of any configuration blocks.

If the requests are being served by <VirtualHost>s, then you'll need to read
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#vhosts
(or simply place the directives inside the relevant <VirtualHost> block).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Basic mod_rewrite help

Posted by Israel Brewster <is...@frontierflying.com>.


On Sep 28, 2007, at 10:48 AM, Joshua Slive wrote:

> On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:
>
>> which came with the default install. In order to implement the
>> desired changes, I added the following lines:
>
> WHERE exactly did you add the lines?

Oh, right, sorry, should have mentioned that. I inserted these lines  
at the end of the config file, outside of any configuration blocks.

>
>>
>> RewriteLog "/var/log/httpd/rewrite.log"
>> RewriteLogLevel 2
>
> Up the loglevel to 9 and try again.

Still not seeing anything.
Just for kicks, I tried rewriting the match part of that rule to  
just .* , and I still get nothing, either in the logs or redirected.  
I also tried adding a RewriteEngine on directive to the virtual host,  
with no results. Is there some way to verify that the rewrite engine  
is in fact operating? the lack of any sort of response would seem to  
indicate not, but I'm at a loss for why. If it helps, the config for  
the directory in question is

<Directory "/Users/mongoose/Sites/">
     Options Indexes MultiViews
     AllowOverride All
     Order allow,deny
     Allow from all
</Directory>

although I would think if this was wrong I would get some sort of  
error. Thanks for any assistance.

>
> Joshua.
>
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server  
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Basic mod_rewrite help

Posted by Joshua Slive <jo...@slive.ca>.
On 9/28/07, Israel Brewster <is...@frontierflying.com> wrote:

> which came with the default install. In order to implement the
> desired changes, I added the following lines:

WHERE exactly did you add the lines?

>
> RewriteLog "/var/log/httpd/rewrite.log"
> RewriteLogLevel 2

Up the loglevel to 9 and try again.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org