You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Evaggelos Balaskas <eb...@ebalaskas.gr> on 2006/08/31 10:00:17 UTC

[users@httpd] Apache 2.2.3 - Virtual Host

Hi to all,

i want only for a specific virtual host to give the authority
to one user - group .

in apache 1.3.x was User - Group Directive [0]
in apache 2.0.x wan't support User-Group in VH [1]
and was (is) the AssignUserId [2]

Is there something like this (User - Group, or alike) in
apache 2.2.x. I use the SuExecUserGroup directive [3] but
i want the user to write file without executing cgi scripts.

Any help would be great.
Best regards.

-ebal

[0] : http://httpd.apache.org/docs/1.3/mod/core.html#user
[1] : http://httpd.apache.org/docs/2.0/mod/mpm_common.html#user
[2] : http://httpd.apache.org/docs/2.0/mod/perchild.html#assignuserid
[3] : http://httpd.apache.org/docs/2.2/mod/mod_suexec.html#suexecusergroup


---------------------------------------------------------------------
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] Re: Apache 2.2.3 - Virtual Host

Posted by Joshua Slive <jo...@slive.ca>.
On 8/31/06, Evaggelos Balaskas <eb...@ebalaskas.gr> wrote:
> Joshua Slive wrote:
>
> > The reason this isn't supported in any version of apache httpd is
> > because it is extremely difficult to accomplish without severe
> > compromises given the unix permissions model.  One alternative is to
> > run each vhost as a separate apache httpd instance and then use a
> > reverse proxy in front of them to forward requests.
> >
> > Joshua.
>
> thanks for your anwser Joshua,
> the reverse proxy is a good solution.
>
> qa: If i use a cgi script to write files in my folder
>     isn't better?

It's certainly much easier to do with cgi scripts and suexec.  The
only reason to consider the multi-apache-with-proxy approach is if you
have very specific needs, like very high performance.

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


[users@httpd] Re: Apache 2.2.3 - Virtual Host

Posted by Evaggelos Balaskas <eb...@ebalaskas.gr>.
Joshua Slive wrote:

> The reason this isn't supported in any version of apache httpd is
> because it is extremely difficult to accomplish without severe
> compromises given the unix permissions model.  One alternative is to
> run each vhost as a separate apache httpd instance and then use a
> reverse proxy in front of them to forward requests.
> 
> Joshua.

thanks for your anwser Joshua,
the reverse proxy is a good solution.

qa: If i use a cgi script to write files in my folder
    isn't better?

-ebal


---------------------------------------------------------------------
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 2.2.3 - Virtual Host

Posted by Joshua Slive <jo...@slive.ca>.
On 8/31/06, Evaggelos Balaskas <eb...@ebalaskas.gr> wrote:
> Hi to all,
>
> i want only for a specific virtual host to give the authority
> to one user - group .
>
> in apache 1.3.x was User - Group Directive [0]
> in apache 2.0.x wan't support User-Group in VH [1]
> and was (is) the AssignUserId [2]
>
> Is there something like this (User - Group, or alike) in
> apache 2.2.x. I use the SuExecUserGroup directive [3] but
> i want the user to write file without executing cgi scripts.

This never really did what you want in any version of Apache httpd.
User/Group in 1.3 have exactly the same effect as SuExecUserGroup in
2.x.  It was renamed to avoid the confusion that you seem to have (ie,
that User/Group has any effect beyond CGI scripts).  The perchild mpm
and AssignUserId did try to do what you want, but they never really
worked and there is no active development to make them work at the
moment.

The reason this isn't supported in any version of apache httpd is
because it is extremely difficult to accomplish without severe
compromises given the unix permissions model.  One alternative is to
run each vhost as a separate apache httpd instance and then use a
reverse proxy in front of them to forward requests.

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] RE: case insensitive rewrite rules and nested mapping

Posted by Bob Ionescu <bo...@googlemail.com>.
Chen, Charles wrote:
> I didn't know I could use $1 in this way: i.e., back referenced in
> condition before the rule.

The order of processing is
rule-pattern --> condition(s) --> rule-substitution

So back references created in the rule-pattern will be available in the 
test string of the condition(s).

---------------------------------------------------------------------
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] RE: case insensitive rewrite rules and nested mapping

Posted by "Chen, Charles" <Ch...@vignette.com>.
Thanks Bob! That works!


I didn't know I could use $1 in this way: i.e., back referenced in
condition before the rule.



Cheers



Charles




-----Original Message-----
From: Bob Ionescu [mailto:bobsiegen@googlemail.com] 
Sent: 05 September 2006 14:26
To: users@httpd.apache.org
Subject: Re: [users@httpd] RE: case insensitive rewrite rules and nested
mapping

Chen, Charles wrote:
> here, "/NeWs" first mapped to all upper case "NEWS" and then used to
> lookup another map in which I have a line like this:
> # my text map file
> 
> NEWS  /some/other/url

What about using a condition to get the value:

RewriteMap somemap txt:somemap.map
RewriteMap toupper int:toupper
RewriteCond ${toupper:$1} ^(.*)
RewriteRule ^/(NEWS)$ http://realserver/${somemap:%1} [NC,P]

You'd like to pass the request to mod_proxy, right?

---------------------------------------------------------------------
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] RE: case insensitive rewrite rules and nested mapping

Posted by Bob Ionescu <bo...@googlemail.com>.
Chen, Charles wrote:
> here, "/NeWs" first mapped to all upper case "NEWS" and then used to
> lookup another map in which I have a line like this:
> # my text map file
> 
> NEWS  /some/other/url

What about using a condition to get the value:

RewriteMap somemap txt:somemap.map
RewriteMap toupper int:toupper
RewriteCond ${toupper:$1} ^(.*)
RewriteRule ^/(NEWS)$ http://realserver/${somemap:%1} [NC,P]

You'd like to pass the request to mod_proxy, right?

---------------------------------------------------------------------
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] RE: case insensitive rewrite rules and nested mapping

Posted by "Chen, Charles" <Ch...@vignette.com>.
 

Hi,

 

 

I need a case insensitive url rewrite such as

 

      http://proxyhost/NeWs

 

would be rewritten to:

 

      http://realserver/some/other/url

 

here, "/NeWs" first mapped to all upper case "NEWS" and then used to
lookup another map in which I have a line like this:

 

#

# my text map file

NEWS  /some/other/url

 

 

My first thought was to use the internal mapper "toupper" together with
my own mapper so the rules would look like the following:

 

 

RewriteMap somemap txt:somemap.map

RewriteMap toupper int:toupper

 

RewriteRule ^/(NEWS)$ http://realserver/${somemap:${toupper:$1}}
[NC,R,L]

 

 

This nested mapping did not seem to work with mod_rewrite!

 

So I tried the next:

 

RewriteMap somemap txt:somemap.map

RewriteMap toupper int:toupper

 

RewriteRule ^/(NEWS)$ http://%{REQUEST_HOST}/${toupper:$1}  [NC,R,L]

RewriteRule ^/(NEWS)$ http://realserver/${somemap:$1}  [P,L]

 

 

 

This actually worked but I am not happy with it as it forced a redirect
and therefore the URL in the user's browser is changed.

 

 

Anybody has a better solution that would avoid a redirect?

 

 

Many thanks and best regards,

 

 

 

 

Charles

 

 

---------------------------------------------------------------------

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