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

stop access

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Rewrite problems  
Author Message
josh4

External


Since: Jul 08, 2004
Posts: 3



(Msg. 1) Posted: Thu Jul 08, 2004 2:29 pm
Post subject: stop access
Archived from groups: alt>apache>configuration (more info?)

hi all
how can i prevent access to some directories?
i would that this folders will read only by my php script

can i use mod_rewrite?

tnx

 >> Stay informed about: stop access 
Back to top
Login to vote
alvaro_quitar_1

External


Since: Oct 31, 2003
Posts: 86



(Msg. 2) Posted: Thu Jul 08, 2004 3:15 pm
Post subject: Re: stop access [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

*** j0sh wrote/escribió (Thu, 8 Jul 2004 11:29:15 +0200):
 > how can i prevent access to some directories?
 > i would that this folders will read only by my php script

I understand you don't want anyone to download your data files through a
web server. If you want to stop access from file system that'd be pretty
difficult since the folder needs to allow access for Apache user or your
PHP scripts won't work.

I'd recommend that you simply move all that stuff outside the web server
tree. For instance, if your web is at

  /home/foo/htdocs
 
create a folder like this

  /home/foo/data
 
If that's impossible (because your web tree is at /home/foo and you can't
access upper levers) then you'd need to handle with Apache configuration.
You can use mod_auth to ask for a password (there needn't be one Wink, you
can use a Deny directive in a directory container... a long etc.

 > can i use mod_rewrite?

I guess so. But I don't think it's worth the effort.


--
--
-- Álvaro G. Vicario - Burgos, Spain
--<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: stop access 
Back to top
Login to vote
josh4

External


Since: Jul 08, 2004
Posts: 3



(Msg. 3) Posted: Thu Jul 08, 2004 3:40 pm
Post subject: Re: stop access [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alvaro G Vicario ha scritto:
 >
 > I'd recommend that you simply move all that stuff outside the web
 > server tree. For instance, if your web is at
 >
 > /home/foo/htdocs
 >
 > create a folder like this
 >
 > /home/foo/data

this is the best way but unfortunately i can't create folder outside the web
server tree

 > If that's impossible (because your web tree is at /home/foo and you
 > can't access upper levers) then you'd need to handle with Apache
 > configuration. You can use mod_auth to ask for a password (there
 > needn't be one Wink, you can use a Deny directive in a directory
 > container... a long etc.

in this way can i include or read this files via php?<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: stop access 
Back to top
Login to vote
alvaro_quitar_1

External


Since: Oct 31, 2003
Posts: 86



(Msg. 4) Posted: Thu Jul 08, 2004 4:11 pm
Post subject: Re: stop access [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

*** j0sh wrote/escribió (Thu, 8 Jul 2004 12:40:50 +0200):
  >> If that's impossible (because your web tree is at /home/foo and you
  >> can't access upper levers) then you'd need to handle with Apache
  >> configuration. You can use mod_auth to ask for a password (there
  >> needn't be one Wink, you can use a Deny directive in a directory
  >> container... a long etc.
 >
 > in this way can i include or read this files via php?

Sure, given that you use file system to load the files, not web server:

$lines = file ('/home/user/foo/data.csv'); // Will work fine
$lines = file ('foo/data.csv'); // Will work fine if path is OK
$lines = file ('http://www.example.com/foo/data.csv'); // Won't work


--
--
-- Álvaro G. Vicario - Burgos, Spain
--<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: stop access 
Back to top
Login to vote
josh4

External


Since: Jul 08, 2004
Posts: 3



(Msg. 5) Posted: Thu Jul 08, 2004 4:19 pm
Post subject: Re: stop access [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alvaro G Vicario ha scritto:
 > *** j0sh wrote/escribió (Thu, 8 Jul 2004 12:40:50 +0200):
   >>> If that's impossible (because your web tree is at /home/foo and you
   >>> can't access upper levers) then you'd need to handle with Apache
   >>> configuration. You can use mod_auth to ask for a password (there
   >>> needn't be one Wink, you can use a Deny directive in a directory
   >>> container... a long etc.
  >>
  >> in this way can i include or read this files via php?
 >
 > Sure, given that you use file system to load the files, not web
 > server:
 >
 > $lines = file ('/home/user/foo/data.csv'); // Will work fine
 > $lines = file ('foo/data.csv'); // Will work fine if path is OK
 > $lines = file ('http://www.example.com/foo/data.csv'); // Won't work

right... thank you!<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: stop access 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
stop access to files - HI oh great apache world I'm building a site which is username / password access,after making this access point idiot proof i realised , i am the real idiot, once past the access point anyone can actually go straight to the next page , once they have..

Start and stop - Hi! What´s wrong? I have to stop and start apache each time I upload a file to the server. Is this really right? sometimes I have to stop during watching my files. I use Apache as a localhostserver. thanks for help regards Bengan

Why must I stop and start apache? - I have a problem when I upload new pages to my server. I use apache 2 with php 4 something as localhost on WinXP Home and it use to work just fine but now suddenly I must stop and start apache to be able to see the new pages. The pages are made in php an...

how can I stop file veiwing? - Is there a way I can stop direct access to files in a directory yet still provide access when the user follows a link to these files? Hopefully this will be a simple task. I'm just not finding it in the docs. apache2.0.48(win32) Thx, Nikki PS. I'm....

Can I stop a server removing the www. prefix ? - When accessing a website (on a third party server - so my scope for modifying the configuration is limited) in some circumstances the "www." prefix gets removed. These circumstances appear to be: if I access http://www.mysite.co.uk/index.html...
   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 ]