Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Restrict access to localhost only

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  connect apache with php  
Author Message
user2942

External


Since: Aug 24, 2004
Posts: 3



(Msg. 1) Posted: Tue Aug 24, 2004 4:54 am
Post subject: Restrict access to localhost only
Archived from groups: alt>apache>configuration (more info?)

I want to prevent access to a specific directory with a .htaccess file. Only the
local PHP module should be allowed to access that directory.

I've put a .htaccess file in the directory:

<Directory />
Order Deny,Allow
Deny from all
Allow from (server's address here)
</Directory>

but it does not seem to work, though. By the way, would "localhost" be a legal
address in this directive?

Thanks,
Jörg

 >> Stay informed about: Restrict access to localhost only 
Back to top
Login to vote
user2865

External


Since: Jul 09, 2004
Posts: 13



(Msg. 2) Posted: Tue Aug 24, 2004 4:54 am
Post subject: Re: Restrict access to localhost only [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jörg Ellermann wrote:

 > I want to prevent access to a specific directory with a .htaccess file. Only the
 > local PHP module should be allowed to access that directory.
 >
 > I've put a .htaccess file in the directory:
 >
 > <Directory />
 > Order Deny,Allow
 > Deny from all
 > Allow from (server's address here)
 > </Directory>
 >
 > but it does not seem to work, though. By the way, would "localhost" be a legal
 > address in this directive?

Yes, localhost or 127 (as in 127.0.0.1)

<Directory />
Order Deny,Allow
Deny from all
Allow from 127
Allow from example.net
</Directory>

Consider keeping whatever files these are out of the document root, that
is, outside of public_html or whatever.

--
Matt


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
<a style='text-decoration: underline;' href="http://www.newsfeeds.com" target="_blank">http://www.newsfeeds.com</a> - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Restrict access to localhost only 
Back to top
Login to vote
user2943

External


Since: Aug 24, 2004
Posts: 1



(Msg. 3) Posted: Tue Aug 24, 2004 5:23 am
Post subject: Re: Restrict access to localhost only [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Matt wrote:

  >>I've put a .htaccess file in the directory:
  >>
  >><Directory />
  >>Order Deny,Allow
  >>Deny from all
  >>Allow from (server's address here)
  >></Directory>
  >>
  >>but it does not seem to work, though.

 > Yes, localhost or 127 (as in 127.0.0.1)
 >
 > <Directory />
 > Order Deny,Allow
 > Deny from all
 > Allow from 127
 > Allow from example.net
 > </Directory>

Thanks for answering. Although I've already found it - I didn't change the main
server config to allow .htaccess overrides.

BTW, after changing that, the above resulted in a sever error - <Directory> is
not allowed in .htaccess files.

Jörg<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Restrict access to localhost only 
Back to top
Login to vote
mnewsnospam

External


Since: Aug 13, 2004
Posts: 3



(Msg. 4) Posted: Tue Aug 24, 2004 1:10 pm
Post subject: Re: Restrict access to localhost only [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jörg Ellermann wrote:
 > Matt wrote:
 >
  >> <Directory />
  >> Order Deny,Allow
  >> Deny from all
  >> Allow from 127
  >> Allow from example.net
  >> </Directory>
 >
 > Thanks for answering. Although I've already found it - I didn't
 > change the main server config to allow .htaccess overrides.
 >
 > BTW, after changing that, the above resulted in a sever error -
 > <Directory> is not allowed in .htaccess files.

Well... Think of the .htaccess file as having an implicit "<Directory .>"
Smile

--
MVH Jeppe Uhd - NX <a style='text-decoration: underline;' href="http://nx.dk" target="_blank">http://nx.dk</a>
Webhosting for nørder og andet godtfolk<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Restrict access to localhost only 
Back to top
Login to vote
user2676

External


Since: Feb 11, 2004
Posts: 30



(Msg. 5) Posted: Fri Aug 27, 2004 7:39 pm
Post subject: Re: Restrict access to localhost only [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 >BTW, after changing that, the above resulted in a sever error - <Directory> is
 >not allowed in .htaccess files.
 >

because .htaccess only works for the directory it is IN....


frgr
Erik<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Restrict access to localhost only 
Back to top
Login to vote
user2676

External


Since: Feb 11, 2004
Posts: 30



(Msg. 6) Posted: Fri Aug 27, 2004 7:44 pm
Post subject: Re: Restrict access to localhost only [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 24 Aug 2004 01:54:10 +0200, Jörg Ellermann
<j.ellermann DeleteThis @tu-bs.de> wrote:

 >I want to prevent access to a specific directory with a .htaccess file. Only the
 >local PHP module should be allowed to access that directory.
 >
 >I've put a .htaccess file in the directory:
 >
 ><Directory />
 >Order Deny,Allow
 >Deny from all
 >Allow from (server's address here)
 ></Directory>
 >
 >but it does not seem to work, though. By the way, would "localhost" be a legal
 >address in this directive?
 >
 >Thanks,
 >Jörg


watch out: .htaccess is read at each request, so can give a
degradation in performance.
So IMHO it is best used by the maintainer of the directory it is in.
The server owner should put all his stuff in httpd.conf, which is only
accessed on server startup.
..
frgr
Erik<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Restrict access to localhost only 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
how to only allow access for localhost - Hi, Is it possible to set up Apache to only allow localhost access to my web files so no one else can gain access? Reason is I am developing some web pages but my computer is always online so I dont want anyone being able to find a web site here when..

ignoring localhost access? - Hi Does anyone know how to stop apache from logging access from the computer on which it's hosted (localhost)? My reason for this is that access from my computer is skewing the stats of my webserver, because I'm not an external visitor. Other computer...

restrict ssl - I want to restrict a directory containing cgi scripts to only be accessed via https.

How can i restrict the size of file uploads and downloads - I have a webserver that has various websites on it. What I want to be able to do is configure apache so that it will not allow files larger than about 5Mb to be downloaded. Therefore if it has some large files on it. They are not permitted to be..

localhost - Hello, I have loaded Apache 2.0 on XP. Configuration files look ok but when I go to http://localhost, the page is not found. Again, I have checked all of the entries in HTTP.conf and everything looks OK. Could it be browser settings ? Thank you for..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]