You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by innocent <in...@tauraizimbabwe.com> on 2004/03/19 15:43:05 UTC

[users@httpd] HTACCESS urgent

I have a server that is running on linux and I have my apache not allowing 
directory write. How do I make a .htaccess file to only allow this particulary 
directory within  my root doc to allow writing on files thru a web page

Thank you

Innocent Muchedzi
tele:: 795541/795562

---------------------------------------------------------------------
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] Protecting Your Images

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 19 Mar 2004, rott wrote:

> Im using apache 2.0.47 on a win2000 Pro  computer and I want to protect my
> gif's and jpeg's I found this nice code for doing that but every time I
> start apache I get and error from apache
> RewriteCond: bad flag delimiters
>
>  the code is found here
> http://www.serverwatch.com/tutorials/article.php/10825_1132731_4
>
> SetEnvIfNoCase Referer !"^http://my.apache.org/" not_local_ref=1
> SetEnvIfNoCase Request_URI ".(gif|jpg)" is_image=1
> RewriteEngine On
> RewriteCond $ {ENV:not_local_ref} =1

ServerWatch seems to have mangled their example at some point by putting a
space between the $ and the {ENV...  Why don't you take a look at Ken's
own site, where the examples look better:
http://apache-server.com/tutorials/ATimage-theft.html

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] Rewrite, or what?

Posted by Anders Norrbring <an...@norrbring.biz>.
> > Nope, that won't do..  I can't have name based vhosts on SSL...  The
> result
> > in startup is;
> >
> > iris:~ # apache2 start
> > Starting httpd2 (prefork) [Fri Mar 19 22:21:14 2004] [warn] _default_
> > VirtualHost overlap on port 443, the first has precedence
> > [Fri Mar 19 22:21:14 2004] [warn] _default_ VirtualHost overlap on port
> 443,
> > the first has precedence
> >
> > So there must be something else I can do.
> 
> That is a side-effect of some pre-existing configuration.  You can't just
> add the stuff from the faq to a existing vhost sections.  You need to make
> changes.
> 
> The other alternative, as mentioned in the same faq question, is to use
> mod_rewrite.


I've been looking over and over in the virtual hosting configs and examples,
docs etc.  No luck.

So, let me express my thoughts in a new way, maybe it will clear up more
what I'm looking for.

Ideally, I should run mass virtual hosting with mod_vhost_alias for hosts on
port 80.

On SSL port 443, there should be a web page to view for the exact base URL
only.  F.x. https://www.server.tld. (Where www.server.tld is the machine's
native name.)


Lets say I have a virtual host named www.virtual.tld, it should be
accessible only via port 80, i.e. http://www.virtual.tld.
If a user should point his browser to the SSL port with the URL
https://www.virtual.tld, then that user should be presented with an error
page saying something about "nothing here" and so on.

I guess I agree with Joshua that this can only be accomplished with
mod_rewrite, but I have no idea on how to write the rules needed.  I'm
absolutely new to this kind of setup, and the few pages I've found about
mod_rewrite only makes me more confused about it, not the other way around.

Anders.


---------------------------------------------------------------------
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: SV: [users@httpd] Rewrite, or what?

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 19 Mar 2004, Anders Norrbring wrote:
> Nope, that won't do..  I can't have name based vhosts on SSL...  The result
> in startup is;
>
> iris:~ # apache2 start
> Starting httpd2 (prefork) [Fri Mar 19 22:21:14 2004] [warn] _default_
> VirtualHost overlap on port 443, the first has precedence
> [Fri Mar 19 22:21:14 2004] [warn] _default_ VirtualHost overlap on port 443,
> the first has precedence
>
> So there must be something else I can do.

That is a side-effect of some pre-existing configuration.  You can't just
add the stuff from the faq to a existing vhost sections.  You need to make
changes.

The other alternative, as mentioned in the same faq question, is to use
mod_rewrite.

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


SV: [users@httpd] Rewrite, or what?

Posted by Anders Norrbring <an...@norrbring.biz>.
> > I have a small problem...  I run Apache2 with name based virtual hosts
> at
> > port 80.  I also have an administrative page at https on port 443.
> >
> > Now, the problem is that the admin page is reached by
> https://www.server.tld
> >
> > If I go to a virtual host at http://www.virtual.tld that works perfectly
> > well, but if I should type in https://www.virtual.tld the admin page
> comes
> > up and in the browsers URL window it looks like it's the virtual hosts
> admin
> > site, not the base URL for the SSL admin page.
> >
> > How can I fix this?  Either so that a https call to a virtual host shows
> > nothing at all, or an error page, or it gets routed to the "right
> address"?
> 
> I'm guessing this is one very-special case where you might want to use the
> NameVirtualHost directive with ssl.  See the following example
> http://httpd.apache.org/docs/misc/FAQ.html#canonical-hostnames
> but replace * with *:443.


Nope, that won't do..  I can't have name based vhosts on SSL...  The result
in startup is;

iris:~ # apache2 start
Starting httpd2 (prefork) [Fri Mar 19 22:21:14 2004] [warn] _default_
VirtualHost overlap on port 443, the first has precedence
[Fri Mar 19 22:21:14 2004] [warn] _default_ VirtualHost overlap on port 443,
the first has precedence

So there must be something else I can do.

Anders.


---------------------------------------------------------------------
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] Rewrite, or what?

Posted by Joshua Slive <jo...@slive.ca>.


On Fri, 19 Mar 2004, Anders Norrbring wrote:

>
> I have a small problem...  I run Apache2 with name based virtual hosts at
> port 80.  I also have an administrative page at https on port 443.
>
> Now, the problem is that the admin page is reached by https://www.server.tld
>
> If I go to a virtual host at http://www.virtual.tld that works perfectly
> well, but if I should type in https://www.virtual.tld the admin page comes
> up and in the browsers URL window it looks like it's the virtual hosts admin
> site, not the base URL for the SSL admin page.
>
> How can I fix this?  Either so that a https call to a virtual host shows
> nothing at all, or an error page, or it gets routed to the "right address"?

I'm guessing this is one very-special case where you might want to use the
NameVirtualHost directive with ssl.  See the following example
http://httpd.apache.org/docs/misc/FAQ.html#canonical-hostnames
but replace * with *:443.

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] Rewrite, or what?

Posted by Anders Norrbring <an...@norrbring.biz>.
I have a small problem...  I run Apache2 with name based virtual hosts at
port 80.  I also have an administrative page at https on port 443.

Now, the problem is that the admin page is reached by https://www.server.tld

If I go to a virtual host at http://www.virtual.tld that works perfectly
well, but if I should type in https://www.virtual.tld the admin page comes
up and in the browsers URL window it looks like it's the virtual hosts admin
site, not the base URL for the SSL admin page.

How can I fix this?  Either so that a https call to a virtual host shows
nothing at all, or an error page, or it gets routed to the "right address"?

If you have a solution, please elaborate it for me, I'm new to Apache2 and
not at all familiar with the inner workings.

Anders Norrbring


---------------------------------------------------------------------
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] Protecting Your Images

Posted by rott <ro...@buckeye-express.com>.
Im using apache 2.0.47 on a win2000 Pro  computer and I want to protect my
gif's and jpeg's I found this nice code for doing that but every time I
start apache I get and error from apache
RewriteCond: bad flag delimiters

 the code is found here
http://www.serverwatch.com/tutorials/article.php/10825_1132731_4

SetEnvIfNoCase Referer !"^http://my.apache.org/" not_local_ref=1
SetEnvIfNoCase Request_URI ".(gif|jpg)" is_image=1
RewriteEngine On
RewriteCond $ {ENV:not_local_ref} =1
RewriteCond $ {ENV:is_image} =1
RewriteRule .* - [Last,Env=poach_attempt:1]
CustomLog logs/poachers_log CLF env=poach_attempt

I have googled for it and found some things but nothing that really helped
me fix it


Dale


---------------------------------------------------------------------
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] HTACCESS urgent

Posted by Rich Bowen <rb...@rcbowen.com>.
On Fri, 19 Mar 2004, innocent wrote:

> I have a server that is running on linux and I have my apache not allowing 
> directory write. How do I make a .htaccess file to only allow this particulary 
> directory within  my root doc to allow writing on files thru a web page

You seem to be asking the wrong question, but I'll give it a shot
anyway. If you want to write files via a cgi program (is that what
you're doing?) then the file/directory must be writeable by the 'nobody'
or 'apache' user. This is a file permission thing, and has nothing to do
with .htaccess files.

If that doesn't help, then you might want to provide us with an error
message that you are receiving, and a detailed account of exactly what
it is that you are trying to do.

-- 
Nothing is perfect, certainly not me
Success to failure, just a matter of degrees
Working at perfect got me down on my knees
        (Working at perfekt - Geddy Lee)


---------------------------------------------------------------------
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