You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by LuKreme <kr...@kreme.com> on 2009/10/20 01:39:14 UTC

[users@httpd] Re: Conditional .htaccess

On 19-Oct-2009, at 17:23, Scott Haneda wrote:
> php admin value and php flag values, I would like to only be enabled  
> for my IP address, but publicly, I want them off, so the public does  
> not see errors, only I do.

I think the way to do this is to setup a different location.

Something like this (this is for webdav, but the idea is the same):

<VirtualHost *>
    ServerName www.example.com
    ServerAlias example.com
    DocumentRoot /usr/home/ksmith/http/
    CustomLog /home/ksmith/logs/site.log combined
    ErrorLog /home/ksmith/logs/site_error.log
</VirtualHost>


<virtualhost *>
    ServerName webdav.example.com
    DocumentRoot /usr/home/ksmith/http/
    DavLockDB /tmp/DavLock.example
    CustomLog /home/ksmith/logs/sitedav.log combined
    ErrorLog /home/ksmith/logs/site_daverror.log
    <location />
          DAV On
          AuthType Basic
          AuthName "Example.com DAV"
          AuthUserFile /home/ksmith/.htdavpass
          #AllowOverride All
          ForceType text/plain
          require valid-user
     </location>
</virtualhost>

notice the two virtualhosts are pointing at the same content.

You would do something similar to create a, say, phpadmin.example.com  
that turned on the directives you wanted:

<virtualhost *>
    ServerName phpa.example.com
    DocumentRoot /usr/home/ksmith/http/
    php_flag display_errors on
</virtualhost>


-- 
I WILL NOT STRUT AROUND LIKE I OWN THE PLACE
	Bart chalkboard Ep. 2F15


---------------------------------------------------------------------
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: Conditional .htaccess

Posted by Scott Haneda <ta...@newgeo.com>.
Ah ha, very nice idea. As long as my sites are not relying on the  
hostname, which I rarely every use src=http://example.com/file.foo and  
use src=/file.foo, then I should be ok.

Thanks, I never thought about approaching it that way, good idea.
-- 
Scott * If you contact me off list replace talklists@ with scott@ *

On Oct 19, 2009, at 4:39 PM, LuKreme wrote:

> On 19-Oct-2009, at 17:23, Scott Haneda wrote:
>> php admin value and php flag values, I would like to only be  
>> enabled for my IP address, but publicly, I want them off, so the  
>> public does not see errors, only I do.
>
> I think the way to do this is to setup a different location.
>
> Something like this (this is for webdav, but the idea is the same):
>
> <VirtualHost *>
>   ServerName www.example.com
>   ServerAlias example.com
>   DocumentRoot /usr/home/ksmith/http/
>   CustomLog /home/ksmith/logs/site.log combined
>   ErrorLog /home/ksmith/logs/site_error.log
> </VirtualHost>
>
>
> <virtualhost *>
>   ServerName webdav.example.com
>   DocumentRoot /usr/home/ksmith/http/
>   DavLockDB /tmp/DavLock.example
>   CustomLog /home/ksmith/logs/sitedav.log combined
>   ErrorLog /home/ksmith/logs/site_daverror.log
>   <location />
>         DAV On
>         AuthType Basic
>         AuthName "Example.com DAV"
>         AuthUserFile /home/ksmith/.htdavpass
>         #AllowOverride All
>         ForceType text/plain
>         require valid-user
>    </location>
> </virtualhost>
>
> notice the two virtualhosts are pointing at the same content.
>
> You would do something similar to create a, say,  
> phpadmin.example.com that turned on the directives you wanted:
>
> <virtualhost *>
>   ServerName phpa.example.com
>   DocumentRoot /usr/home/ksmith/http/
>   php_flag display_errors on
> </virtualhost>

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